├── gen_docs.sh
├── src
├── webdriver
│ ├── dummy.cc
│ ├── webdriver_view_id.cc
│ ├── webdriver_switches.cc
│ ├── wdversion.cc
│ ├── webdriver_version.h
│ ├── commands
│ │ ├── title_command.cc
│ │ ├── source_command.cc
│ │ └── appcache_status_command.cc
│ ├── extension_qt
│ │ ├── q_event_filter.cc
│ │ ├── widget_view_handle.cc
│ │ ├── qwindow_view_handle.cc
│ │ ├── widget_element_handle.cc
│ │ ├── qml_objname_util.cc
│ │ ├── graphics_web_view_handle.cc
│ │ ├── q_content_type_resolver.h
│ │ ├── uinput_event_dispatcher.cc
│ │ └── declarative_item_view_handle.cc
│ ├── webdriver_view_runner.cc
│ ├── whitelist.xsd
│ ├── webdriver_session_manager.cc
│ └── url_command_wrapper.h
├── third_party
│ ├── mimetypes-qt4
│ │ ├── include
│ │ │ ├── QMimeType
│ │ │ ├── QStandardPaths
│ │ │ └── QMimeDatabase
│ │ ├── mimetypes
│ │ │ ├── mimetypes.qrc
│ │ │ └── mimetypes.pri
│ │ └── README
│ ├── webdriver
│ │ ├── LICENSE
│ │ └── README.chromium
│ ├── modp_b64
│ │ ├── modp_b64.gyp
│ │ └── README.chromium
│ └── mongoose
│ │ └── ReadMe.txt
├── base
│ ├── third_party
│ │ ├── xdg_user_dirs
│ │ │ ├── README.chromium
│ │ │ └── LICENSE
│ │ ├── dynamic_annotations
│ │ │ ├── README.chromium
│ │ │ ├── dynamic_annotations.gyp
│ │ │ └── LICENSE
│ │ └── icu
│ │ │ └── README.chromium
│ ├── message_pump.cc
│ ├── message_loop_proxy.cc
│ ├── platform_file.cc
│ ├── file_util_android.cc
│ ├── android
│ │ ├── path_service_android.h
│ │ ├── base_jni_registrar.h
│ │ ├── java
│ │ │ └── src
│ │ │ │ └── org
│ │ │ │ └── chromium
│ │ │ │ └── base
│ │ │ │ ├── AccessedByNative.java
│ │ │ │ ├── JNINamespace.java
│ │ │ │ ├── PathService.java
│ │ │ │ ├── CalledByNative.java
│ │ │ │ ├── LocaleUtils.java
│ │ │ │ ├── NativeClassQualifiedName.java
│ │ │ │ └── CalledByNativeUnchecked.java
│ │ ├── locale_utils.h
│ │ ├── path_service_android.cc
│ │ ├── jni_registrar.cc
│ │ ├── jni_registrar.h
│ │ ├── jni_array_unittest.cc
│ │ ├── base_jni_registrar.cc
│ │ ├── jni_string.h
│ │ ├── path_utils.h
│ │ ├── jni_helper.h
│ │ └── jni_generator
│ │ │ └── jni_generator.gyp
│ ├── debug
│ │ ├── alias.cc
│ │ └── debugger.cc
│ ├── metrics
│ │ └── histogram_base.cc
│ ├── tracking_info.cc
│ ├── rand_util_win.cc
│ ├── os_compat_android.h
│ ├── profiler
│ │ ├── scoped_profile.cc
│ │ └── alternate_timer.cc
│ ├── scoped_nsautorelease_pool.mm
│ ├── synchronization
│ │ ├── lock_impl_win.cc
│ │ ├── lock.cc
│ │ └── lock_impl_posix.cc
│ ├── base_paths.cc
│ ├── threading
│ │ ├── thread_checker_impl.cc
│ │ ├── thread_local_posix.cc
│ │ ├── thread_local_win.cc
│ │ └── thread_local_storage_posix.cc
│ ├── file_util_mac.mm
│ ├── memory
│ │ └── singleton.cc
│ ├── mac
│ │ ├── mac_logging.cc
│ │ └── scoped_mach_port.cc
│ ├── callback_internal.cc
│ ├── message_pump_android.h
│ ├── thread_task_runner_handle.cc
│ └── base64.cc
├── net
│ └── base
│ │ ├── file_stream_metrics_posix.cc
│ │ ├── file_stream_whence.h
│ │ ├── file_stream_net_log_parameters.cc
│ │ ├── file_stream_net_log_parameters.h
│ │ ├── completion_callback.h
│ │ ├── net_log_source_type_list.h
│ │ ├── net_export.h
│ │ └── file_stream_metrics.h
└── Test
│ ├── WindowTest.cc
│ ├── RestyledLabel.cc
│ ├── WindowTest.h
│ ├── RestyledLabel.h
│ ├── ElementSelectingTest.cc
│ ├── MenuTest.h
│ ├── FindingTest.h
│ ├── BasicMouseInterfaceTest.h
│ ├── StaleElementReferenceTest.h
│ ├── CoordinatesTest.h
│ ├── TouchTest.h
│ ├── TypingTest.h
│ ├── WidgetAndWebViewTest.h
│ ├── ElementSelectingTest.h
│ ├── ClickTest.h
│ ├── DragableWidget.h
│ ├── GraphicsWebViewTest.cc
│ ├── FormHandlingTest.h
│ ├── ClickScrollingTest.h
│ ├── WindowWithEmbeddedViewTest.h
│ ├── StaleElementReferenceTest.cc
│ ├── VisibilityTest.h
│ ├── GraphicsWebViewTest.h
│ ├── WindowWithDeclarativeViewTest.h
│ └── XPathElementFindingTest.h
├── test_data
└── TestVideo.ogv
├── platform
├── android
│ ├── androidwd.keystore
│ └── java
│ │ └── version.xml
├── win
│ ├── wd_qt4.8.5.gypi
│ ├── Readme_4.8.5.txt
│ ├── Readme_5.1.0.txt
│ ├── Readme_5.2.0.txt
│ ├── wd_qt5.2.0.gypi
│ └── wd_qt5.1.0.gypi
├── mac
│ ├── wd_qt4.gypi
│ ├── wd_qt5.gypi
│ ├── wd_qt4_64.gypi
│ ├── wd_qt5_64.gypi
│ ├── Readme_qt4_64.txt
│ ├── Readme_qt5.txt
│ ├── Readme_qt4.txt
│ └── Readme_qt5_64.txt
└── ios
│ ├── run_ios.sh
│ ├── wd_qt5.gypi
│ ├── .gitignore
│ ├── wd
│ └── wd.qml
│ └── Readme_qt5.txt
├── webdriver.sublime-build
├── qt4_sample_config.gypi
├── .gitignore
├── qt5_sample_config.gypi
├── qtwebeng_sample_config.gypi
├── inc
├── base
│ ├── callback_forward.h
│ ├── base_paths_mac.h
│ ├── debug
│ │ └── alias.h
│ ├── base_switches.h
│ ├── memory
│ │ └── scoped_policy.h
│ ├── base_paths_android.h
│ ├── eintr_wrapper.h
│ ├── base64.h
│ ├── float_util.h
│ ├── event_types.h
│ ├── base_paths_posix.h
│ ├── base_export.h
│ ├── third_party
│ │ └── dmg_fp
│ │ │ └── dmg_fp.h
│ ├── thread_task_runner_handle.h
│ ├── message_pump_default.h
│ ├── message_pump_dispatcher.h
│ ├── tracking_info.h
│ ├── auto_reset.h
│ ├── message_loop_proxy.h
│ ├── environment.h
│ ├── threading
│ │ ├── thread_checker_impl.h
│ │ └── post_task_and_reply_impl.h
│ ├── mac
│ │ └── scoped_nsautorelease_pool.h
│ ├── win
│ │ └── scoped_co_mem.h
│ ├── single_thread_task_runner.h
│ └── json
│ │ └── string_escape.h
├── extension_qt
│ ├── qwebviewext.h
│ ├── widget_element_handle.h
│ ├── widget_view_handle.h
│ ├── event_dispatcher.h
│ ├── quick2_view_enumerator.h
│ ├── qml_view_enumerator.h
│ ├── web_view_enumerator.h
│ ├── widget_view_enumerator.h
│ ├── graphics_web_view_enumerator.h
│ └── qml_web_view_enumerator.h
└── commands
│ ├── keys_command.h
│ ├── title_command.h
│ ├── source_command.h
│ ├── appcache_status_command.h
│ ├── screenshot_command.h
│ ├── browser_connection_command.h
│ ├── html5_location_commands.h
│ ├── orientation_command.h
│ ├── execute_command.h
│ ├── log_command.h
│ ├── sessions.h
│ └── execute_async_script_command.h
├── do_if_modified.py
├── generate_wdversion.py
├── Readme.md
├── wd_common.gypi
├── wd_qt_tools.gypi
├── generate_android_json.py
└── docker
└── Dockerfile
/gen_docs.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | cat Doxyfile | doxygen -
3 |
4 |
--------------------------------------------------------------------------------
/src/webdriver/dummy.cc:
--------------------------------------------------------------------------------
1 | void mostUnusefulFunction(void) {
2 | int a = 2+2*3;
3 | }
--------------------------------------------------------------------------------
/src/third_party/mimetypes-qt4/include/QMimeType:
--------------------------------------------------------------------------------
1 | #include "../mimetypes/qmimetype.h"
2 |
--------------------------------------------------------------------------------
/src/third_party/mimetypes-qt4/include/QStandardPaths:
--------------------------------------------------------------------------------
1 | #include "qstandardpaths.h"
2 |
--------------------------------------------------------------------------------
/src/third_party/mimetypes-qt4/include/QMimeDatabase:
--------------------------------------------------------------------------------
1 | #include "../mimetypes/qmimedatabase.h"
2 |
--------------------------------------------------------------------------------
/test_data/TestVideo.ogv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cisco-open-source/qtwebdriver/HEAD/test_data/TestVideo.ogv
--------------------------------------------------------------------------------
/platform/android/androidwd.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cisco-open-source/qtwebdriver/HEAD/platform/android/androidwd.keystore
--------------------------------------------------------------------------------
/src/third_party/webdriver/LICENSE:
--------------------------------------------------------------------------------
1 | NAME: WebDriver
2 | URL: http://selenium.googlecode.com/svn/trunk/py
3 | http://selenium.googlecode.com/svn/trunk/common/src/web
4 | LICENSE: Apache 2
5 |
--------------------------------------------------------------------------------
/platform/win/wd_qt4.8.5.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT_BIN_PATH': 'c:\\Qt\\4.8.5\\bin',
4 | 'QT_INC_PATH': 'c:\\Qt\\4.8.5\\include',
5 | 'QT_LIB_PATH': 'c:\\Qt\\4.8.5\\lib',
6 | },
7 | }
8 |
--------------------------------------------------------------------------------
/src/third_party/mimetypes-qt4/mimetypes/mimetypes.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | mime/packages/freedesktop.org.xml
4 |
5 |
6 |
--------------------------------------------------------------------------------
/platform/android/java/version.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | AndroidManifest.xml
4 | libs.xml
5 | logo.png
6 | icon.png
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/third_party/mimetypes-qt4/README:
--------------------------------------------------------------------------------
1 | This is mimetypes-qt4 library.
2 | This library is a backport of the Qt 5 mimetypes api to Qt 4.
3 | The git reference is http://qt.gitorious.org/qt/qtbase.
4 | The license to apply is the same as the original Qt code.
--------------------------------------------------------------------------------
/webdriver.sublime-build:
--------------------------------------------------------------------------------
1 | {
2 | "shell_cmd": "./build.sh",
3 | //"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
4 | "file_regex": "^(?:\\.\\./)+(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
5 | "working_dir": "${project_path:${folder}}"
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/platform/win/Readme_4.8.5.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Win7 install: http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-vs2010.exe
4 |
5 | Setup:
6 | ------
7 | In Qt command prompt run WebDriver.exe
--------------------------------------------------------------------------------
/platform/mac/wd_qt4.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '0', # change to '1' for enabling Qt5
4 | 'QT_BIN_PATH': '/usr/local/opt/qt4/bin',
5 | 'QT_INC_PATH': '/usr/local/opt/qt4/include',
6 | 'QT_LIB_PATH': '/usr/local/opt/qt4/lib',
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/platform/mac/wd_qt5.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '1', # change to '1' for enabling Qt5
4 | 'QT_BIN_PATH': '/usr/local/opt/qt5/bin',
5 | 'QT_INC_PATH': '/usr/local/opt/qt5/include',
6 | 'QT_LIB_PATH': '/usr/local/opt/qt5/lib',
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/platform/mac/wd_qt4_64.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '0', # change to '1' for enabling Qt5
4 | 'QT_BIN_PATH': '/usr/local/opt/qt4_64/bin',
5 | 'QT_INC_PATH': '/usr/local/opt/qt4_64/include',
6 | 'QT_LIB_PATH': '/usr/local/opt/qt4_64/lib',
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/platform/mac/wd_qt5_64.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '1', # change to '1' for enabling Qt5
4 | 'QT_BIN_PATH': '/usr/local/opt/qt5_64/bin',
5 | 'QT_INC_PATH': '/usr/local/opt/qt5_64/include',
6 | 'QT_LIB_PATH': '/usr/local/opt/qt5_64/lib',
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/platform/win/Readme_5.1.0.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Win7 install: http://download.qt-project.org/official_releases/qt/5.1/5.1.0/qt-windows-opensource-5.1.0-msvc2010-x86-offline.exe
4 |
5 | Setup:
6 | ------
7 | In Qt command prompt run WebDriver.exe
--------------------------------------------------------------------------------
/platform/win/Readme_5.2.0.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Win7 install: http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-msvc2010-x86-offline.exe
4 |
5 | Setup:
6 | ------
7 | In Qt command prompt run WebDriver.exe
--------------------------------------------------------------------------------
/platform/ios/run_ios.sh:
--------------------------------------------------------------------------------
1 | /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication /Users/build/GIT/wd_ios/platform/ios/wd_test/build/Debug-iphonesimulator/wd_test.app/wd_test
2 |
--------------------------------------------------------------------------------
/platform/win/wd_qt5.2.0.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '1',
4 | 'QT_BIN_PATH': 'c:\\Qt\\Qt5.2.0\\5.2.0\\msvc2010\\bin',
5 | 'QT_INC_PATH': 'c:\\Qt\\Qt5.2.0\\5.2.0\\msvc2010\\include',
6 | 'QT_LIB_PATH': 'c:\\Qt\\Qt5.2.0\\5.2.0\\msvc2010\\lib',
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/platform/win/wd_qt5.1.0.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '1',
4 | 'QT_BIN_PATH': 'c:\\Qt\\Qt5.1.0\\5.1.0\\msvc2010\\bin',
5 | 'QT_INC_PATH': 'c:\\Qt\\Qt5.1.0\\5.1.0\\msvc2010\\include',
6 | 'QT_LIB_PATH': 'c:\\Qt\\Qt5.1.0\\5.1.0\\msvc2010\\lib',
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_user_dirs/README.chromium:
--------------------------------------------------------------------------------
1 | Name: xdg-user-dirs
2 | URL: http://www.freedesktop.org/wiki/Software/xdg-user-dirs
3 | License: MIT
4 |
5 | This directory include xdg-user-dir-lookup.c renamed as xdg_user_dir_lookup.cc
6 | from xdg-user-dirs 0.10. We made xdg_user_dir_lookup() non-static and added a
7 | xdg_user_dir_lookup.h.
8 |
--------------------------------------------------------------------------------
/src/base/message_pump.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/message_pump.h"
6 |
7 | namespace base {
8 |
9 | MessagePump::MessagePump() {
10 | }
11 |
12 | MessagePump::~MessagePump() {
13 | }
14 |
15 | } // namespace base
16 |
--------------------------------------------------------------------------------
/platform/ios/wd_qt5.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables':
3 | {
4 | 'QT5': '1',
5 | 'QT_BIN_PATH': '/usr/local/opt/qt5_ios/bin',
6 | 'QT_INC_PATH': '/usr/local/opt/qt5_ios/include',
7 | 'QT_LIB_PATH': '/usr/local/opt/qt5_ios/lib',
8 | 'WD_CONFIG_WEBKIT': '0',
9 | 'WD_CONFIG_QUICK': '1',
10 | 'WD_CONFIG_PLAYER': '1',
11 | 'WD_BUILD_MONGOOSE': '1',
12 | },
13 | }
14 |
--------------------------------------------------------------------------------
/qt4_sample_config.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '0',
4 | 'WD_CONFIG_QWIDGET_BASE': '1',
5 | 'WD_CONFIG_WEBKIT': '1',
6 | 'WD_CONFIG_QUICK': '1',
7 | 'WD_CONFIG_PLAYER': '0',
8 | 'WD_CONFIG_ONE_KEYRELEASE': '0',
9 | 'QT_INC_PATH': '/home/hekra01/qt-4.8.6/include',
10 | 'QT_BIN_PATH': '/home/hekra01/qt-4.8.6/bin',
11 | 'QT_LIB_PATH': '/home/hekra01/qt-4.8.6/lib'
12 | },
13 | }
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build.properties
2 | *.o
3 | *.user
4 | *.pyc
5 | *.log
6 | src/moc_*.cc
7 | test/Java/.idea/workspace.xml
8 | *.db
9 | *.orig
10 | test/Java/out
11 | *.autosave
12 | .idea*
13 | report/*
14 | /bin/
15 | /lib/
16 | /out/
17 | /build/
18 | /docs/
19 | /mocs/
20 | wd.gypi
21 | /wd.Makefile
22 | /Makefile
23 | /WebDriver.target.mk
24 | /WebDriverTest.target.mk
25 | /src/webdriver/webdriver_version.cc
26 | /build-*
27 | .DS_Store
--------------------------------------------------------------------------------
/qt5_sample_config.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '1',
4 | 'WD_CONFIG_QWIDGET_BASE': '1',
5 | # If Qt >= 5.6 set 'WD_CONFIG_WEBKIT' : '0'
6 | 'WD_CONFIG_WEBKIT': '1',
7 | 'WD_CONFIG_QUICK': '1',
8 | 'WD_CONFIG_PLAYER': '0',
9 | 'WD_CONFIG_ONE_KEYRELEASE': '0',
10 | 'QT_INC_PATH': '/home/hekra01/qt/include',
11 | 'QT_BIN_PATH': '/home/hekra01/qt/bin',
12 | 'QT_LIB_PATH': '/home/hekra01/qt/lib'
13 | },
14 | }
15 |
--------------------------------------------------------------------------------
/src/base/message_loop_proxy.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/message_loop_proxy.h"
6 |
7 | #include "base/bind.h"
8 |
9 | namespace base {
10 |
11 | MessageLoopProxy::MessageLoopProxy() {
12 | }
13 |
14 | MessageLoopProxy::~MessageLoopProxy() {
15 | }
16 |
17 | } // namespace base
18 |
--------------------------------------------------------------------------------
/qtwebeng_sample_config.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5': '1',
4 | 'WD_CONFIG_QWIDGET_BASE': '1',
5 | # If Qt >= 5.6 set 'WD_CONFIG_WEBKIT' : '0'
6 | 'WD_CONFIG_WEBKIT': '0',
7 | 'WD_CONFIG_QUICK': '1',
8 | 'WD_CONFIG_PLAYER': '0',
9 | 'WD_CONFIG_ONE_KEYRELEASE': '0',
10 | 'QT_INC_PATH': '/home/hekra01/qt/include',
11 | 'QT_BIN_PATH': '/home/hekra01/qt/bin',
12 | 'QT_LIB_PATH': '/home/hekra01/qt/lib'
13 | },
14 | }
15 |
--------------------------------------------------------------------------------
/platform/ios/.gitignore:
--------------------------------------------------------------------------------
1 | # Mac OS X
2 | *.DS_Store
3 |
4 | # Xcode
5 | *.pbxuser
6 | *.mode1v3
7 | *.mode2v3
8 | *.perspectivev3
9 | *.xcuserstate
10 | project.xcworkspace/
11 | xcuserdata/
12 |
13 | # Generated files
14 | *.o
15 | *.pyc
16 |
17 |
18 | #Python modules
19 | MANIFEST
20 | dist/
21 | build*
22 |
23 | # Backup files
24 | *~.nib
25 |
26 | DerivedData/
27 | ui_*
28 | Release*
29 | Debug*
30 | *.xcodeproj
31 | Makefile*
32 | Info.plist
33 | *stash
34 |
35 |
--------------------------------------------------------------------------------
/inc/base/callback_forward.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_CALLBACK_FORWARD_H_
6 | #define BASE_CALLBACK_FORWARD_H_
7 |
8 | namespace base {
9 |
10 | template
11 | class Callback;
12 |
13 | typedef Callback Closure;
14 |
15 | } // namespace base
16 |
17 | #endif // BASE_CALLBACK_FORWARD_H
18 |
--------------------------------------------------------------------------------
/src/base/platform_file.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/platform_file.h"
6 |
7 | namespace base {
8 |
9 | PlatformFileInfo::PlatformFileInfo()
10 | : size(0),
11 | is_directory(false),
12 | is_symbolic_link(false) {
13 | }
14 |
15 | PlatformFileInfo::~PlatformFileInfo() {}
16 |
17 | } // namespace base
18 |
--------------------------------------------------------------------------------
/src/base/file_util_android.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/file_util.h"
6 |
7 | #include "base/file_path.h"
8 | #include "base/path_service.h"
9 |
10 | namespace file_util {
11 |
12 | bool GetShmemTempDir(FilePath* path, bool executable) {
13 | return PathService::Get(base::DIR_CACHE, path);
14 | }
15 |
16 | } // namespace file_util
17 |
--------------------------------------------------------------------------------
/src/net/base/file_stream_metrics_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "net/base/file_stream_metrics.h"
6 |
7 | namespace net {
8 |
9 | int GetFileErrorUmaBucket(int error) {
10 | return 1;
11 | }
12 |
13 | int MaxFileErrorUmaBucket() {
14 | return 2;
15 | }
16 |
17 | int MaxFileErrorUmaValue() {
18 | return 160;
19 | }
20 |
21 | } // namespace net
22 |
--------------------------------------------------------------------------------
/src/base/android/path_service_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_PATH_SERVICE_ANDROID_H_
6 | #define BASE_ANDROID_PATH_SERVICE_ANDROID_H_
7 |
8 | #include
9 |
10 | namespace base {
11 | namespace android {
12 |
13 | bool RegisterPathService(JNIEnv* env);
14 |
15 | } // namespace android
16 | } // namespace base
17 |
18 | #endif // BASE_ANDROID_PATH_SERVICE_ANDROID_H_
19 |
--------------------------------------------------------------------------------
/src/third_party/modp_b64/modp_b64.gyp:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | {
6 | 'targets': [
7 | {
8 | 'target_name': 'modp_b64',
9 | 'type': 'static_library',
10 | 'toolsets': ['host', 'target'],
11 | 'sources': [
12 | 'modp_b64.cc',
13 | 'modp_b64.h',
14 | 'modp_b64_data.h',
15 | ],
16 | 'include_dirs': [
17 | '../..',
18 | ],
19 | },
20 | ],
21 | }
22 |
--------------------------------------------------------------------------------
/src/third_party/mongoose/ReadMe.txt:
--------------------------------------------------------------------------------
1 | This project contains version 3.1 of the Mongoose web server project, as
2 | found at http://code.google.com/p/mongoose.
3 |
4 | It contains the code for version 3.1 as of 06-Nov-2011 (revision 4b235538bc43).
5 |
6 | It contains an additional change in pthread_cond_broadcast() [~line 872] to
7 | improve stability when running a debug build.
8 |
9 | It also contains changes added by the Chromium team to better support
10 | Keep-Alive connections. These changes can be found at
11 | http://codereview.chromium.org/8423073/patch/1028/12029
--------------------------------------------------------------------------------
/platform/mac/Readme_qt4_64.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Mac OS X install:
4 | Download QT sources from
5 | http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip
6 | Unzip and build sources for native (64bit) architecture
7 | > configure -opensource -confirm-license -nomake examples -nomake tests -release -arch x86_64
8 | > make
9 | > make install
10 | See more details here
11 | http://qt-project.org/doc/qt-4.8/install-mac.html
12 |
13 | Setup:
14 | ------
15 | In command prompt run WebDriver or WebDriver_noWebkit
--------------------------------------------------------------------------------
/platform/mac/Readme_qt5.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Mac OS X install:
4 | Download QT sources from
5 | http://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz
6 | Untar and build sources for 32bit architecture
7 | > configure -release -fast -opensource -confirm-license -platform macx-clang-32 -no-framework
8 | > make
9 | > make install
10 | See more details here
11 | http://qt-project.org/doc/qt-5/macosx-building.html
12 |
13 | Setup:
14 | ------
15 | In command prompt run WebDriver or WebDriver_noWebkit
--------------------------------------------------------------------------------
/src/base/debug/alias.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/debug/alias.h"
6 | #include "build/build_config.h"
7 |
8 | namespace base {
9 | namespace debug {
10 |
11 | #if defined(COMPILER_MSVC)
12 | #pragma optimize("", off)
13 | #endif
14 |
15 | void Alias(const void* var) {
16 | }
17 |
18 | #if defined(COMPILER_MSVC)
19 | #pragma optimize("", on)
20 | #endif
21 |
22 | } // namespace debug
23 | } // namespace base
24 |
--------------------------------------------------------------------------------
/platform/mac/Readme_qt4.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Mac OS X install:
4 | Download QT sources from
5 | http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip
6 | Unzip and build sources for 32bit architecture, because binary installation package is 64-bit only
7 | > configure -release -fast -opensource -confirm-license -arch i386
8 | > make
9 | > make install
10 | See more details here
11 | http://qt-project.org/doc/qt-4.8/install-mac.html
12 |
13 | Setup:
14 | ------
15 | In command prompt run WebDriver or WebDriver_noWebkit
--------------------------------------------------------------------------------
/src/base/android/base_jni_registrar.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_BASE_JNI_REGISTRAR_H_
6 | #define BASE_ANDROID_BASE_JNI_REGISTRAR_H_
7 |
8 | #include
9 |
10 | namespace base {
11 | namespace android {
12 |
13 | // Register all JNI bindings necessary for base.
14 | bool RegisterJni(JNIEnv* env);
15 |
16 | } // namespace android
17 | } // namespace base
18 |
19 | #endif // BASE_ANDROID_BASE_JNI_REGISTRAR_H_
20 |
--------------------------------------------------------------------------------
/platform/mac/Readme_qt5_64.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt Mac OS X install:
4 | Download QT sources from
5 | http://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz
6 | Untar and build sources for native (64bit) architecture
7 | > configure -opensource -confirm-license -nomake examples -nomake tests -release -arch x86_64 -no-framework
8 | > make
9 | > make install
10 | See more details here
11 | http://qt-project.org/doc/qt-5/macosx-building.html
12 |
13 | Setup:
14 | ------
15 | In command prompt run WebDriver or WebDriver_noWebkit
--------------------------------------------------------------------------------
/src/net/base/file_stream_whence.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef NET_BASE_FILE_STREAM_WHENCE_H_
6 | #define NET_BASE_FILE_STREAM_WHENCE_H_
7 |
8 | namespace net {
9 |
10 | // TODO(darin): Move this to a more generic location.
11 | // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
12 | enum Whence {
13 | FROM_BEGIN = 0,
14 | FROM_CURRENT = 1,
15 | FROM_END = 2
16 | };
17 |
18 | } // namespace net
19 |
20 | #endif // NET_BASE_FILE_STREAM_WHENCE_H_
21 |
--------------------------------------------------------------------------------
/src/base/third_party/dynamic_annotations/README.chromium:
--------------------------------------------------------------------------------
1 | Name: dynamic annotations
2 | URL: http://code.google.com/p/data-race-test/wiki/DynamicAnnotations
3 | Version: 4384
4 | License: BSD
5 |
6 | One header and one source file (dynamic_annotations.h and dynamic_annotations.c)
7 | in this directory define runtime macros useful for annotating synchronization
8 | utilities and benign data races so data race detectors can handle Chromium code
9 | with better precision.
10 |
11 | These files were taken from
12 | http://code.google.com/p/data-race-test/source/browse/?#svn/trunk/dynamic_annotations
13 | The files are covered under BSD license as described within the files.
14 |
--------------------------------------------------------------------------------
/platform/ios/wd/wd.qml:
--------------------------------------------------------------------------------
1 | /*
2 | imports.qml
3 |
4 | Declaration of QML Imports
5 | required by project.
6 |
7 | This is necessary if we want
8 | to keep qml files in a folder
9 | separate from .pro file because
10 | of the way qmlimportscanner works.
11 | If these imports are not declared,
12 | qmake will not recognize them,
13 | and QtQuick will not be packaged
14 | with statically built apps (i.e. iOS)
15 | and imported at runtime.
16 |
17 | This must be kept in the same
18 | directory as your .pro file
19 | */
20 |
21 | import QtQuick 2.1
22 | import QtQuick.Controls 1.1
23 | import QtMultimedia 5.0
24 |
25 | QtObject {}
--------------------------------------------------------------------------------
/inc/base/base_paths_mac.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE_PATHS_MAC_H_
6 | #define BASE_BASE_PATHS_MAC_H_
7 |
8 | // This file declares Mac-specific path keys for the base module.
9 | // These can be used with the PathService to access various special
10 | // directories and files.
11 |
12 | namespace base {
13 |
14 | enum {
15 | PATH_MAC_START = 200,
16 |
17 | DIR_APP_DATA, // ~/Library/Application Support
18 |
19 | PATH_MAC_END
20 | };
21 |
22 | } // namespace base
23 |
24 | #endif // BASE_BASE_PATHS_MAC_H_
25 |
--------------------------------------------------------------------------------
/inc/base/debug/alias.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_DEBUG_ALIAS_H_
6 | #define BASE_DEBUG_ALIAS_H_
7 |
8 | #include "base/base_export.h"
9 |
10 | namespace base {
11 | namespace debug {
12 |
13 | // Make the optimizer think that var is aliased. This is to prevent it from
14 | // optimizing out variables that that would not otherwise be live at the point
15 | // of a potential crash.
16 | void BASE_EXPORT Alias(const void* var);
17 |
18 | } // namespace debug
19 | } // namespace base
20 |
21 | #endif // BASE_DEBUG_ALIAS_H_
22 |
--------------------------------------------------------------------------------
/src/base/third_party/icu/README.chromium:
--------------------------------------------------------------------------------
1 | Name: ICU
2 | URL: http://site.icu-project.org/
3 | License: MIT
4 | License File: NOT_SHIPPED
5 |
6 | This file has the relevant components from ICU copied to handle basic
7 | UTF8/16/32 conversions. Components are copied from utf.h utf8.h utf16.h and
8 | utf_impl.c
9 |
10 | The same module appears in third_party/icu, so we don't repeat the license
11 | file here.
12 |
13 | The main change is that U_/U8_/U16_ prefixes have been replaced with
14 | CBU_/CBU8_/CBU16_ (for "Chrome Base") to avoid confusion with the "real" ICU
15 | macros should ICU be in use on the system. For the same reason, the functions
16 | and types have been put in the "base_icu" namespace.
17 |
--------------------------------------------------------------------------------
/do_if_modified.py:
--------------------------------------------------------------------------------
1 | import subprocess as sp
2 | import os
3 | import sys
4 |
5 | if (len(sys.argv) != 4):
6 | print 'Wrong usage:'
7 | print ' do_if_modified '
8 | exit()
9 |
10 | action_process = os.path.abspath(sys.argv[1])
11 | input_file = os.path.abspath(sys.argv[2])
12 | output_file = os.path.abspath(sys.argv[3])
13 |
14 | need_update = True
15 |
16 | if (os.path.exists(output_file)):
17 |
18 | input_mtime = os.path.getmtime(input_file)
19 | output_mtime = os.path.getmtime(output_file)
20 |
21 | if (input_mtime < output_mtime):
22 | need_update = False
23 |
24 | if need_update:
25 | p = sp.Popen([action_process, input_file , "-o", output_file], stdin=sp.PIPE, stdout=sp.PIPE)
26 |
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/AccessedByNative.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @AccessedByNative is used to ensure proguard will keep this field, since it's
14 | * only accessed by native.
15 | */
16 | @Target(ElementType.FIELD)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | public @interface AccessedByNative {
19 | public String value() default "";
20 | }
21 |
--------------------------------------------------------------------------------
/src/base/metrics/histogram_base.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/metrics/histogram_base.h"
6 |
7 | #include
8 |
9 | namespace base {
10 |
11 | const HistogramBase::Sample HistogramBase::kSampleType_MAX = INT_MAX;
12 |
13 | HistogramBase::HistogramBase(const std::string& name)
14 | : histogram_name_(name),
15 | flags_(kNoFlags) {}
16 |
17 | HistogramBase::~HistogramBase() {}
18 |
19 | void HistogramBase::SetFlags(int32 flags) {
20 | flags_ |= flags;
21 | }
22 |
23 | void HistogramBase::ClearFlags(int32 flags) {
24 | flags_ &= ~flags;
25 | }
26 |
27 | } // namespace base
28 |
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/JNINamespace.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @JNINamespace is used by the JNI generator to create the necessary JNI
14 | * bindings and expose this method to native code using the specified namespace.
15 | */
16 | @Target(ElementType.TYPE)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | public @interface JNINamespace {
19 | public String value();
20 | }
21 |
--------------------------------------------------------------------------------
/inc/base/base_switches.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // Defines all the "base" command-line switches.
6 |
7 | #ifndef BASE_BASE_SWITCHES_H_
8 | #define BASE_BASE_SWITCHES_H_
9 |
10 | namespace switches {
11 |
12 | extern const char kDebugOnStart[];
13 | extern const char kDisableBreakpad[];
14 | extern const char kEnableDCHECK[];
15 | extern const char kFullMemoryCrashReport[];
16 | extern const char kNoErrorDialogs[];
17 | extern const char kTestChildProcess[];
18 | extern const char kV[];
19 | extern const char kVModule[];
20 | extern const char kWaitForDebugger[];
21 |
22 | } // namespace switches
23 |
24 | #endif // BASE_BASE_SWITCHES_H_
25 |
--------------------------------------------------------------------------------
/inc/extension_qt/qwebviewext.h:
--------------------------------------------------------------------------------
1 | #ifndef QWEBVIEWEXT_H
2 | #define QWEBVIEWEXT_H
3 |
4 | #include
5 | #include
6 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
7 | #include
8 | #else
9 | #include
10 | #endif
11 |
12 | class QNetworkAccessManagerTracer;
13 |
14 | class QWebViewExt : public QWebView
15 | {
16 | Q_OBJECT
17 | public:
18 | explicit QWebViewExt(QWidget *parent = 0);
19 | virtual ~QWebViewExt();
20 |
21 |
22 | protected:
23 | QWebView* createWindow(QWebPage::WebWindowType type);
24 |
25 | private:
26 | void setWebInspectorProperty(QWebViewExt* view);
27 | void setNetworkAccessManagerTracer();
28 | QNetworkAccessManagerTracer* manager_;
29 | };
30 |
31 | #endif // QWEBVIEWEXT_H
32 |
--------------------------------------------------------------------------------
/inc/base/memory/scoped_policy.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MEMORY_SCOPED_POLICY_H_
6 | #define BASE_MEMORY_SCOPED_POLICY_H_
7 |
8 | namespace base {
9 | namespace scoped_policy {
10 |
11 | // Defines the ownership policy for a scoped object.
12 | enum OwnershipPolicy {
13 | // The scoped object takes ownership of an object by taking over an existing
14 | // ownership claim.
15 | ASSUME,
16 |
17 | // The scoped object will retain the the object and any initial ownership is
18 | // not changed.
19 | RETAIN
20 | };
21 |
22 | } // namespace scoped_policy
23 | } // namespace base
24 |
25 | #endif // BASE_MEMORY_SCOPED_POLICY_H_
26 |
--------------------------------------------------------------------------------
/src/net/base/file_stream_net_log_parameters.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "net/base/file_stream_net_log_parameters.h"
6 |
7 | #include "base/values.h"
8 |
9 | namespace net {
10 |
11 | base::Value* NetLogFileStreamErrorCallback(
12 | FileErrorSource source,
13 | int os_error,
14 | net::Error net_error,
15 | NetLog::LogLevel /* log_level */) {
16 | DictionaryValue* dict = new DictionaryValue();
17 |
18 | dict->SetString("operation", GetFileErrorSourceName(source));
19 | dict->SetInteger("os_error", os_error);
20 | dict->SetInteger("net_error", net_error);
21 |
22 | return dict;
23 | }
24 |
25 | } // namespace net
26 |
--------------------------------------------------------------------------------
/inc/base/base_paths_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE_PATHS_ANDROID_H_
6 | #define BASE_BASE_PATHS_ANDROID_H_
7 |
8 | // This file declares Android-specific path keys for the base module.
9 | // These can be used with the PathService to access various special
10 | // directories and files.
11 |
12 | namespace base {
13 |
14 | enum {
15 | PATH_ANDROID_START = 300,
16 |
17 | DIR_ANDROID_APP_DATA, // Directory where to put Android app's data.
18 | DIR_ANDROID_EXTERNAL_STORAGE, // Android external storage directory.
19 |
20 | PATH_ANDROID_END
21 | };
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_BASE_PATHS_ANDROID_H_
26 |
--------------------------------------------------------------------------------
/src/base/tracking_info.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/tracking_info.h"
6 |
7 | #include
8 | #include "base/tracked_objects.h"
9 |
10 | namespace base {
11 |
12 | TrackingInfo::TrackingInfo()
13 | : birth_tally(NULL) {
14 | }
15 |
16 | TrackingInfo::TrackingInfo(
17 | const tracked_objects::Location& posted_from,
18 | base::TimeTicks delayed_run_time)
19 | : birth_tally(
20 | tracked_objects::ThreadData::TallyABirthIfActive(posted_from)),
21 | time_posted(TimeTicks::Now()),
22 | delayed_run_time(delayed_run_time) {
23 | }
24 |
25 | TrackingInfo::~TrackingInfo() {}
26 |
27 | } // namespace base
28 |
29 |
--------------------------------------------------------------------------------
/generate_wdversion.py:
--------------------------------------------------------------------------------
1 | import subprocess as sp
2 |
3 | filename = "./src/webdriver/webdriver_version.cc"
4 | p = sp.Popen(["git", "describe" , "--abbrev=10", "--dirty", "--always"], stdin=sp.PIPE, stdout=sp.PIPE)
5 |
6 | data = p.stdout.readline()
7 |
8 | versionfile = open (filename, 'w')
9 | versionfile.write("namespace webdriver {\n")
10 | versionfile.write("extern const char kProductName[] = \"WebDriver-cisco-cmt\";\n")
11 | versionfile.write("extern const char kVersionNumber[] = \"1.3.3\";\n")
12 | versionfile.write("extern const char kBuildTime[] = __TIME__;\n")
13 | versionfile.write("extern const char kBuildDate[] = __DATE__;\n")
14 | versionfile.write("extern const char kLastChanges[] = \"" + data.strip() + "\";\n")
15 | versionfile.write("}")
16 | versionfile.close()
17 |
18 | p.stdout.close()
19 | p.stdin.close()
20 |
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/PathService.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | /**
8 | * This class provides java side access to the native PathService.
9 | */
10 | @JNINamespace("base::android")
11 | public abstract class PathService {
12 |
13 | // Must match the value of DIR_MODULE in base/base_paths.h!
14 | public static final int DIR_MODULE = 3;
15 |
16 | // Prevent instantiation.
17 | private PathService() {}
18 |
19 | public static void override(int what, String path) {
20 | nativeOverride(what, path);
21 | }
22 |
23 | private static native void nativeOverride(int what, String path);
24 | }
25 |
--------------------------------------------------------------------------------
/src/base/android/locale_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_LOCALE_UTILS_H_
6 | #define BASE_ANDROID_LOCALE_UTILS_H_
7 |
8 | #include
9 |
10 | #include
11 |
12 | #include "base/string16.h"
13 |
14 | namespace base {
15 | namespace android {
16 |
17 | // Return the current default locale of the device.
18 | std::string GetDefaultLocale();
19 |
20 | string16 GetDisplayNameForLocale(const std::string& locale,
21 | const std::string& display_locale);
22 |
23 | bool RegisterLocaleUtils(JNIEnv* env);
24 |
25 | } // namespace android
26 | } // namespace base
27 |
28 | #endif // BASE_ANDROID_LOCALE_UTILS_H_
29 |
--------------------------------------------------------------------------------
/src/base/rand_util_win.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/rand_util.h"
6 |
7 | #include
8 |
9 | #include "base/basictypes.h"
10 | #include "base/logging.h"
11 |
12 | namespace {
13 |
14 | uint32 RandUint32() {
15 | uint32 number;
16 | CHECK_EQ(rand_s(&number), 0);
17 | return number;
18 | }
19 |
20 | } // namespace
21 |
22 | namespace base {
23 |
24 | // NOTE: This function must be cryptographically secure. http://crbug.com/140076
25 | uint64 RandUint64() {
26 | uint32 first_half = RandUint32();
27 | uint32 second_half = RandUint32();
28 | return (static_cast(first_half) << 32) + second_half;
29 | }
30 |
31 | } // namespace base
32 |
--------------------------------------------------------------------------------
/src/webdriver/webdriver_view_id.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "webdriver_view_id.h"
6 |
7 | namespace webdriver {
8 |
9 | ViewId::ViewId() : is_valid_(false) {}
10 |
11 | ViewId::ViewId(const std::string& id) : id_(id), is_valid_(true) {}
12 |
13 | ViewId::~ViewId() {}
14 |
15 | bool ViewId::is_valid() const {
16 | return is_valid_;
17 | }
18 |
19 | bool ViewId::operator==(const ViewId &other) const {
20 | return (id_ == other.id());
21 | }
22 |
23 | bool ViewId::operator!=(const ViewId &other) const {
24 | return !(*this == other);
25 | }
26 |
27 | bool ViewId::operator<(const ViewId &other) const {
28 | return (id_ < other.id());
29 | }
30 |
31 |
32 | } // namespace webdriver
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/CalledByNative.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @CalledByNative is used by the JNI generator to create the necessary JNI
14 | * bindings and expose this method to native code.
15 | */
16 | @Target(ElementType.METHOD)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | public @interface CalledByNative {
19 | /*
20 | * If present, tells which inner class the method belongs to.
21 | */
22 | public String value() default "";
23 | }
24 |
--------------------------------------------------------------------------------
/src/base/android/path_service_android.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/android/path_service_android.h"
6 |
7 | #include "base/file_path.h"
8 | #include "base/path_service.h"
9 | #include "base/android/jni_android.h"
10 | #include "base/android/jni_string.h"
11 | //#include "jni/PathService_jni.h"
12 |
13 | namespace base {
14 | namespace android {
15 |
16 | void Override(JNIEnv* env, jclass clazz, jint what, jstring path) {
17 | FilePath file_path(ConvertJavaStringToUTF8(env, path));
18 | // PathService::Override(what, file_path);
19 | }
20 |
21 | bool RegisterPathService(JNIEnv* env) {
22 | // return RegisterNativesImpl(env);
23 | }
24 |
25 | } // namespace android
26 | } // namespace base
27 |
--------------------------------------------------------------------------------
/src/third_party/mimetypes-qt4/mimetypes/mimetypes.pri:
--------------------------------------------------------------------------------
1 | # Qt core mimetype module
2 |
3 | HEADERS += \
4 | mimetypes/qmimedatabase.h \
5 | mimetypes/qmimetype.h \
6 | mimetypes/qmimemagicrulematcher_p.h \
7 | mimetypes/qmimetype_p.h \
8 | mimetypes/qmimetypeparser_p.h \
9 | mimetypes/qmimedatabase_p.h \
10 | mimetypes/qmimemagicrule_p.h \
11 | mimetypes/qmimeglobpattern_p.h \
12 | mimetypes/qmimeprovider_p.h
13 |
14 | SOURCES += \
15 | mimetypes/qmimedatabase.cpp \
16 | mimetypes/qmimetype.cpp \
17 | mimetypes/qmimemagicrulematcher.cpp \
18 | mimetypes/qmimetypeparser.cpp \
19 | mimetypes/qmimemagicrule.cpp \
20 | mimetypes/qmimeglobpattern.cpp \
21 | mimetypes/qmimeprovider.cpp
22 |
23 | RESOURCES += \
24 | mimetypes/mimetypes.qrc
25 |
26 |
--------------------------------------------------------------------------------
/src/base/android/jni_registrar.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/android/jni_registrar.h"
6 |
7 | #include "base/logging.h"
8 | #include "base/android/jni_android.h"
9 |
10 | namespace base {
11 | namespace android {
12 |
13 | bool RegisterNativeMethods(JNIEnv* env,
14 | const RegistrationMethod* method,
15 | size_t count) {
16 | const RegistrationMethod* end = method + count;
17 | while (method != end) {
18 | if (!method->func(env) < 0) {
19 | DLOG(ERROR) << method->name << " failed registration!";
20 | return false;
21 | }
22 | method++;
23 | }
24 | return true;
25 | }
26 |
27 | } // namespace android
28 | } // namespace base
29 |
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/LocaleUtils.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | import java.util.Locale;
8 |
9 | /**
10 | * This class provides the locale related methods for the native library.
11 | */
12 | class LocaleUtils {
13 |
14 | private LocaleUtils() { /* cannot be instantiated */ }
15 |
16 | /**
17 | * @return the default locale.
18 | */
19 | @CalledByNative
20 | public static String getDefaultLocale() {
21 | Locale locale = Locale.getDefault();
22 | String language = locale.getLanguage();
23 | String country = locale.getCountry();
24 | return country.isEmpty() ? language : language + "-" + country;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/net/base/file_stream_net_log_parameters.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // File stream error reporting.
6 |
7 | #ifndef NET_BASE_FILE_STREAM_NET_LOG_PARAMETERS_H_
8 | #define NET_BASE_FILE_STREAM_NET_LOG_PARAMETERS_H_
9 |
10 | #include
11 |
12 | #include "net/base/file_stream_metrics.h"
13 | #include "net/base/net_errors.h"
14 | #include "net/base/net_log.h"
15 |
16 | namespace net {
17 |
18 | // Creates NetLog parameters when a FileStream has an error.
19 | base::Value* NetLogFileStreamErrorCallback(
20 | FileErrorSource source,
21 | int os_error,
22 | net::Error net_error,
23 | NetLog::LogLevel log_level);
24 |
25 | } // namespace net
26 |
27 | #endif // NET_BASE_FILE_STREAM_NET_LOG_PARAMETERS_H_
28 |
--------------------------------------------------------------------------------
/src/base/android/jni_registrar.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_JNI_REGISTRAR_H_
6 | #define BASE_ANDROID_JNI_REGISTRAR_H_
7 |
8 | #include
9 | #include "base/basictypes.h"
10 |
11 | namespace base {
12 | namespace android {
13 |
14 | struct RegistrationMethod;
15 |
16 | // Registers the JNI bindings for the specified |method| definition containing
17 | // |count| elements. Returns whether the registration of the given methods
18 | // succeeded.
19 | bool RegisterNativeMethods(JNIEnv* env,
20 | const RegistrationMethod* method,
21 | size_t count);
22 |
23 | } // namespace android
24 | } // namespace base
25 |
26 | #endif // BASE_ANDROID_JNI_REGISTRAR_H_
27 |
--------------------------------------------------------------------------------
/inc/base/eintr_wrapper.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This provides a wrapper around system calls which may be interrupted by a
6 | // signal and return EINTR. See man 7 signal.
7 | //
8 | // On Windows, this wrapper macro does nothing.
9 |
10 | #ifndef BASE_EINTR_WRAPPER_H_
11 | #define BASE_EINTR_WRAPPER_H_
12 |
13 | #include "build/build_config.h"
14 |
15 | #if defined(OS_POSIX)
16 |
17 | #include
18 |
19 | #define HANDLE_EINTR(x) ({ \
20 | typeof(x) __eintr_result__; \
21 | do { \
22 | __eintr_result__ = (x); \
23 | } while (__eintr_result__ == -1 && errno == EINTR); \
24 | __eintr_result__;\
25 | })
26 |
27 | #else
28 |
29 | #define HANDLE_EINTR(x) (x)
30 |
31 | #endif // OS_POSIX
32 |
33 | #endif // BASE_EINTR_WRAPPER_H_
34 |
--------------------------------------------------------------------------------
/inc/base/base64.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE64_H__
6 | #define BASE_BASE64_H__
7 |
8 | #include
9 |
10 | #include "base/base_export.h"
11 | #include "base/string_piece.h"
12 |
13 | namespace base {
14 |
15 | // Encodes the input string in base64. Returns true if successful and false
16 | // otherwise. The output string is only modified if successful.
17 | BASE_EXPORT bool Base64Encode(const StringPiece& input, std::string* output);
18 |
19 | // Decodes the base64 input string. Returns true if successful and false
20 | // otherwise. The output string is only modified if successful.
21 | BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_BASE64_H__
26 |
--------------------------------------------------------------------------------
/src/third_party/modp_b64/README.chromium:
--------------------------------------------------------------------------------
1 | Name: modp base64 decoder
2 | Short Name: stringencoders
3 | URL: http://code.google.com/p/stringencoders/
4 | Version: unknown
5 | License: BSD
6 | Security Critical: yes
7 |
8 | Description:
9 | The modp_b64.c file was modified to remove the inclusion of modp's config.h
10 | and to fix compilation errors that occur under VC8. The file was renamed
11 | modp_b64.cc to force it to be compiled as C++ so that the inclusion of
12 | basictypes.h could be possible.
13 |
14 | The file modp_b64_data.h was generated by modp_b64_gen.c (under Linux),
15 | which is not included in this directory. The resulting header was
16 | modified to not include when COMPILER_MSVC is defined (since
17 | that header file does not exist under VC8), but instead in that case to
18 | include "base/basictypes.h" and provide the required typedefs for
19 | uint8_t and uint32_t using uint8 and uint32.
20 |
--------------------------------------------------------------------------------
/inc/base/float_util.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_FLOAT_UTIL_H_
6 | #define BASE_FLOAT_UTIL_H_
7 |
8 | #include "build/build_config.h"
9 |
10 | #include
11 | #include
12 | #include
13 |
14 | namespace base {
15 |
16 | template
17 | inline bool IsFinite(const Float& number) {
18 | #if defined(OS_POSIX)
19 | return std::isfinite(number) != 0;
20 | #elif defined(OS_WIN)
21 | return _finite(number) != 0;
22 | #endif
23 | }
24 |
25 | template
26 | inline bool IsNaN(const Float& number) {
27 | #if defined(OS_POSIX)
28 | return std::isnan(number) != 0;
29 | #elif defined(OS_WIN)
30 | return _isnan(number) != 0;
31 | #endif
32 | }
33 |
34 | } // namespace base
35 |
36 | #endif // BASE_FLOAT_UTIL_H_
37 |
--------------------------------------------------------------------------------
/src/base/os_compat_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_OS_COMPAT_ANDROID_H_
6 | #define BASE_OS_COMPAT_ANDROID_H_
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | // Not implemented in Bionic.
13 | extern "C" int futimes(int fd, const struct timeval tv[2]);
14 |
15 | // Not exposed or implemented in Bionic.
16 | extern "C" char* mkdtemp(char* path);
17 |
18 | // Android has no timegm().
19 | extern "C" time_t timegm(struct tm* const t);
20 |
21 | // The lockf() function is not available on Android; we translate to flock().
22 | #define F_LOCK LOCK_EX
23 | #define F_ULOCK LOCK_UN
24 | inline int lockf(int fd, int cmd, off_t ignored_len) {
25 | return flock(fd, cmd);
26 | }
27 |
28 | #endif // BASE_OS_COMPAT_ANDROID_H_
29 |
--------------------------------------------------------------------------------
/platform/ios/Readme_qt5.txt:
--------------------------------------------------------------------------------
1 | Minumum Requirements
2 | ---------------------
3 | * Qt iOS X install:
4 | Please note that QT library is needed for developing only. If you want just run application on iOs simulator you may skip this step.
5 | Latest WebDriver test application is based on Qt 5.2.0. You may install it by image from http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-mac-opensource-5.2.0-ios-x86_64-offline.dmg.
6 |
7 |
8 | Setup:
9 | ------
10 | In command prompt run iOS simulator with WebDriver application (wd.app) e.g.
11 | ios-sim launch ./wd.app
12 |
13 | By default device family is iPhone. In order to run iPad simulator just run ios-sim with --family argument e.g.
14 | ios-sim launch ./wd.app --family ipad
15 |
16 | In order to add argument to WebDriver just use --args. For example, VideoTests require video file placed in WD repository:
17 | ios-sim launch ./wd.app --args --test_data_folder=/Users/build/git/wd/test_data
18 |
--------------------------------------------------------------------------------
/inc/base/event_types.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_EVENT_TYPES_H
6 | #define BASE_EVENT_TYPES_H
7 |
8 | #include "build/build_config.h"
9 |
10 | #if defined(OS_WIN)
11 | #include
12 | #elif defined(USE_X11)
13 | typedef union _XEvent XEvent;
14 | #elif defined(OS_MACOSX)
15 | #if defined(__OBJC__)
16 | @class NSEvent;
17 | #else // __OBJC__
18 | class NSEvent;
19 | #endif // __OBJC__
20 | #endif
21 |
22 | namespace base {
23 |
24 | // Cross platform typedefs for native event types.
25 | #if defined(OS_WIN)
26 | typedef MSG NativeEvent;
27 | #elif defined(USE_X11)
28 | typedef XEvent* NativeEvent;
29 | #elif defined(OS_MACOSX)
30 | typedef NSEvent* NativeEvent;
31 | #else
32 | typedef void* NativeEvent;
33 | #endif
34 |
35 | } // namespace base
36 |
37 | #endif // BASE_EVENT_TYPES_H
38 |
--------------------------------------------------------------------------------
/src/base/profiler/scoped_profile.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/profiler/scoped_profile.h"
6 |
7 | #include "base/location.h"
8 | #include "base/tracked_objects.h"
9 |
10 |
11 | namespace tracked_objects {
12 |
13 |
14 | ScopedProfile::ScopedProfile(const Location& location)
15 | : birth_(ThreadData::TallyABirthIfActive(location)),
16 | start_of_run_(ThreadData::NowForStartOfRun(birth_)) {
17 | }
18 |
19 | ScopedProfile::~ScopedProfile() {
20 | StopClockAndTally();
21 | }
22 |
23 | void ScopedProfile::StopClockAndTally() {
24 | if (!birth_)
25 | return;
26 | ThreadData::TallyRunInAScopedRegionIfTracking(birth_, start_of_run_,
27 | ThreadData::NowForEndOfRun());
28 | birth_ = NULL;
29 | }
30 |
31 | } // namespace tracked_objects
32 |
--------------------------------------------------------------------------------
/inc/extension_qt/widget_element_handle.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_QT_WIDGET_ELEMENT_H_
6 | #define WEBDRIVER_QT_WIDGET_ELEMENT_H_
7 |
8 | #include
9 |
10 | #include "webdriver_element_id.h"
11 |
12 | #include
13 |
14 |
15 | namespace webdriver {
16 |
17 |
18 | class QElementHandle : public ElementHandle {
19 | public:
20 | QElementHandle();
21 | QElementHandle(QObject* element);
22 |
23 | virtual bool is_valid() const { return !element_.isNull(); }
24 | virtual bool equals(const ElementHandle* other) const;
25 | QObject* get() { return element_.data(); }
26 |
27 | protected:
28 | QPointer element_;
29 | virtual ~QElementHandle() {}
30 | };
31 |
32 | } // namespace webdriver
33 |
34 | #endif // WEBDRIVER_QT_WIDGET_ELEMENT_H_
35 |
--------------------------------------------------------------------------------
/src/base/scoped_nsautorelease_pool.mm:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/mac/scoped_nsautorelease_pool.h"
6 |
7 | #import
8 |
9 | #include "base/logging.h"
10 |
11 | namespace base {
12 | namespace mac {
13 |
14 | ScopedNSAutoreleasePool::ScopedNSAutoreleasePool()
15 | : autorelease_pool_([[NSAutoreleasePool alloc] init]) {
16 | DCHECK(autorelease_pool_);
17 | }
18 |
19 | ScopedNSAutoreleasePool::~ScopedNSAutoreleasePool() {
20 | [autorelease_pool_ drain];
21 | }
22 |
23 | // Cycle the internal pool, allowing everything there to get cleaned up and
24 | // start anew.
25 | void ScopedNSAutoreleasePool::Recycle() {
26 | [autorelease_pool_ drain];
27 | autorelease_pool_ = [[NSAutoreleasePool alloc] init];
28 | DCHECK(autorelease_pool_);
29 | }
30 |
31 | } // namespace mac
32 | } // namespace base
33 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Synopsis
2 | QtWebDriver is a WebDriver implementation for Qt.
3 |
4 | It can be used to perform automated Selenium testing of applications based on:
5 | * QtWebkit
6 | * QWidgets
7 | * QQuick1 (Qt4) or QQuick2 (Qt5)
8 |
9 | If you hadn't used Selenium for automated testing, you may also find this links helpful:
10 | * https://github.com/seleniumhq/selenium
11 | * http://docs.seleniumhq.org/
12 |
13 | # Build and run
14 | * The build instructions are detailed in the wiki: https://github.com/cisco-open-source/qtwebdriver/wiki/Build-And-Run
15 | * Release notes and pre-built binaries are in the Releases section: https://github.com/cisco-open-source/qtwebdriver/releases
16 |
17 | # Other links
18 | * An example how to customize QtWebDriver in `src/Test/main.cc`
19 | * [Doxygen](http://cisco-open-source.github.io/qtwebdriver/html)
20 | * [Wiki](https://github.com/cisco-open-source/qtwebdriver/wiki)
21 | * Mailing list: qtwebdriver-users@external.cisco.com
22 |
23 | # License
24 | LGPLv2.1
25 |
--------------------------------------------------------------------------------
/inc/base/base_paths_posix.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE_PATHS_POSIX_H_
6 | #define BASE_BASE_PATHS_POSIX_H_
7 |
8 | // This file declares windows-specific path keys for the base module.
9 | // These can be used with the PathService to access various special
10 | // directories and files.
11 |
12 | namespace base {
13 |
14 | enum {
15 | PATH_POSIX_START = 400,
16 |
17 | DIR_CACHE, // Directory where to put cache data. Note this is
18 | // *not* where the browser cache lives, but the
19 | // browser cache can be a subdirectory.
20 | // This is $XDG_CACHE_HOME on Linux and
21 | // ~/Library/Caches on Mac.
22 | DIR_HOME, // $HOME on POSIX-like systems.
23 |
24 | PATH_POSIX_END
25 | };
26 |
27 | } // namespace base
28 |
29 | #endif // BASE_BASE_PATHS_POSIX_H_
30 |
--------------------------------------------------------------------------------
/src/net/base/completion_callback.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef NET_BASE_COMPLETION_CALLBACK_H__
6 | #define NET_BASE_COMPLETION_CALLBACK_H__
7 |
8 | #include "base/callback.h"
9 | #include "base/cancelable_callback.h"
10 |
11 | namespace net {
12 |
13 | // A callback specialization that takes a single int parameter. Usually this is
14 | // used to report a byte count or network error code.
15 | typedef base::Callback CompletionCallback;
16 |
17 | // 64bit version of callback specialization that takes a single int64 parameter.
18 | // Usually this is used to report a file offset, size or network error code.
19 | typedef base::Callback Int64CompletionCallback;
20 |
21 | typedef base::CancelableCallback CancelableCompletionCallback;
22 |
23 | } // namespace net
24 |
25 | #endif // NET_BASE_COMPLETION_CALLBACK_H__
26 |
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/NativeClassQualifiedName.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @NativeClassQualifiedName is used by the JNI generator to create the necessary JNI
14 | * bindings to call into the specified native class name.
15 | */
16 | @Target(ElementType.METHOD)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | public @interface NativeClassQualifiedName {
19 | /*
20 | * Tells which native class the method is going to be bound to.
21 | * The first parameter of the annotated method must be an int nativePtr pointing to
22 | * an instance of this class.
23 | */
24 | public String value();
25 | }
26 |
--------------------------------------------------------------------------------
/src/base/synchronization/lock_impl_win.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/synchronization/lock_impl.h"
6 |
7 | namespace base {
8 | namespace internal {
9 |
10 | LockImpl::LockImpl() {
11 | // The second parameter is the spin count, for short-held locks it avoid the
12 | // contending thread from going to sleep which helps performance greatly.
13 | ::InitializeCriticalSectionAndSpinCount(&os_lock_, 2000);
14 | }
15 |
16 | LockImpl::~LockImpl() {
17 | ::DeleteCriticalSection(&os_lock_);
18 | }
19 |
20 | bool LockImpl::Try() {
21 | if (::TryEnterCriticalSection(&os_lock_) != FALSE) {
22 | return true;
23 | }
24 | return false;
25 | }
26 |
27 | void LockImpl::Lock() {
28 | ::EnterCriticalSection(&os_lock_);
29 | }
30 |
31 | void LockImpl::Unlock() {
32 | ::LeaveCriticalSection(&os_lock_);
33 | }
34 |
35 | } // namespace internal
36 | } // namespace base
37 |
--------------------------------------------------------------------------------
/src/base/base_paths.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/base_paths.h"
6 |
7 | #include "base/file_path.h"
8 | #include "base/file_util.h"
9 | #include "base/path_service.h"
10 |
11 | namespace base {
12 |
13 | bool PathProvider(int key, FilePath* result) {
14 | // NOTE: DIR_CURRENT is a special case in PathService::Get
15 |
16 | FilePath cur;
17 | switch (key) {
18 | case base::DIR_EXE:
19 | PathService::Get(base::FILE_EXE, &cur);
20 | cur = cur.DirName();
21 | break;
22 | case base::DIR_MODULE:
23 | PathService::Get(base::FILE_MODULE, &cur);
24 | cur = cur.DirName();
25 | break;
26 | case base::DIR_TEMP:
27 | if (!file_util::GetTempDir(&cur))
28 | return false;
29 | break;
30 | default:
31 | return false;
32 | }
33 |
34 | *result = cur;
35 | return true;
36 | }
37 |
38 | } // namespace base
39 |
--------------------------------------------------------------------------------
/src/Test/WindowTest.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | /* WindowTest.cc
21 | */
22 |
23 | #include "WindowTest.h"
24 |
25 | WindowTestWidget::WindowTestWidget()
26 | {}
27 |
28 | WindowTestWidget::~WindowTestWidget()
29 | {}
30 |
--------------------------------------------------------------------------------
/src/base/threading/thread_checker_impl.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/threading/thread_checker_impl.h"
6 |
7 | namespace base {
8 |
9 | ThreadCheckerImpl::ThreadCheckerImpl()
10 | : valid_thread_id_(kInvalidThreadId) {
11 | EnsureThreadIdAssigned();
12 | }
13 |
14 | ThreadCheckerImpl::~ThreadCheckerImpl() {}
15 |
16 | bool ThreadCheckerImpl::CalledOnValidThread() const {
17 | EnsureThreadIdAssigned();
18 | AutoLock auto_lock(lock_);
19 | return valid_thread_id_ == PlatformThread::CurrentId();
20 | }
21 |
22 | void ThreadCheckerImpl::DetachFromThread() {
23 | AutoLock auto_lock(lock_);
24 | valid_thread_id_ = kInvalidThreadId;
25 | }
26 |
27 | void ThreadCheckerImpl::EnsureThreadIdAssigned() const {
28 | AutoLock auto_lock(lock_);
29 | if (valid_thread_id_ != kInvalidThreadId)
30 | return;
31 | valid_thread_id_ = PlatformThread::CurrentId();
32 | }
33 |
34 | } // namespace base
35 |
--------------------------------------------------------------------------------
/src/Test/RestyledLabel.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "RestyledLabel.h"
21 |
22 | RestyledLabel::RestyledLabel(const QString &text, QWidget *parent)
23 | : QLabel(text, parent)
24 | {
25 | setFrameShape(QFrame::StyledPanel);
26 | }
27 |
--------------------------------------------------------------------------------
/inc/commands/keys_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_KEYS_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_KEYS_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Error;
20 | class Response;
21 |
22 | /// Send a sequence of key strokes to the page.
23 | class KeysCommand : public ViewCommand {
24 | public:
25 | KeysCommand(const std::vector& path_segments,
26 | const DictionaryValue* const parameters);
27 | virtual ~KeysCommand();
28 |
29 | virtual bool DoesPost() const OVERRIDE;
30 | virtual void ExecutePost(Response* const response) OVERRIDE;
31 |
32 | private:
33 | DISALLOW_COPY_AND_ASSIGN(KeysCommand);
34 | };
35 |
36 | } // namespace webdriver
37 |
38 | #endif // WEBDRIVER_COMMANDS_KEYS_COMMAND_H_
39 |
--------------------------------------------------------------------------------
/src/base/threading/thread_local_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/threading/thread_local.h"
6 |
7 | #include
8 |
9 | #include "base/logging.h"
10 |
11 | namespace base {
12 |
13 | namespace internal {
14 |
15 | // static
16 | void ThreadLocalPlatform::AllocateSlot(SlotType& slot) {
17 | int error = pthread_key_create(&slot, NULL);
18 | CHECK_EQ(error, 0);
19 | }
20 |
21 | // static
22 | void ThreadLocalPlatform::FreeSlot(SlotType& slot) {
23 | int error = pthread_key_delete(slot);
24 | DCHECK_EQ(0, error);
25 | }
26 |
27 | // static
28 | void* ThreadLocalPlatform::GetValueFromSlot(SlotType& slot) {
29 | return pthread_getspecific(slot);
30 | }
31 |
32 | // static
33 | void ThreadLocalPlatform::SetValueInSlot(SlotType& slot, void* value) {
34 | int error = pthread_setspecific(slot, value);
35 | DCHECK_EQ(error, 0);
36 | }
37 |
38 | } // namespace internal
39 |
40 | } // namespace base
41 |
--------------------------------------------------------------------------------
/src/net/base/net_log_source_type_list.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // NOTE: No header guards are used, since this file is intended to be expanded
6 | // directly within a block where the SOURCE_TYPE macro is defined.
7 |
8 | // Used for global events which don't correspond to a particular entity.
9 | SOURCE_TYPE(NONE)
10 |
11 | SOURCE_TYPE(URL_REQUEST)
12 | SOURCE_TYPE(SOCKET_STREAM)
13 | SOURCE_TYPE(PROXY_SCRIPT_DECIDER)
14 | SOURCE_TYPE(CONNECT_JOB)
15 | SOURCE_TYPE(SOCKET)
16 | SOURCE_TYPE(SPDY_SESSION)
17 | SOURCE_TYPE(HOST_RESOLVER_IMPL_REQUEST)
18 | SOURCE_TYPE(HOST_RESOLVER_IMPL_JOB)
19 | SOURCE_TYPE(DISK_CACHE_ENTRY)
20 | SOURCE_TYPE(MEMORY_CACHE_ENTRY)
21 | SOURCE_TYPE(HTTP_STREAM_JOB)
22 | SOURCE_TYPE(EXPONENTIAL_BACKOFF_THROTTLING)
23 | SOURCE_TYPE(UDP_SOCKET)
24 | SOURCE_TYPE(CERT_VERIFIER_JOB)
25 | SOURCE_TYPE(HTTP_PIPELINED_CONNECTION)
26 | SOURCE_TYPE(DOWNLOAD)
27 | SOURCE_TYPE(FILESTREAM)
28 | SOURCE_TYPE(IPV6_PROBE_JOB)
29 |
30 |
--------------------------------------------------------------------------------
/src/base/android/jni_array_unittest.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/android/jni_array.h"
6 |
7 | #include "base/android/jni_android.h"
8 | #include "base/android/scoped_java_ref.h"
9 | #include "testing/gtest/include/gtest/gtest.h"
10 |
11 | namespace base {
12 | namespace android {
13 |
14 | TEST(JniArray, BasicConversions) {
15 | const uint8 kBytes[] = { 0, 1, 2, 3 };
16 | const size_t kLen = arraysize(kBytes);
17 | JNIEnv* env = AttachCurrentThread();
18 | ScopedJavaLocalRef bytes = ToJavaByteArray(env, kBytes, kLen);
19 | ASSERT_TRUE(bytes.obj());
20 |
21 | std::vector vec(5);
22 | JavaByteArrayToByteVector(env, bytes.obj(), &vec);
23 | EXPECT_EQ(4U, vec.size());
24 | EXPECT_EQ(std::vector(kBytes, kBytes + kLen), vec);
25 |
26 | AppendJavaByteArrayToByteVector(env, bytes.obj(), &vec);
27 | EXPECT_EQ(8U, vec.size());
28 | }
29 |
30 | } // namespace android
31 | } // namespace base
32 |
--------------------------------------------------------------------------------
/inc/base/base_export.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE_EXPORT_H_
6 | #define BASE_BASE_EXPORT_H_
7 |
8 | #if defined(COMPONENT_BUILD)
9 | #if defined(WIN32)
10 |
11 | #if defined(BASE_IMPLEMENTATION)
12 | #define BASE_EXPORT __declspec(dllexport)
13 | #define BASE_EXPORT_PRIVATE __declspec(dllexport)
14 | #else
15 | #define BASE_EXPORT __declspec(dllimport)
16 | #define BASE_EXPORT_PRIVATE __declspec(dllimport)
17 | #endif // defined(BASE_IMPLEMENTATION)
18 |
19 | #else // defined(WIN32)
20 | #if defined(BASE_IMPLEMENTATION)
21 | #define BASE_EXPORT __attribute__((visibility("default")))
22 | #define BASE_EXPORT_PRIVATE __attribute__((visibility("default")))
23 | #else
24 | #define BASE_EXPORT
25 | #define BASE_EXPORT_PRIVATE
26 | #endif // defined(BASE_IMPLEMENTATION)
27 | #endif
28 |
29 | #else // defined(COMPONENT_BUILD)
30 | #define BASE_EXPORT
31 | #define BASE_EXPORT_PRIVATE
32 | #endif
33 |
34 | #endif // BASE_BASE_EXPORT_H_
35 |
--------------------------------------------------------------------------------
/src/webdriver/webdriver_switches.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "webdriver_switches.h"
6 |
7 | namespace webdriver {
8 |
9 | const char Switches::kUrlBase[] = "url-base";
10 |
11 | const char Switches::kPort[] = "port";
12 |
13 | const char Switches::kRoot[] = "root";
14 |
15 | const char Switches::kHttpThread[] = "http-threads";
16 |
17 | const char Switches::kLogPath[] = "log-path";
18 |
19 | const char Switches::kVerbose[] = "verbose";
20 |
21 | const char Switches::kSilence[] = "silence";
22 |
23 | const char Switches::kConfig[] = "config";
24 |
25 | const char Switches::kWIServer[] = "wi-server";
26 |
27 | const char Switches::kWIPort[] = "wi-port";
28 |
29 | const char Switches::kVNCLogin[] = "vnc-login";
30 |
31 | const char Switches::kUserInputDevice[] = "uinput";
32 |
33 | const char Switches::kWhiteList[] = "white-list";
34 |
35 | const char Switches::kWebServerCfg[] = "webserver-cfg";
36 |
37 | } // namespace webdriver
38 |
--------------------------------------------------------------------------------
/wd_common.gypi:
--------------------------------------------------------------------------------
1 | {
2 | 'variables': {
3 | 'QT5%': '0',
4 | 'WD_CONFIG_QWIDGET_BASE%': '1',
5 | 'WD_CONFIG_WEBKIT%': '1',
6 | 'WD_CONFIG_QUICK%': '1',
7 | 'WD_BUILD_MONGOOSE%': '1',
8 | 'WD_CONFIG_PLAYER%': '1',
9 | 'WD_CONFIG_ONE_KEYRELEASE%': '0',
10 |
11 | 'QT_BIN_PATH%': '/usr/lib/qt4/bin',
12 | 'QT_INC_PATH%': '/usr/include',
13 | 'QT_LIB_PATH%': '/usr/lib',
14 | 'MONGOOSE_INC_PATH%': 'src/third_party/mongoose',
15 |
16 | 'conditions': [
17 |
18 | [ 'OS == "android"', {
19 | 'ANDROID_INC': '
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace webdriver {
14 |
15 | class Response;
16 |
17 | /// A call with HTTP GET will return the title of the tab. See:
18 | /// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/title
19 | class TitleCommand : public ViewCommand {
20 | public:
21 | TitleCommand(const std::vector& path_segments,
22 | const DictionaryValue* const parameters);
23 | virtual ~TitleCommand();
24 |
25 | virtual bool DoesGet() const OVERRIDE;
26 | virtual void ExecuteGet(Response* const response) OVERRIDE;
27 |
28 | private:
29 | DISALLOW_COPY_AND_ASSIGN(TitleCommand);
30 | };
31 |
32 | } // namespace webdriver
33 |
34 | #endif // WEBDRIVER_COMMANDS_TITLE_COMMAND_H_
35 |
--------------------------------------------------------------------------------
/src/base/threading/thread_local_win.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/threading/thread_local.h"
6 |
7 | #include
8 |
9 | #include "base/logging.h"
10 |
11 | namespace base {
12 |
13 | namespace internal {
14 |
15 | // static
16 | void ThreadLocalPlatform::AllocateSlot(SlotType& slot) {
17 | slot = TlsAlloc();
18 | CHECK_NE(slot, TLS_OUT_OF_INDEXES);
19 | }
20 |
21 | // static
22 | void ThreadLocalPlatform::FreeSlot(SlotType& slot) {
23 | if (!TlsFree(slot)) {
24 | NOTREACHED() << "Failed to deallocate tls slot with TlsFree().";
25 | }
26 | }
27 |
28 | // static
29 | void* ThreadLocalPlatform::GetValueFromSlot(SlotType& slot) {
30 | return TlsGetValue(slot);
31 | }
32 |
33 | // static
34 | void ThreadLocalPlatform::SetValueInSlot(SlotType& slot, void* value) {
35 | if (!TlsSetValue(slot, value)) {
36 | LOG(FATAL) << "Failed to TlsSetValue().";
37 | }
38 | }
39 |
40 | } // namespace internal
41 |
42 | } // namespace base
43 |
--------------------------------------------------------------------------------
/src/base/file_util_mac.mm:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/file_util.h"
6 |
7 | #import
8 | #include
9 |
10 | #include "base/basictypes.h"
11 | #include "base/file_path.h"
12 | #include "base/mac/foundation_util.h"
13 | #include "base/string_util.h"
14 | #include "base/threading/thread_restrictions.h"
15 |
16 | namespace file_util {
17 |
18 | bool GetTempDir(FilePath* path) {
19 | NSString* tmp = NSTemporaryDirectory();
20 | if (tmp == nil)
21 | return false;
22 | *path = base::mac::NSStringToFilePath(tmp);
23 | return true;
24 | }
25 |
26 | bool GetShmemTempDir(FilePath* path, bool executable) {
27 | return GetTempDir(path);
28 | }
29 |
30 | bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
31 | base::ThreadRestrictions::AssertIOAllowed();
32 | return (copyfile(from_path.value().c_str(),
33 | to_path.value().c_str(), NULL, COPYFILE_ALL) == 0);
34 | }
35 |
36 | } // namespace
37 |
--------------------------------------------------------------------------------
/inc/base/third_party/dmg_fp/dmg_fp.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef THIRD_PARTY_DMG_FP_H_
6 | #define THIRD_PARTY_DMG_FP_H_
7 |
8 | namespace dmg_fp {
9 |
10 | // Return a nearest machine number to the input decimal
11 | // string (or set errno to ERANGE). With IEEE arithmetic, ties are
12 | // broken by the IEEE round-even rule. Otherwise ties are broken by
13 | // biased rounding (add half and chop).
14 | double strtod(const char* s00, char** se);
15 |
16 | // Convert double to ASCII string. For meaning of parameters
17 | // see dtoa.cc file.
18 | char* dtoa(double d, int mode, int ndigits,
19 | int* decpt, int* sign, char** rve);
20 |
21 | // Must be used to free values returned by dtoa.
22 | void freedtoa(char* s);
23 |
24 | // Store the closest decimal approximation to x in b (null terminated).
25 | // Returns a pointer to b. It is sufficient for |b| to be 32 characters.
26 | char* g_fmt(char* b, double x);
27 |
28 | } // namespace dmg_fp
29 |
30 | #endif // THIRD_PARTY_DMG_FP_H_
31 |
--------------------------------------------------------------------------------
/src/base/memory/singleton.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/memory/singleton.h"
6 | #include "base/threading/platform_thread.h"
7 |
8 | namespace base {
9 | namespace internal {
10 |
11 | subtle::AtomicWord WaitForInstance(subtle::AtomicWord* instance) {
12 | // Handle the race. Another thread beat us and either:
13 | // - Has the object in BeingCreated state
14 | // - Already has the object created...
15 | // We know value != NULL. It could be kBeingCreatedMarker, or a valid ptr.
16 | // Unless your constructor can be very time consuming, it is very unlikely
17 | // to hit this race. When it does, we just spin and yield the thread until
18 | // the object has been created.
19 | subtle::AtomicWord value;
20 | while (true) {
21 | value = subtle::NoBarrier_Load(instance);
22 | if (value != kBeingCreatedMarker)
23 | break;
24 | PlatformThread::YieldCurrentThread();
25 | }
26 | return value;
27 | }
28 |
29 | } // namespace internal
30 | } // namespace base
31 |
32 |
--------------------------------------------------------------------------------
/inc/commands/source_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_SOURCE_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_SOURCE_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | /// Gets the page source. See:
22 | /// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/source
23 | class SourceCommand : public ViewCommand {
24 | public:
25 | SourceCommand(const std::vector& path_segments,
26 | const base::DictionaryValue* const parameters);
27 | virtual ~SourceCommand();
28 |
29 | virtual bool DoesGet() const OVERRIDE;
30 | virtual void ExecuteGet(Response* const response) OVERRIDE;
31 |
32 | private:
33 | DISALLOW_COPY_AND_ASSIGN(SourceCommand);
34 | };
35 |
36 | } // namespace webdriver
37 |
38 | #endif // WEBDRIVER_COMMANDS_SOURCE_COMMAND_H_
39 |
--------------------------------------------------------------------------------
/src/base/mac/mac_logging.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/mac/mac_logging.h"
6 |
7 | #include
8 |
9 | #if !defined(OS_IOS)
10 | #include
11 | #endif
12 |
13 | namespace logging {
14 |
15 | OSStatusLogMessage::OSStatusLogMessage(const char* file_path,
16 | int line,
17 | LogSeverity severity,
18 | OSStatus status)
19 | : LogMessage(file_path, line, severity),
20 | status_(status) {
21 | }
22 |
23 | OSStatusLogMessage::~OSStatusLogMessage() {
24 | #if defined(OS_IOS)
25 | // TODO(ios): Consider using NSError with NSOSStatusErrorDomain to try to
26 | // get a description of the failure.
27 | stream() << ": " << status_;
28 | #else
29 | stream() << ": "
30 | << GetMacOSStatusErrorString(status_)
31 | << " ("
32 | << status_
33 | << ")";
34 | #endif
35 | }
36 |
37 | } // namespace logging
38 |
--------------------------------------------------------------------------------
/inc/extension_qt/widget_view_handle.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_QT_WIDGET_VIEW_H_
6 | #define WEBDRIVER_QT_WIDGET_VIEW_H_
7 |
8 | #include
9 |
10 | #include "webdriver_view_id.h"
11 |
12 | #include
13 |
14 | #include
15 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
16 | #include
17 | #include
18 | #else
19 | #include
20 | #include
21 | #endif
22 |
23 | namespace webdriver {
24 |
25 | class QViewHandle : public ViewHandle {
26 | public:
27 | QViewHandle();
28 | QViewHandle(QWidget* view);
29 |
30 | virtual bool is_valid() const { return !view_.isNull(); };
31 | virtual bool equals(const ViewHandle* other) const;
32 | QWidget* get() { return view_.data(); };
33 |
34 | protected:
35 | QPointer view_;
36 | //private:
37 | virtual ~QViewHandle() {};
38 | };
39 |
40 | } // namespace webdriver
41 |
42 | #endif // WEBDRIVER_QT_WIDGET_VIEW_H_
43 |
--------------------------------------------------------------------------------
/src/Test/RestyledLabel.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef RESTYLEDLABEL_H
21 | #define RESTYLEDLABEL_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class RestyledLabel : public QLabel
26 | {
27 | Q_OBJECT
28 | public:
29 | RestyledLabel(const QString &text, QWidget *parent);
30 | };
31 |
32 | #endif // RESTYLEDLABEL_H
33 |
--------------------------------------------------------------------------------
/src/base/profiler/alternate_timer.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/profiler/alternate_timer.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace {
10 |
11 | tracked_objects::NowFunction* g_time_function = NULL;
12 | tracked_objects::TimeSourceType g_time_source_type =
13 | tracked_objects::TIME_SOURCE_TYPE_WALL_TIME;
14 |
15 | } // anonymous namespace
16 |
17 | namespace tracked_objects {
18 |
19 | const char kAlternateProfilerTime[] = "CHROME_PROFILER_TIME";
20 |
21 | // Set an alternate timer function to replace the OS time function when
22 | // profiling.
23 | void SetAlternateTimeSource(NowFunction* now_function, TimeSourceType type) {
24 | DCHECK_EQ(reinterpret_cast(NULL), g_time_function);
25 | g_time_function = now_function;
26 | g_time_source_type = type;
27 | }
28 |
29 | NowFunction* GetAlternateTimeSource() {
30 | return g_time_function;
31 | }
32 |
33 | TimeSourceType GetTimeSourceType() {
34 | return g_time_source_type;
35 | }
36 |
37 | } // namespace tracked_objects
38 |
--------------------------------------------------------------------------------
/src/base/callback_internal.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/callback_internal.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 | namespace internal {
11 |
12 | bool CallbackBase::is_null() const {
13 | return bind_state_.get() == NULL;
14 | }
15 |
16 | void CallbackBase::Reset() {
17 | polymorphic_invoke_ = NULL;
18 | // NULL the bind_state_ last, since it may be holding the last ref to whatever
19 | // object owns us, and we may be deleted after that.
20 | bind_state_ = NULL;
21 | }
22 |
23 | bool CallbackBase::Equals(const CallbackBase& other) const {
24 | return bind_state_.get() == other.bind_state_.get() &&
25 | polymorphic_invoke_ == other.polymorphic_invoke_;
26 | }
27 |
28 | CallbackBase::CallbackBase(BindStateBase* bind_state)
29 | : bind_state_(bind_state),
30 | polymorphic_invoke_(NULL) {
31 | DCHECK(!bind_state_ || bind_state_->HasOneRef());
32 | }
33 |
34 | CallbackBase::~CallbackBase() {
35 | }
36 |
37 | } // namespace internal
38 | } // namespace base
39 |
--------------------------------------------------------------------------------
/inc/commands/appcache_status_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_APPCACHE_STATUS_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_APPCACHE_STATUS_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | class AppCacheStatusCommand : public ViewCommand {
22 | public:
23 | AppCacheStatusCommand(const std::vector& path_segments,
24 | const base::DictionaryValue* const parameters);
25 | virtual ~AppCacheStatusCommand();
26 |
27 | virtual bool DoesGet() const OVERRIDE;
28 |
29 | // A call with HTTP GET will return the status of the appcahe.
30 | virtual void ExecuteGet(Response* const response) OVERRIDE;
31 |
32 | private:
33 | DISALLOW_COPY_AND_ASSIGN(AppCacheStatusCommand);
34 | };
35 |
36 | } // namespace webdriver
37 |
38 | #endif // WEBDRIVER_COMMANDS_APPCACHE_STATUS_COMMAND_H_
39 |
--------------------------------------------------------------------------------
/wd_qt_tools.gypi:
--------------------------------------------------------------------------------
1 | #
2 | # include this file for QT preprocessing - moc, ui, etc...
3 | #
4 | {
5 | 'rules': [
6 | {
7 | 'rule_name': 'generate_ui',
8 | 'extension': 'ui',
9 | 'outputs': [ '<(RULE_INPUT_DIRNAME)/ui_<(RULE_INPUT_ROOT).h' ],
10 | 'action': [ 'python', 'do_if_modified.py', '<(QT_BIN_PATH)/uic', '<(RULE_INPUT_PATH)', '<(INTERMEDIATE_DIR)/ui_<(RULE_INPUT_ROOT).h' ],
11 | 'message': 'Generating ui_<(RULE_INPUT_ROOT).h',
12 | },
13 | {
14 | 'rule_name': 'generate_moc',
15 | 'extension': 'h',
16 | 'outputs': [ '<(RULE_INPUT_DIRNAME)/moc_<(RULE_INPUT_ROOT).cc' ],
17 | 'action': [ 'python', 'do_if_modified.py','<(QT_BIN_PATH)/moc', '<(RULE_INPUT_PATH)', '<(INTERMEDIATE_DIR)/moc_<(RULE_INPUT_ROOT).cc' ],
18 | 'message': 'Generating <(RULE_INPUT_ROOT).cc.',
19 | },
20 | {
21 | 'rule_name': 'generate_rcc',
22 | 'extension': 'qrc',
23 | 'outputs': [ '<(RULE_INPUT_DIRNAME)/rcc_<(RULE_INPUT_ROOT).cc' ],
24 | 'action': [ '<(QT_BIN_PATH)/rcc', '<(RULE_INPUT_PATH)', '-name', '<(RULE_INPUT_ROOT)', '-o', '<(INTERMEDIATE_DIR)/rcc_<(RULE_INPUT_ROOT).cc' ],
25 | 'message': 'Generating <(RULE_INPUT_ROOT).cc.',
26 | } ],
27 | }
28 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_user_dirs/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2007 Red Hat, inc
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation files
5 | (the "Software"), to deal in the Software without restriction,
6 | including without limitation the rights to use, copy, modify, merge,
7 | publish, distribute, sublicense, and/or sell copies of the Software,
8 | and to permit persons to whom the Software is furnished to do so,
9 | subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/generate_android_json.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | filename = os.environ['ANDROID_JSON_CONFIG']
4 |
5 | jsonfile = open (filename, 'w')
6 | jsonfile.write("{\n")
7 | jsonfile.write("\"qt\": \"" +os.environ['QT_ROOT'] +"\",\n")
8 | jsonfile.write("\"sdk\": \"" +os.environ['ANDROID_SDK_ROOT'] +"\",\n")
9 | jsonfile.write("\"ndk\": \"" +os.environ['ANDROID_NDK_ROOT'] +"\",\n")
10 | jsonfile.write("\"toolchain-prefix\": \"" +os.environ['ANDROID_TOOLCHAIN_PREFIX'] +"\",\n")
11 | jsonfile.write("\"tool-prefix\": \"" +os.environ['ANDROID_TOOL_PREFIX'] +"\",\n")
12 | jsonfile.write("\"toolchain-version\": \"" +os.environ['ANDROID_TOOLCHAIN_VERSION'] +"\",\n")
13 | jsonfile.write("\"ndk-host\": \"" +os.environ['ANDROID_NDK_HOST'] +"\",\n")
14 | jsonfile.write("\"target-architecture\": \"" +os.environ['ANDROID_LIB_ARCH'] +"\",\n")
15 | jsonfile.write("\"application-binary\": \"" +os.environ['BINARY_PATH'] +"\",\n")
16 | jsonfile.write("\"android-package\": \"" +os.environ['ANDROID_PACKAGE'] +"\",\n")
17 | # jsonfile.write("\"android-package-source-directory\": \"" +os.environ['ANDROID_JAVA'] +"\",\n")
18 | jsonfile.write("\"android-app-name\": \"" +os.environ['ANDROID_APP_NAME'] +"\"\n")
19 | jsonfile.write("}")
20 | jsonfile.close()
21 |
22 |
--------------------------------------------------------------------------------
/src/webdriver/wdversion.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | namespace webdriver {
21 | extern const char kProductName[] = "WebDriver-cisco-cmt";
22 | extern const char kVersionNumber[] = "0.2.0";
23 | extern const char kBuildTime[] = __TIME__;
24 | extern const char kBuildDate[] = __DATE__;
25 | extern const char kLastChanges[] = "WebDriver-Qt4.8.2-cisco-cmt-0.1-319-ge98a6fca9c-dirty";
26 | }
--------------------------------------------------------------------------------
/src/webdriver/webdriver_version.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WDVERSION_H
21 | #define WDVERSION_H
22 |
23 | namespace webdriver
24 | {
25 |
26 | extern const char kProductName[];
27 | extern const char kVersionNumber[];
28 | extern const char kBuildTime[];
29 | extern const char kBuildDate[];
30 | extern const char kLastChanges[];
31 |
32 | }
33 |
34 | #endif // WDVERSION_H
35 |
--------------------------------------------------------------------------------
/inc/commands/screenshot_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_SCREENSHOT_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_SCREENSHOT_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | /// Take a screenshot of the current page. See:
22 | /// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/screenshot
23 | class ScreenshotCommand : public ViewCommand {
24 | public:
25 | ScreenshotCommand(const std::vector& path_segments,
26 | const base::DictionaryValue* const parameters);
27 | virtual ~ScreenshotCommand();
28 |
29 | virtual bool DoesGet() const OVERRIDE;
30 | virtual void ExecuteGet(Response* const response) OVERRIDE;
31 |
32 | private:
33 | DISALLOW_COPY_AND_ASSIGN(ScreenshotCommand);
34 | };
35 |
36 | } // namespace webdriver
37 |
38 | #endif // WEBDRIVER_COMMANDS_SCREENSHOT_COMMAND_H_
39 |
--------------------------------------------------------------------------------
/inc/base/thread_task_runner_handle.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_THREAD_TASK_RUNNER_HANDLE_H_
6 | #define BASE_THREAD_TASK_RUNNER_HANDLE_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/memory/ref_counted.h"
10 |
11 | namespace base {
12 |
13 | class SingleThreadTaskRunner;
14 |
15 | // ThreadTaskRunnerHandle stores a reference to the main task runner
16 | // for each thread. Not more than one of these objects can be created
17 | // per thread. After an instance of this object is created the Get()
18 | // function will return the |task_runner| specified in the
19 | // constructor.
20 | class BASE_EXPORT ThreadTaskRunnerHandle {
21 | public:
22 | // Gets the SingleThreadTaskRunner for the current thread.
23 | static scoped_refptr Get();
24 |
25 | ThreadTaskRunnerHandle(
26 | const scoped_refptr& task_runner);
27 | ~ThreadTaskRunnerHandle();
28 |
29 | private:
30 | scoped_refptr task_runner_;
31 | };
32 |
33 | } // namespace base
34 |
35 | #endif // BASE_THREAD_TASK_RUNNER_HANDLE_H_
36 |
--------------------------------------------------------------------------------
/src/base/message_pump_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MESSAGE_PUMP_ANDROID_H_
6 | #define BASE_MESSAGE_PUMP_ANDROID_H_
7 |
8 | #include
9 |
10 | #include "base/compiler_specific.h"
11 | #include "base/message_pump.h"
12 | #include "base/time.h"
13 |
14 | namespace base {
15 | class RunLoop;
16 |
17 | // This class implements a MessagePump needed for TYPE_UI MessageLoops on
18 | // OS_ANDROID platform.
19 | class MessagePumpForUI : public MessagePump {
20 | public:
21 | MessagePumpForUI();
22 |
23 | virtual void Run(Delegate* delegate) OVERRIDE;
24 | virtual void Quit() OVERRIDE;
25 | virtual void ScheduleWork() OVERRIDE;
26 | virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
27 |
28 | virtual void Start(Delegate* delegate);
29 |
30 | static bool RegisterBindings(JNIEnv* env);
31 |
32 | protected:
33 | virtual ~MessagePumpForUI();
34 |
35 | private:
36 | base::RunLoop* run_loop_;
37 |
38 | DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI);
39 | };
40 |
41 | } // namespace base
42 |
43 | #endif // BASE_MESSAGE_PUMP_ANDROID_H_
44 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | # Dockerfile to build a Webdriver for QT5
2 | # Documentation: https://github.com/cisco-open-source/qtwebdriver/wiki/Docker
3 |
4 | FROM rabits/qt:5.4-desktop
5 | MAINTAINER Hugues Ekra
6 | LABEL vendor="Cisco Systems"
7 | LABEL license="LGPLv2.1"
8 | LABEL version="1.3.3"
9 |
10 | #Env
11 | ENV QTDIR $QT_DESKTOP
12 | ENV QT_PLUGIN_PATH $QTDIR/plugins
13 | ENV QT_QPA_PLATFORM offscreen
14 | ENV QT_QPA_FONTDIR $QT_PATH/5.4/Src/qtbase/lib/fonts
15 | ENV LD_LIBRARY_PATH $QTDIR/lib:$LD_LIBRARY_PATH
16 | ENV PATH $PATH:$HOME/qtwebdriver/out/dist/desktop/release/bin
17 |
18 | # Build
19 | RUN sudo apt-get update && sudo apt-get install -y \
20 | zip wget g++ gyp xvfb xorg libicu-dev libegl1-mesa-dev libgles2-mesa-dev \
21 | libxslt1-dev libgstreamer-plugins-base0.10-dev dbus libdbus-1-dev libxml2-dev dbus-x11\
22 | && wget http://github.com/cisco-open-source/qtwebdriver/archive/WD_1.X_dev.zip \
23 | && unzip WD_1.X_dev.zip \
24 | && rm -f WD_1.X_dev.zip \
25 | && mv qtwebdriver-WD_1.X_dev qtwebdriver \
26 | && cd qtwebdriver \
27 | && cp ./qt5_sample_config.gypi ./wd.gypi \
28 | && sed -i "s@\/home\/hekra01\/qt@$QTDIR@g" wd.gypi \
29 | && ./build.sh
30 |
31 | # Run
32 | ENTRYPOINT ["WebDriver"]
33 |
--------------------------------------------------------------------------------
/src/Test/ElementSelectingTest.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "ElementSelectingTest.h"
21 | #include "ui_ElementSelectingTest.h"
22 |
23 | ElementSelectingTestWidget::ElementSelectingTestWidget(QWidget *parent) :
24 | QMainWindow(parent),
25 | ui(new Ui::ElementSelectingTestWidget)
26 | {
27 | ui->setupUi(this);
28 | }
29 |
30 | ElementSelectingTestWidget::~ElementSelectingTestWidget()
31 | {
32 | delete ui;
33 | }
34 |
--------------------------------------------------------------------------------
/src/Test/MenuTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef MENU_TEST_H_
21 | #define MENU_TEST_H_
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class MenuTestWidget : public QMainWindow
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | MenuTestWidget(QWidget *parent = 0);
31 |
32 | protected slots:
33 |
34 | void updateStatus(QString text);
35 | private:
36 | QLabel *plblStatus;
37 | };
38 |
39 | #endif // MENU_TEST_H_
40 |
--------------------------------------------------------------------------------
/src/base/android/java/src/org/chromium/base/CalledByNativeUnchecked.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @CalledByNativeUnchecked is used to generate JNI bindings that do not check for exceptions.
14 | * It only makes sense to use this annotation on methods that declare a throws... spec.
15 | * However, note that the exception received native side maybe an 'unchecked' (RuntimeExpception)
16 | * such as NullPointerException, so the native code should differentiate these cases.
17 | * Usage of this should be very rare; where possible handle exceptions in the Java side and use a
18 | * return value to indicate success / failure.
19 | */
20 | @Target(ElementType.METHOD)
21 | @Retention(RetentionPolicy.RUNTIME)
22 | public @interface CalledByNativeUnchecked {
23 | /*
24 | * If present, tells which inner class the method belongs to.
25 | */
26 | public String value() default "";
27 | }
28 |
--------------------------------------------------------------------------------
/src/base/debug/debugger.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/debug/debugger.h"
6 | #include "base/logging.h"
7 | #include "base/threading/platform_thread.h"
8 |
9 | namespace base {
10 | namespace debug {
11 |
12 | static bool is_debug_ui_suppressed = false;
13 |
14 | bool WaitForDebugger(int wait_seconds, bool silent) {
15 | #if defined(OS_ANDROID)
16 | // The pid from which we know which process to attach to are not output by
17 | // android ddms, so we have to print it out explicitly.
18 | DLOG(INFO) << "DebugUtil::WaitForDebugger(pid=" << static_cast(getpid())
19 | << ")";
20 | #endif
21 | for (int i = 0; i < wait_seconds * 10; ++i) {
22 | if (BeingDebugged()) {
23 | if (!silent)
24 | BreakDebugger();
25 | return true;
26 | }
27 | PlatformThread::Sleep(TimeDelta::FromMilliseconds(100));
28 | }
29 | return false;
30 | }
31 |
32 | void SetSuppressDebugUI(bool suppress) {
33 | is_debug_ui_suppressed = suppress;
34 | }
35 |
36 | bool IsDebugUISuppressed() {
37 | return is_debug_ui_suppressed;
38 | }
39 |
40 | } // namespace debug
41 | } // namespace base
42 |
--------------------------------------------------------------------------------
/inc/base/message_pump_default.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MESSAGE_PUMP_DEFAULT_H_
6 | #define BASE_MESSAGE_PUMP_DEFAULT_H_
7 |
8 | #include "base/message_pump.h"
9 | #include "base/time.h"
10 | #include "base/synchronization/waitable_event.h"
11 |
12 | namespace base {
13 |
14 | class MessagePumpDefault : public MessagePump {
15 | public:
16 | MessagePumpDefault();
17 |
18 | // MessagePump methods:
19 | virtual void Run(Delegate* delegate) OVERRIDE;
20 | virtual void Quit() OVERRIDE;
21 | virtual void ScheduleWork() OVERRIDE;
22 | virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
23 |
24 | protected:
25 | virtual ~MessagePumpDefault() {}
26 |
27 | private:
28 | // This flag is set to false when Run should return.
29 | bool keep_running_;
30 |
31 | // Used to sleep until there is more work to do.
32 | WaitableEvent event_;
33 |
34 | // The time at which we should call DoDelayedWork.
35 | TimeTicks delayed_work_time_;
36 |
37 | DISALLOW_COPY_AND_ASSIGN(MessagePumpDefault);
38 | };
39 |
40 | } // namespace base
41 |
42 | #endif // BASE_MESSAGE_PUMP_DEFAULT_H_
43 |
--------------------------------------------------------------------------------
/src/base/android/base_jni_registrar.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/android/base_jni_registrar.h"
6 |
7 | #include "base/basictypes.h"
8 | #include "base/message_pump_android.h"
9 | #include "base/android/build_info.h"
10 | #include "base/android/jni_android.h"
11 | #include "base/android/jni_registrar.h"
12 | #include "base/android/locale_utils.h"
13 | #include "base/android/path_service_android.h"
14 | #include "base/android/path_utils.h"
15 |
16 | namespace base {
17 | namespace android {
18 |
19 | static RegistrationMethod kBaseRegisteredMethods[] = {
20 | { "BuildInfo", base::android::BuildInfo::RegisterBindings },
21 | { "LocaleUtils", base::android::RegisterLocaleUtils },
22 | { "PathService", base::android::RegisterPathService },
23 | { "PathUtils", base::android::RegisterPathUtils },
24 | { "SystemMessageHandler", base::MessagePumpForUI::RegisterBindings },
25 | };
26 |
27 | bool RegisterJni(JNIEnv* env) {
28 | return RegisterNativeMethods(env, kBaseRegisteredMethods,
29 | arraysize(kBaseRegisteredMethods));
30 | }
31 |
32 | } // namespace android
33 | } // namespace base
34 |
--------------------------------------------------------------------------------
/src/base/mac/scoped_mach_port.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/mac/scoped_mach_port.h"
6 |
7 | #include "base/mac/mach_logging.h"
8 |
9 | namespace base {
10 | namespace mac {
11 | namespace internal {
12 |
13 | // static
14 | void SendRightTraits::Free(mach_port_t port) {
15 | kern_return_t kr = mach_port_deallocate(mach_task_self(), port);
16 | MACH_LOG_IF(ERROR, kr != KERN_SUCCESS, kr)
17 | << "ScopedMachSendRight mach_port_deallocate";
18 | }
19 |
20 | // static
21 | void ReceiveRightTraits::Free(mach_port_t port) {
22 | kern_return_t kr =
23 | mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
24 | MACH_LOG_IF(ERROR, kr != KERN_SUCCESS, kr)
25 | << "ScopedMachReceiveRight mach_port_mod_refs";
26 | }
27 |
28 | // static
29 | void PortSetTraits::Free(mach_port_t port) {
30 | kern_return_t kr =
31 | mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_PORT_SET, -1);
32 | MACH_LOG_IF(ERROR, kr != KERN_SUCCESS, kr)
33 | << "ScopedMachPortSet mach_port_mod_refs";
34 | }
35 |
36 | } // namespace internal
37 | } // namespace mac
38 | } // namespace base
39 |
--------------------------------------------------------------------------------
/inc/extension_qt/event_dispatcher.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef EVENTDISPATCHER_H
21 | #define EVENTDISPATCHER_H
22 |
23 | #include
24 |
25 | /// Abstract class which provides interface for event dispatchers
26 | class EventDispatcher
27 | {
28 | public:
29 |
30 | /// Abstract method, should be implemented in descendants
31 | virtual bool dispatch(QEvent *event, bool consumed)=0;
32 | };
33 |
34 | #endif // EVENTDISPATCHER_H
35 |
--------------------------------------------------------------------------------
/src/Test/FindingTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef FINDINGTEST_H
21 | #define FINDINGTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class FindingTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | FindingTestWidget();
30 | virtual ~FindingTestWidget();
31 |
32 | private:
33 |
34 | QTextEdit *textEdit;
35 | QScrollArea *scrollArea;
36 | QLabel *hiddenLabel;
37 | };
38 |
39 | #endif // FINDINGTEST_H
40 |
--------------------------------------------------------------------------------
/src/Test/BasicMouseInterfaceTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef BASICMOUSEINTERFACETEST_H
21 | #define BASICMOUSEINTERFACETEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class BasicMouseInterfaceTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | explicit BasicMouseInterfaceTestWidget(QWidget *parent = 0);
30 |
31 | signals:
32 |
33 | public slots:
34 |
35 | };
36 |
37 | #endif // BASICMOUSEINTERFACETEST_H
38 |
--------------------------------------------------------------------------------
/inc/base/message_pump_dispatcher.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MESSAGE_PUMP_DISPATCHER_H
6 | #define BASE_MESSAGE_PUMP_DISPATCHER_H
7 |
8 | #include "base/base_export.h"
9 | #include "base/event_types.h"
10 |
11 | namespace base {
12 |
13 | // Dispatcher is used during a nested invocation of Run to dispatch events when
14 | // |RunLoop(dispatcher).Run()| is used. If |RunLoop().Run()| is invoked,
15 | // MessageLoop does not dispatch events (or invoke TranslateMessage), rather
16 | // every message is passed to Dispatcher's Dispatch method for dispatch. It is
17 | // up to the Dispatcher whether or not to dispatch the event.
18 | //
19 | // The nested loop is exited by either posting a quit, or returning false
20 | // from Dispatch.
21 | class BASE_EXPORT MessagePumpDispatcher {
22 | public:
23 | virtual ~MessagePumpDispatcher() {}
24 |
25 | // Dispatches the event. If true is returned processing continues as
26 | // normal. If false is returned, the nested loop exits immediately.
27 | virtual bool Dispatch(const NativeEvent& event) = 0;
28 | };
29 |
30 | } // namespace base
31 |
32 | #endif // BASE_MESSAGE_PUMP_DISPATCHER_H
33 |
--------------------------------------------------------------------------------
/src/base/synchronization/lock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This file is used for debugging assertion support. The Lock class
6 | // is functionally a wrapper around the LockImpl class, so the only
7 | // real intelligence in the class is in the debugging logic.
8 |
9 | #if !defined(NDEBUG)
10 |
11 | #include "base/synchronization/lock.h"
12 | #include "base/logging.h"
13 |
14 | namespace base {
15 |
16 | Lock::Lock() : lock_() {
17 | owned_by_thread_ = false;
18 | owning_thread_id_ = static_cast(0);
19 | }
20 |
21 | void Lock::AssertAcquired() const {
22 | DCHECK(owned_by_thread_);
23 | DCHECK_EQ(owning_thread_id_, PlatformThread::CurrentId());
24 | }
25 |
26 | void Lock::CheckHeldAndUnmark() {
27 | DCHECK(owned_by_thread_);
28 | DCHECK_EQ(owning_thread_id_, PlatformThread::CurrentId());
29 | owned_by_thread_ = false;
30 | owning_thread_id_ = static_cast(0);
31 | }
32 |
33 | void Lock::CheckUnheldAndMark() {
34 | DCHECK(!owned_by_thread_);
35 | owned_by_thread_ = true;
36 | owning_thread_id_ = PlatformThread::CurrentId();
37 | }
38 |
39 | } // namespace base
40 |
41 | #endif // NDEBUG
42 |
--------------------------------------------------------------------------------
/inc/base/tracking_info.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This is a simple struct with tracking information that is stored
6 | // with a PendingTask (when message_loop is handling the task).
7 | // Only the information that is shared with the profiler in tracked_objects
8 | // are included in this structure.
9 |
10 |
11 | #ifndef BASE_TRACKING_INFO_H_
12 | #define BASE_TRACKING_INFO_H_
13 |
14 | #include "base/time.h"
15 |
16 | namespace tracked_objects {
17 | class Location;
18 | class Births;
19 | }
20 |
21 | namespace base {
22 |
23 | // This structure is copied around by value.
24 | struct BASE_EXPORT TrackingInfo {
25 | TrackingInfo();
26 | TrackingInfo(const tracked_objects::Location& posted_from,
27 | base::TimeTicks delayed_run_time);
28 | ~TrackingInfo();
29 |
30 | // Record of location and thread that the task came from.
31 | tracked_objects::Births* birth_tally;
32 |
33 | // Time when the related task was posted.
34 | base::TimeTicks time_posted;
35 |
36 | // The time when the task should be run.
37 | base::TimeTicks delayed_run_time;
38 | };
39 |
40 | } // namespace base
41 |
42 | #endif // BASE_TRACKING_INFO_H_
43 |
--------------------------------------------------------------------------------
/inc/commands/browser_connection_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BROWSER_CONNECTION_COMMAND_H
6 | #define BROWSER_CONNECTION_COMMAND_H
7 |
8 | #include "commands/webdriver_command.h"
9 |
10 | namespace webdriver {
11 | class Response;
12 |
13 | /// Handles browser connection commands what set online mode.
14 | /// Limitation: setOnline() can change connection state only for currently opened windows.
15 | /// If new view will be open now, it sets online by default (while doesn't receive a command explicitly).
16 | class BrowserConnectionCommand : public WebDriverCommand {
17 | public:
18 | BrowserConnectionCommand(const std::vector& path_segments,
19 | const base::DictionaryValue* const parameters);
20 | ~BrowserConnectionCommand();
21 |
22 | virtual bool DoesPost() const OVERRIDE;
23 | virtual void ExecutePost(Response* const response) OVERRIDE;
24 | virtual bool DoesGet() const OVERRIDE;
25 | virtual void ExecuteGet(Response* const response) OVERRIDE;
26 |
27 | DISALLOW_COPY_AND_ASSIGN(BrowserConnectionCommand);
28 | };
29 |
30 | }
31 | #endif // BROWSER_CONNECTION_COMMAND_H
32 |
--------------------------------------------------------------------------------
/inc/commands/html5_location_commands.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_HTML5_LOCATION_COMMANDS_H_
6 | #define WEBDRIVER_COMMANDS_HTML5_LOCATION_COMMANDS_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | class HTML5LocationCommand : public ViewCommand {
22 | public:
23 | HTML5LocationCommand(const std::vector& path_segments,
24 | const base::DictionaryValue* const parameters);
25 | virtual ~HTML5LocationCommand();
26 |
27 | virtual bool DoesGet() const OVERRIDE;
28 | virtual bool DoesPost() const OVERRIDE;
29 |
30 | /// Returns the current geolocation.
31 | virtual void ExecuteGet(Response* const response) OVERRIDE;
32 |
33 | /// Sets the current geolocation.
34 | virtual void ExecutePost(Response* const response) OVERRIDE;
35 |
36 | private:
37 | DISALLOW_COPY_AND_ASSIGN(HTML5LocationCommand);
38 | };
39 |
40 | } // namespace webdriver
41 |
42 | #endif // WEBDRIVER_COMMANDS_HTML5_LOCATION_COMMANDS_H_
43 |
--------------------------------------------------------------------------------
/src/base/android/jni_string.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_JNI_STRING_H_
6 | #define BASE_ANDROID_JNI_STRING_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "base/android/scoped_java_ref.h"
12 | #include "base/string_piece.h"
13 |
14 | namespace base {
15 | namespace android {
16 |
17 | // Convert a Java string to UTF8. Returns a std string.
18 | std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str);
19 | std::string ConvertJavaStringToUTF8(const JavaRef& str);
20 |
21 | // Convert a std string to Java string.
22 | ScopedJavaLocalRef ConvertUTF8ToJavaString(
23 | JNIEnv* env,
24 | const base::StringPiece& str);
25 |
26 | // Convert a Java string to UTF16. Returns a string16.
27 | string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str);
28 | string16 ConvertJavaStringToUTF16(const JavaRef& str);
29 |
30 | // Convert a string16 to a Java string.
31 | ScopedJavaLocalRef ConvertUTF16ToJavaString(
32 | JNIEnv* env,
33 | const base::StringPiece16& str);
34 |
35 | } // namespace android
36 | } // namespace base
37 |
38 | #endif // BASE_ANDROID_JNI_STRING_H_
39 |
--------------------------------------------------------------------------------
/src/net/base/net_export.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef NET_BASE_NET_EXPORT_H_
6 | #define NET_BASE_NET_EXPORT_H_
7 |
8 | // Defines NET_EXPORT so that functionality implemented by the net module can
9 | // be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to
10 | // access features not intended to be used directly by real consumers.
11 |
12 | #if defined(COMPONENT_BUILD)
13 | #if defined(WIN32)
14 |
15 | #if defined(NET_IMPLEMENTATION)
16 | #define NET_EXPORT __declspec(dllexport)
17 | #define NET_EXPORT_PRIVATE __declspec(dllexport)
18 | #else
19 | #define NET_EXPORT __declspec(dllimport)
20 | #define NET_EXPORT_PRIVATE __declspec(dllimport)
21 | #endif // defined(NET_IMPLEMENTATION)
22 |
23 | #else // defined(WIN32)
24 | #if defined(NET_IMPLEMENTATION)
25 | #define NET_EXPORT __attribute__((visibility("default")))
26 | #define NET_EXPORT_PRIVATE __attribute__((visibility("default")))
27 | #else
28 | #define NET_EXPORT
29 | #define NET_EXPORT_PRIVATE
30 | #endif
31 | #endif
32 |
33 | #else /// defined(COMPONENT_BUILD)
34 | #define NET_EXPORT
35 | #define NET_EXPORT_PRIVATE
36 | #endif
37 |
38 | #endif // NET_BASE_NET_EXPORT_H_
39 |
--------------------------------------------------------------------------------
/inc/base/auto_reset.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_AUTO_RESET_H_
6 | #define BASE_AUTO_RESET_H_
7 |
8 | #include "base/basictypes.h"
9 |
10 | // AutoReset<> is useful for setting a variable to a new value only within a
11 | // particular scope. An AutoReset<> object resets a variable to its original
12 | // value upon destruction, making it an alternative to writing "var = false;"
13 | // or "var = old_val;" at all of a block's exit points.
14 | //
15 | // This should be obvious, but note that an AutoReset<> instance should have a
16 | // shorter lifetime than its scoped_variable, to prevent invalid memory writes
17 | // when the AutoReset<> object is destroyed.
18 |
19 | template
20 | class AutoReset {
21 | public:
22 | AutoReset(T* scoped_variable, T new_value)
23 | : scoped_variable_(scoped_variable),
24 | original_value_(*scoped_variable) {
25 | *scoped_variable_ = new_value;
26 | }
27 |
28 | ~AutoReset() { *scoped_variable_ = original_value_; }
29 |
30 | private:
31 | T* scoped_variable_;
32 | T original_value_;
33 |
34 | DISALLOW_COPY_AND_ASSIGN(AutoReset);
35 | };
36 |
37 | #endif // BASE_AUTO_RESET_H_
38 |
--------------------------------------------------------------------------------
/src/webdriver/commands/title_command.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "commands/title_command.h"
6 |
7 | #include
8 |
9 | #include "base/bind.h"
10 |
11 | #include "commands/response.h"
12 | #include "webdriver_error.h"
13 | #include "webdriver_session.h"
14 | #include "webdriver_view_executor.h"
15 |
16 | namespace webdriver {
17 |
18 | TitleCommand::TitleCommand(const std::vector& path_segments,
19 | const DictionaryValue* const parameters)
20 | : ViewCommand(path_segments, parameters) {}
21 |
22 | TitleCommand::~TitleCommand() {}
23 |
24 | bool TitleCommand::DoesGet() const {
25 | return true;
26 | }
27 |
28 | void TitleCommand::ExecuteGet(Response* const response) {
29 | std::string title;
30 | Error* error = NULL;
31 |
32 | session_->RunSessionTask(base::Bind(
33 | &ViewCmdExecutor::GetTitle,
34 | base::Unretained(executor_.get()),
35 | &title,
36 | &error));
37 |
38 | if (error) {
39 | response->SetError(error);
40 | return;
41 | }
42 | response->SetValue(new StringValue(title));
43 | }
44 |
45 | } // namespace webdriver
46 |
--------------------------------------------------------------------------------
/src/base/threading/thread_local_storage_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/threading/thread_local_storage.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 |
11 | ThreadLocalStorage::Slot::Slot(TLSDestructorFunc destructor) {
12 | initialized_ = false;
13 | key_ = 0;
14 | Initialize(destructor);
15 | }
16 |
17 | bool ThreadLocalStorage::StaticSlot::Initialize(TLSDestructorFunc destructor) {
18 | DCHECK(!initialized_);
19 | int error = pthread_key_create(&key_, destructor);
20 | if (error) {
21 | NOTREACHED();
22 | return false;
23 | }
24 |
25 | initialized_ = true;
26 | return true;
27 | }
28 |
29 | void ThreadLocalStorage::StaticSlot::Free() {
30 | DCHECK(initialized_);
31 | int error = pthread_key_delete(key_);
32 | if (error)
33 | NOTREACHED();
34 | initialized_ = false;
35 | }
36 |
37 | void* ThreadLocalStorage::StaticSlot::Get() const {
38 | DCHECK(initialized_);
39 | return pthread_getspecific(key_);
40 | }
41 |
42 | void ThreadLocalStorage::StaticSlot::Set(void* value) {
43 | DCHECK(initialized_);
44 | int error = pthread_setspecific(key_, value);
45 | if (error)
46 | NOTREACHED();
47 | }
48 |
49 | } // namespace base
50 |
--------------------------------------------------------------------------------
/src/Test/StaleElementReferenceTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef STALEELEMENTREFERENCETEST_H
21 | #define STALEELEMENTREFERENCETEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class StaleElementReferenceTestWidget:public QWidget
26 | {
27 | Q_OBJECT
28 |
29 | private:
30 | QLabel *plblCaption;
31 | QPushButton *ppushBtn;
32 |
33 | public:
34 | StaleElementReferenceTestWidget(QWidget *parent = 0);
35 | virtual ~StaleElementReferenceTestWidget();
36 | };
37 |
38 | #endif // STALEELEMENTREFERENCETEST_H
39 |
--------------------------------------------------------------------------------
/src/Test/CoordinatesTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef COORDINATESTEST_H
21 | #define COORDINATESTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class CoordinatesTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | CoordinatesTestWidget();
30 | virtual ~CoordinatesTestWidget();
31 |
32 | private:
33 | QScrollArea *scrollArea;
34 | QLabel *zeroSizeLabel;
35 | QLabel *transparentLabel;
36 | QLabel *hiddenLabel;
37 | QLabel *unvisibleLabel;
38 | };
39 |
40 | #endif // COORDINATESTEST_H
41 |
--------------------------------------------------------------------------------
/src/Test/TouchTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef TOUCHTEST_H
21 | #define TOUCHTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class TouchTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | explicit TouchTestWidget(QWidget *parent = 0);
30 |
31 | protected:
32 | bool eventFilter(QObject *o, QEvent *e);
33 |
34 | private:
35 | QFrame* touchPanel;
36 | QLabel* resultLabel;
37 | QLabel* pressLabel;
38 | QLabel* releaseLabel;
39 | QLabel* moveLabel;
40 | };
41 |
42 | #endif // TOUCHTEST_H
43 |
--------------------------------------------------------------------------------
/src/base/thread_task_runner_handle.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/thread_task_runner_handle.h"
6 |
7 | #include "base/lazy_instance.h"
8 | #include "base/single_thread_task_runner.h"
9 | #include "base/threading/thread_local.h"
10 |
11 | namespace base {
12 |
13 | namespace {
14 |
15 | base::LazyInstance >
16 | lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER;
17 |
18 | } // namespace
19 |
20 | // static
21 | scoped_refptr ThreadTaskRunnerHandle::Get() {
22 | ThreadTaskRunnerHandle* current = lazy_tls_ptr.Pointer()->Get();
23 | DCHECK(current);
24 | return current->task_runner_;
25 | }
26 |
27 | ThreadTaskRunnerHandle::ThreadTaskRunnerHandle(
28 | const scoped_refptr& task_runner)
29 | : task_runner_(task_runner) {
30 | DCHECK(task_runner_->BelongsToCurrentThread());
31 | DCHECK(!lazy_tls_ptr.Pointer()->Get());
32 | lazy_tls_ptr.Pointer()->Set(this);
33 | }
34 |
35 | ThreadTaskRunnerHandle::~ThreadTaskRunnerHandle() {
36 | DCHECK(task_runner_->BelongsToCurrentThread());
37 | DCHECK_EQ(lazy_tls_ptr.Pointer()->Get(), this);
38 | lazy_tls_ptr.Pointer()->Set(NULL);
39 | }
40 |
41 | } // namespace base
42 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/q_event_filter.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "q_event_filter.h"
21 |
22 | QRepaintEventFilter::QRepaintEventFilter(QObject *parent) :
23 | QObject(parent)
24 | {
25 | }
26 |
27 | QRepaintEventFilter::~QRepaintEventFilter() {}
28 |
29 | bool QRepaintEventFilter::eventFilter(QObject *pobject, QEvent *pevent) {
30 | if (pevent->type()== QEvent::Paint) {
31 | emit repainted();
32 | }
33 | return false;
34 | }
35 |
36 | void QCheckPagePaint::pagePainted() {
37 | is_painting = true;
38 | }
39 |
--------------------------------------------------------------------------------
/src/webdriver/commands/source_command.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "commands/source_command.h"
6 |
7 | #include
8 |
9 | #include "base/values.h"
10 | #include "base/bind.h"
11 | #include "commands/response.h"
12 | #include "webdriver_error.h"
13 | #include "webdriver_session.h"
14 | #include "webdriver_view_executor.h"
15 |
16 | namespace webdriver {
17 |
18 | SourceCommand::SourceCommand(const std::vector& path_segments,
19 | const DictionaryValue* const parameters)
20 | : ViewCommand(path_segments, parameters) {}
21 |
22 | SourceCommand::~SourceCommand() {}
23 |
24 | bool SourceCommand::DoesGet() const {
25 | return true;
26 | }
27 |
28 | void SourceCommand::ExecuteGet(Response* const response) {
29 | std::string page_source;
30 | Error* error = NULL;
31 |
32 | session_->RunSessionTask(base::Bind(
33 | &ViewCmdExecutor::GetSource,
34 | base::Unretained(executor_.get()),
35 | &page_source,
36 | &error));
37 |
38 | if (error) {
39 | response->SetError(error);
40 | return;
41 | }
42 |
43 | response->SetValue(new StringValue(page_source));
44 | }
45 |
46 | } // namespace webdriver
47 |
--------------------------------------------------------------------------------
/inc/commands/orientation_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef ORIENTATION_COMMAND_H
6 | #define ORIENTATION_COMMAND_H
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | /// Set and Get the current browser orientation
22 | /// The server should return a valid orientation value as defined in ScreenOrientation: {LANDSCAPE|PORTRAIT}.
23 | /// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/orientation
24 | class OrientationCommand : public ViewCommand {
25 | public:
26 | OrientationCommand(const std::vector& path_segments,
27 | const base::DictionaryValue* const parameters);
28 | virtual ~OrientationCommand();
29 |
30 | virtual bool DoesGet() const OVERRIDE;
31 | virtual bool DoesPost() const OVERRIDE;
32 |
33 | virtual void ExecuteGet(Response* const response) OVERRIDE;
34 | virtual void ExecutePost(Response* const response) OVERRIDE;
35 |
36 | private:
37 | DISALLOW_COPY_AND_ASSIGN(OrientationCommand);
38 | };
39 |
40 | } //webdriver
41 |
42 | #endif // ORIENTATION_COMMAND_H
43 |
--------------------------------------------------------------------------------
/src/Test/TypingTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef TYPINGTEST_H
21 | #define TYPINGTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class TypingTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | explicit TypingTestWidget();
30 | virtual ~TypingTestWidget();
31 |
32 | public slots:
33 | void setResult(QString str);
34 |
35 | private:
36 | QLabel *plblNoChange;
37 | QLabel *plblResult;
38 | QLineEdit *ptxtEn;
39 | QPlainTextEdit *ptxtAreaWorking;
40 |
41 | };
42 |
43 | #endif // TYPINGTEST_H
44 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/widget_view_handle.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "extension_qt/widget_view_handle.h"
21 |
22 | namespace webdriver {
23 |
24 | QViewHandle::QViewHandle()
25 | : view_(NULL) { }
26 |
27 | QViewHandle::QViewHandle(QWidget* view)
28 | : view_(view) { }
29 |
30 | bool QViewHandle::equals(const ViewHandle* other) const {
31 | const QViewHandle* toCompare = dynamic_cast(other);
32 | if (NULL == toCompare) return false;
33 |
34 | return view_ == toCompare->view_;
35 | }
36 |
37 | } // namespace webdriver
38 |
--------------------------------------------------------------------------------
/src/Test/WidgetAndWebViewTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WIDGETANDWEBVIEWTEST_H
21 | #define WIDGETANDWEBVIEWTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class WidgetAndWebViewTestWindows : public QWidget
26 | {
27 | Q_OBJECT
28 | public:
29 | explicit WidgetAndWebViewTestWindows(QWidget *parent = 0);
30 | ~WidgetAndWebViewTestWindows();
31 |
32 | public slots:
33 | void openWebView();
34 |
35 | private:
36 | QPushButton* pButton;
37 | QLineEdit* pLineEdit;
38 |
39 | };
40 |
41 | #endif // WIDGETANDWEBVIEWTEST_H
42 |
--------------------------------------------------------------------------------
/src/Test/ElementSelectingTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef ELEMENTSELECTINGTEST_H
21 | #define ELEMENTSELECTINGTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | namespace Ui {
26 | class ElementSelectingTestWidget;
27 | }
28 |
29 | class ElementSelectingTestWidget : public QMainWindow
30 | {
31 | Q_OBJECT
32 |
33 | public:
34 | explicit ElementSelectingTestWidget(QWidget *parent = 0);
35 | ~ElementSelectingTestWidget();
36 |
37 | private:
38 | Ui::ElementSelectingTestWidget *ui;
39 | };
40 |
41 | #endif // ELEMENTSELECTINGTEST_H
42 |
--------------------------------------------------------------------------------
/src/webdriver/commands/appcache_status_command.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "commands/appcache_status_command.h"
6 |
7 | #include
8 |
9 | #include "base/bind.h"
10 |
11 | #include "commands/response.h"
12 | #include "webdriver_error.h"
13 | #include "webdriver_session.h"
14 | #include "webdriver_view_executor.h"
15 |
16 | namespace webdriver {
17 |
18 | AppCacheStatusCommand::AppCacheStatusCommand(
19 | const std::vector& path_segments,
20 | const DictionaryValue* const parameters)
21 | : ViewCommand(path_segments, parameters) {}
22 |
23 | AppCacheStatusCommand::~AppCacheStatusCommand() {}
24 |
25 | bool AppCacheStatusCommand::DoesGet() const {
26 | return true;
27 | }
28 |
29 | void AppCacheStatusCommand::ExecuteGet(Response* const response) {
30 | int status;
31 | Error* error = NULL;
32 |
33 | session_->RunSessionTask(base::Bind(
34 | &ViewCmdExecutor::GetAppCacheStatus,
35 | base::Unretained(executor_.get()),
36 | &status,
37 | &error));
38 |
39 | if (error) {
40 | response->SetError(error);
41 | return;
42 | }
43 | response->SetValue(new base::FundamentalValue(status));
44 | }
45 |
46 | } // namespace webdriver
47 |
--------------------------------------------------------------------------------
/src/base/android/path_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_PATH_UTILS_H_
6 | #define BASE_ANDROID_PATH_UTILS_H_
7 |
8 | #include
9 | #include
10 |
11 | namespace base {
12 | namespace android {
13 |
14 | // Return the absolute path to the data directory of the current application.
15 | // This method is dedicated for base_paths_android.c, Using
16 | // PathService::Get(base::DIR_ANDROID_APP_DATA, ...) gets the data dir.
17 | std::string GetDataDirectory();
18 |
19 | // Return the absolute path to the cache directory. This method is dedicated for
20 | // base_paths_android.c, Using PathService::Get(base::DIR_CACHE, ...) gets the
21 | // cache dir.
22 | std::string GetCacheDirectory();
23 |
24 | // Returns the path to the public downloads directory.
25 | std::string GetDownloadsDirectory();
26 |
27 | // Returns the path to the native JNI libraries via
28 | // ApplicationInfo.nativeLibraryDir on the Java side.
29 | std::string GetNativeLibraryDirectory();
30 |
31 | // Returns the absolute path to the external storage directory.
32 | std::string GetExternalStorageDirectory();
33 |
34 | bool RegisterPathUtils(JNIEnv* env);
35 |
36 | } // namespace android
37 | } // namespace base
38 |
39 | #endif // BASE_ANDROID_PATH_UTILS_H_
40 |
--------------------------------------------------------------------------------
/src/base/android/jni_helper.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ANDROID_JNI_HELPER_H_
6 | #define BASE_ANDROID_JNI_HELPER_H_
7 |
8 | #include
9 |
10 | #include "base/android/scoped_java_ref.h"
11 |
12 | // Manages WeakGlobalRef lifecycle.
13 | // This class is not thread-safe w.r.t. get() and reset(). Multiple threads may
14 | // safely use get() concurrently, but if the user calls reset() (or of course,
15 | // calls the destructor) they'll need to provide their own synchronization.
16 | class JavaObjectWeakGlobalRef {
17 | public:
18 | JavaObjectWeakGlobalRef();
19 | JavaObjectWeakGlobalRef(const JavaObjectWeakGlobalRef& orig);
20 | JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj);
21 | virtual ~JavaObjectWeakGlobalRef();
22 |
23 | void operator=(const JavaObjectWeakGlobalRef& rhs);
24 |
25 | base::android::ScopedJavaLocalRef get(JNIEnv* env) const;
26 |
27 | void reset();
28 |
29 | private:
30 | void Assign(const JavaObjectWeakGlobalRef& rhs);
31 |
32 | jweak obj_;
33 | };
34 |
35 | // Get the real object stored in the weak reference returned as a
36 | // ScopedJavaLocalRef.
37 | base::android::ScopedJavaLocalRef GetRealObject(
38 | JNIEnv* env, jweak obj);
39 |
40 | #endif // BASE_ANDROID_JNI_HELPER_H_
41 |
--------------------------------------------------------------------------------
/inc/extension_qt/quick2_view_enumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WEBDRIVER_QUICK2_VIEW_ENUMERATOR_H_
21 | #define WEBDRIVER_QUICK2_VIEW_ENUMERATOR_H_
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include "webdriver_view_enumerator.h"
28 |
29 | namespace webdriver {
30 |
31 | class Quick2ViewEnumeratorImpl : public AbstractViewEnumeratorImpl {
32 | public:
33 | virtual void EnumerateViews(Session* session, std::set* views) const;
34 | };
35 |
36 | } // namespace webdriver
37 |
38 | #endif // WEBDRIVER_QUICK2_VIEW_ENUMERATOR_H_
39 |
--------------------------------------------------------------------------------
/inc/commands/execute_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_EXECUTE_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_EXECUTE_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace webdriver {
14 |
15 | class Response;
16 |
17 | /// Inject a snippet of javascript into the page and return its result.
18 | /// WebElements that should be passed to the script as an argument should be
19 | /// specified in the arguments array as WebElement JSON arguments. Likewise,
20 | /// any WebElements in the script result will be returned to the client as
21 | /// WebElement JSON objects. See:
22 | /// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/execute
23 | class ExecuteCommand : public ViewCommand {
24 | public:
25 | ExecuteCommand(const std::vector& path_segments,
26 | const DictionaryValue* const parameters);
27 | virtual ~ExecuteCommand();
28 |
29 | virtual bool DoesPost() const OVERRIDE;
30 | virtual void ExecutePost(Response* const response) OVERRIDE;
31 |
32 | private:
33 | DISALLOW_COPY_AND_ASSIGN(ExecuteCommand);
34 | };
35 |
36 | } // namespace webdriver
37 |
38 | #endif // WEBDRIVER_COMMANDS_EXECUTE_COMMAND_H_
39 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/qwindow_view_handle.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "extension_qt/qwindow_view_handle.h"
21 |
22 | namespace webdriver {
23 |
24 | QWindowViewHandle::QWindowViewHandle()
25 | : view_(NULL) { }
26 |
27 | QWindowViewHandle::QWindowViewHandle(QWindow* view)
28 | : view_(view) { }
29 |
30 | bool QWindowViewHandle::equals(const ViewHandle* other) const {
31 | const QWindowViewHandle* toCompare = dynamic_cast(other);
32 | if (NULL == toCompare) return false;
33 |
34 | return view_ == toCompare->view_;
35 | }
36 |
37 | } // namespace webdriver
38 |
--------------------------------------------------------------------------------
/inc/base/message_loop_proxy.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MESSAGE_LOOP_PROXY_H_
6 | #define BASE_MESSAGE_LOOP_PROXY_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/compiler_specific.h"
10 | #include "base/memory/ref_counted.h"
11 | #include "base/single_thread_task_runner.h"
12 |
13 | namespace base {
14 |
15 | // This class provides a thread-safe refcounted interface to the Post* methods
16 | // of a message loop. This class can outlive the target message loop.
17 | // MessageLoopProxy objects are constructed automatically for all MessageLoops.
18 | // So, to access them, you can use any of the following:
19 | // Thread::message_loop_proxy()
20 | // MessageLoop::current()->message_loop_proxy()
21 | // MessageLoopProxy::current()
22 | //
23 | // TODO(akalin): Now that we have the *TaskRunner interfaces, we can
24 | // merge this with MessageLoopProxyImpl.
25 | class BASE_EXPORT MessageLoopProxy : public SingleThreadTaskRunner {
26 | public:
27 | // Gets the MessageLoopProxy for the current message loop, creating one if
28 | // needed.
29 | static scoped_refptr current();
30 |
31 | protected:
32 | MessageLoopProxy();
33 | virtual ~MessageLoopProxy();
34 | };
35 |
36 | } // namespace base
37 |
38 | #endif // BASE_MESSAGE_LOOP_PROXY_H_
39 |
--------------------------------------------------------------------------------
/inc/commands/log_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_LOG_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_LOG_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | class LogCommand : public ViewCommand {
22 | public:
23 | LogCommand(const std::vector& path_segments,
24 | const base::DictionaryValue* parameters);
25 | virtual ~LogCommand();
26 |
27 | virtual bool DoesPost() const OVERRIDE;
28 | virtual void ExecutePost(Response* const response) OVERRIDE;
29 |
30 | private:
31 | DISALLOW_COPY_AND_ASSIGN(LogCommand);
32 | };
33 |
34 | class LogTypesCommand : public WebDriverCommand {
35 | public:
36 | LogTypesCommand(const std::vector& path_segments,
37 | const base::DictionaryValue* parameters);
38 | virtual ~LogTypesCommand();
39 |
40 | virtual bool DoesGet() const OVERRIDE;
41 | virtual void ExecuteGet(Response* const response) OVERRIDE;
42 |
43 | private:
44 | DISALLOW_COPY_AND_ASSIGN(LogTypesCommand);
45 | };
46 |
47 | } // namespace webdriver
48 |
49 | #endif // WEBDRIVER_COMMANDS_LOG_COMMAND_H_
50 |
--------------------------------------------------------------------------------
/inc/extension_qt/qml_view_enumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WEBDRIVER_QML_VIEW_ENUMERATOR_H_
21 | #define WEBDRIVER_QML_VIEW_ENUMERATOR_H_
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include "webdriver_view_enumerator.h"
28 |
29 | namespace webdriver {
30 |
31 | /// class for QWebView enumerator
32 | class QmlViewEnumeratorImpl : public AbstractViewEnumeratorImpl {
33 | public:
34 | virtual void EnumerateViews(Session* session, std::set* views) const;
35 | };
36 |
37 | } // namespace webdriver
38 |
39 | #endif // WEBDRIVER_QML_VIEW_ENUMERATOR_H_
40 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/widget_element_handle.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "extension_qt/widget_element_handle.h"
21 |
22 | namespace webdriver {
23 |
24 | QElementHandle::QElementHandle()
25 | : element_(NULL) {}
26 |
27 | QElementHandle::QElementHandle(QObject* element)
28 | : element_(element) {}
29 |
30 | bool QElementHandle::equals(const ElementHandle* other) const {
31 | const QElementHandle* toCompare = dynamic_cast(other);
32 | if (NULL == toCompare) return false;
33 |
34 | return element_ == toCompare->element_;
35 | }
36 |
37 |
38 | } // namespace webdriver
39 |
--------------------------------------------------------------------------------
/inc/extension_qt/web_view_enumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WEBDRIVER_WEB_VIEW_ENUMERATOR_H_
21 | #define WEBDRIVER_WEB_VIEW_ENUMERATOR_H_
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include "webdriver_view_enumerator.h"
28 |
29 |
30 | namespace webdriver {
31 |
32 | /// class for QWebView enumerator
33 | class WebViewEnumeratorImpl : public AbstractViewEnumeratorImpl {
34 | public:
35 | virtual void EnumerateViews(Session* session, std::set* views) const;
36 | };
37 |
38 | } // namespace webdriver
39 |
40 | #endif // WEBDRIVER_WEB_VIEW_ENUMERATOR_H_
41 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/qml_objname_util.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "qml_objname_util.h"
21 | #include "webdriver_util.h"
22 |
23 |
24 | namespace webdriver {
25 |
26 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
27 | ObjectNameUtils::ObjectNameUtils(QQuickItem *root) : root_(root) {}
28 | #else
29 | ObjectNameUtils::ObjectNameUtils(QDeclarativeItem *root) : root_(root) {}
30 | #endif
31 | ObjectNameUtils::~ObjectNameUtils() {}
32 |
33 | QObject *ObjectNameUtils::findChild(const QString& name) {
34 | QObject *obj = findChild(root_, name);
35 | return obj;
36 | }
37 |
38 | } // namespace webdriver
39 |
--------------------------------------------------------------------------------
/src/base/base64.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/base64.h"
6 |
7 | #include "third_party/modp_b64/modp_b64.h"
8 |
9 | namespace base {
10 |
11 | bool Base64Encode(const StringPiece& input, std::string* output) {
12 | std::string temp;
13 | temp.resize(modp_b64_encode_len(input.size())); // makes room for null byte
14 |
15 | // null terminates result since result is base64 text!
16 | int input_size = static_cast(input.size());
17 |
18 | // modp_b64_encode_len() returns at least 1, so temp[0] is safe to use.
19 | int output_size = modp_b64_encode(&(temp[0]), input.data(), input_size);
20 | if (output_size < 0)
21 | return false;
22 |
23 | temp.resize(output_size); // strips off null byte
24 | output->swap(temp);
25 | return true;
26 | }
27 |
28 | bool Base64Decode(const StringPiece& input, std::string* output) {
29 | std::string temp;
30 | temp.resize(modp_b64_decode_len(input.size()));
31 |
32 | // does not null terminate result since result is binary data!
33 | int input_size = static_cast(input.size());
34 | int output_size = modp_b64_decode(&(temp[0]), input.data(), input_size);
35 | if (output_size < 0)
36 | return false;
37 |
38 | temp.resize(output_size);
39 | output->swap(temp);
40 | return true;
41 | }
42 |
43 | } // namespace base
44 |
--------------------------------------------------------------------------------
/inc/extension_qt/widget_view_enumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WEBDRIVER_WIDGET_VIEW_ENUMERATOR_H_
21 | #define WEBDRIVER_WIDGET_VIEW_ENUMERATOR_H_
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include "webdriver_view_enumerator.h"
28 |
29 |
30 | namespace webdriver {
31 |
32 | /// class for QWebView enumerator
33 | class WidgetViewEnumeratorImpl : public AbstractViewEnumeratorImpl {
34 | public:
35 | virtual void EnumerateViews(Session* session, std::set* views) const;
36 | };
37 |
38 | } // namespace webdriver
39 |
40 | #endif // WEBDRIVER_WIDGET_VIEW_ENUMERATOR_H_
41 |
--------------------------------------------------------------------------------
/src/net/base/file_stream_metrics.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // File error statistics gathering.
6 |
7 | #ifndef NET_BASE_FILE_STREAM_METRICS_H_
8 | #define NET_BASE_FILE_STREAM_METRICS_H_
9 |
10 | namespace net {
11 |
12 | enum FileErrorSource {
13 | FILE_ERROR_SOURCE_OPEN = 0,
14 | FILE_ERROR_SOURCE_WRITE,
15 | FILE_ERROR_SOURCE_READ,
16 | FILE_ERROR_SOURCE_SEEK,
17 | FILE_ERROR_SOURCE_FLUSH,
18 | FILE_ERROR_SOURCE_SET_EOF,
19 | FILE_ERROR_SOURCE_GET_SIZE,
20 | FILE_ERROR_SOURCE_COUNT,
21 | };
22 |
23 | // UMA error statistics gathering.
24 | // Put the error value into a bucket.
25 | int GetFileErrorUmaBucket(int error);
26 |
27 | // The largest bucket number, plus 1.
28 | int MaxFileErrorUmaBucket();
29 |
30 | // The highest error value we want to individually report.
31 | int MaxFileErrorUmaValue();
32 |
33 | // |error| is a platform-specific error (Windows or Posix).
34 | // |source| indicates the operation that resulted in the error.
35 | // |record| is a flag indicating that we are interested in this error.
36 | void RecordFileError(int error, FileErrorSource source, bool record);
37 |
38 | // Gets a description for the source of a file error.
39 | const char* GetFileErrorSourceName(FileErrorSource source);
40 |
41 | } // namespace net
42 |
43 | #endif // NET_BASE_FILE_STREAM_METRICS_H_
44 |
--------------------------------------------------------------------------------
/inc/commands/sessions.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef SESSIONS_H
21 | #define SESSIONS_H
22 |
23 | #include "commands/command.h"
24 |
25 | namespace webdriver {
26 |
27 | class Response;
28 |
29 | class Sessions : public Command
30 | {
31 | public:
32 | Sessions(const std::vector& path_segments,
33 | const DictionaryValue* const parameters);
34 | virtual ~Sessions();
35 |
36 | virtual bool DoesGet() const OVERRIDE;
37 |
38 | virtual void ExecuteGet(Response* const response) OVERRIDE;
39 |
40 | private:
41 | DISALLOW_COPY_AND_ASSIGN(Sessions);
42 | };
43 |
44 | }
45 |
46 | #endif // SESSIONS_H
47 |
--------------------------------------------------------------------------------
/src/base/third_party/dynamic_annotations/dynamic_annotations.gyp:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | {
6 | 'targets': [
7 | {
8 | 'target_name': 'dynamic_annotations',
9 | 'type': 'static_library',
10 | 'toolsets': ['host', 'target'],
11 | 'include_dirs': [
12 | '../../../',
13 | ],
14 | 'sources': [
15 | 'dynamic_annotations.c',
16 | 'dynamic_annotations.h',
17 | '../valgrind/valgrind.h',
18 | ],
19 | },
20 | ],
21 | 'conditions': [
22 | ['OS == "win"', {
23 | 'targets': [
24 | {
25 | 'target_name': 'dynamic_annotations_win64',
26 | 'type': 'static_library',
27 | # We can't use dynamic_annotations target for win64 build since it is
28 | # a 32-bit library.
29 | # TODO(gregoryd): merge with dynamic_annotations when
30 | # the win32/64 targets are merged.
31 | 'include_dirs': [
32 | '../../../',
33 | ],
34 | 'sources': [
35 | 'dynamic_annotations.c',
36 | 'dynamic_annotations.h',
37 | ],
38 | 'configurations': {
39 | 'Common_Base': {
40 | 'msvs_target_platform': 'x64',
41 | },
42 | },
43 | },
44 | ],
45 | }],
46 | ],
47 | }
48 |
--------------------------------------------------------------------------------
/src/Test/ClickTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | /* ClickTest.h
21 | */
22 |
23 | #ifndef CLICKTEST_H
24 | #define CLICKTEST_H
25 |
26 | #include "CommonQtTestHeaders.h"
27 |
28 | class ClickTestWidget : public QWidget
29 | {
30 | Q_OBJECT
31 | public:
32 | ClickTestWidget();
33 | virtual ~ClickTestWidget();
34 |
35 | private slots:
36 | void OnNormalBtnClick();
37 | void OnCheckBoxClick();
38 | void OnBtnOnScrollClick();
39 |
40 | private:
41 | QPushButton *normalBtn;
42 | QCheckBox *checkBox;
43 | QScrollArea *scrollArea;
44 | QPushButton *btnOnScroolArea;
45 | };
46 |
47 | #endif // CLICKTEST_H
48 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/graphics_web_view_handle.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "extension_qt/graphics_web_view_handle.h"
21 |
22 | namespace webdriver {
23 |
24 | GraphicsWebViewHandle::GraphicsWebViewHandle()
25 | : view_(NULL) { }
26 |
27 | GraphicsWebViewHandle::GraphicsWebViewHandle(QGraphicsWebView* view)
28 | : view_(view) { }
29 |
30 | bool GraphicsWebViewHandle::equals(const ViewHandle* other) const {
31 | const GraphicsWebViewHandle* toCompare = dynamic_cast(other);
32 | if (NULL == toCompare) return false;
33 |
34 | return view_ == toCompare->view_;
35 | }
36 |
37 | } // namespace webdriver
38 |
--------------------------------------------------------------------------------
/src/Test/DragableWidget.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef DRAGABLEWIDGET_H
21 | #define DRAGABLEWIDGET_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 | #include "RestyledLabel.h"
25 |
26 | class DragableWidget : public QWidget
27 | {
28 | Q_OBJECT
29 | public:
30 | DragableWidget(QWidget *parent = 0);
31 | void setDraggingReportsDestination(QLabel* destination);
32 |
33 | protected:
34 | bool isReportDraggingOn;
35 | QLabel* draggingReports;
36 | void dragEnterEvent(QDragEnterEvent *event);
37 | void dropEvent(QDropEvent *event);
38 | void mousePressEvent(QMouseEvent *event);
39 | };
40 |
41 | #endif // DRAGABLEWIDGET_H
42 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/q_content_type_resolver.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef Q_CONTENT_TYPE_RESOLVER_H
21 | #define Q_CONTENT_TYPE_RESOLVER_H
22 |
23 | #include
24 | #include
25 |
26 | namespace webdriver {
27 |
28 | class Error;
29 |
30 | class QContentTypeResolver
31 | {
32 | public:
33 | QContentTypeResolver(QNetworkAccessManager *pmanager);
34 | ~QContentTypeResolver();
35 |
36 | Error* resolveContentType(const std::string& url, std::string& mimetype);
37 |
38 | private:
39 | QNetworkAccessManager *manager_;
40 |
41 | };
42 |
43 | }
44 |
45 | #endif // Q_CONTENT_TYPE_RESOLVER_H
46 |
--------------------------------------------------------------------------------
/inc/extension_qt/graphics_web_view_enumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WEBDRIVER_GRAPHICS_WEB_VIEW_ENUMERATOR_H_
21 | #define WEBDRIVER_GRAPHICS_WEB_VIEW_ENUMERATOR_H_
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include "webdriver_view_enumerator.h"
28 |
29 | namespace webdriver {
30 |
31 | /// class for QDeclarativeWebView enumerator
32 | class GraphicsWebViewEnumeratorImpl : public AbstractViewEnumeratorImpl {
33 | public:
34 | virtual void EnumerateViews(Session* session, std::set* views) const;
35 | };
36 |
37 | } // namespace webdriver
38 |
39 | #endif // WEBDRIVER_GRAPHICS_WEB_VIEW_ENUMERATOR_H_
40 |
--------------------------------------------------------------------------------
/src/webdriver/webdriver_view_runner.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "webdriver_view_runner.h"
21 |
22 | #include "base/bind.h"
23 | #include "base/callback.h"
24 | #include "base/synchronization/waitable_event.h"
25 |
26 | namespace webdriver {
27 |
28 | ViewRunner::CreateRunnerMethod ViewRunner::create = &(ViewRunner::createRunner);
29 |
30 | ViewRunner::ViewRunner() {}
31 |
32 | void ViewRunner::RunClosure(const base::Closure& task, base::WaitableEvent* done_event) {
33 | task.Run();
34 | done_event->Signal();
35 | }
36 |
37 | ViewRunner* ViewRunner::CreateRunner(void) {
38 | return create();
39 | }
40 |
41 | } //namespace webdriver
42 |
--------------------------------------------------------------------------------
/inc/base/environment.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_ENVIRONMENT_H_
6 | #define BASE_ENVIRONMENT_H_
7 |
8 | #include
9 |
10 | #include "base/base_export.h"
11 | #include "build/build_config.h"
12 |
13 | namespace base {
14 |
15 | namespace env_vars {
16 |
17 | #if defined(OS_POSIX)
18 | BASE_EXPORT extern const char kHome[];
19 | #endif
20 |
21 | } // namespace env_vars
22 |
23 | class BASE_EXPORT Environment {
24 | public:
25 | virtual ~Environment();
26 |
27 | // Static factory method that returns the implementation that provide the
28 | // appropriate platform-specific instance.
29 | static Environment* Create();
30 |
31 | // Gets an environment variable's value and stores it in |result|.
32 | // Returns false if the key is unset.
33 | virtual bool GetVar(const char* variable_name, std::string* result) = 0;
34 |
35 | // Syntactic sugar for GetVar(variable_name, NULL);
36 | virtual bool HasVar(const char* variable_name);
37 |
38 | // Returns true on success, otherwise returns false.
39 | virtual bool SetVar(const char* variable_name,
40 | const std::string& new_value) = 0;
41 |
42 | // Returns true on success, otherwise returns false.
43 | virtual bool UnSetVar(const char* variable_name) = 0;
44 | };
45 |
46 | } // namespace base
47 |
48 | #endif // BASE_ENVIRONMENT_H_
49 |
--------------------------------------------------------------------------------
/inc/commands/execute_async_script_command.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_EXECUTE_ASYNC_SCRIPT_COMMAND_H_
6 | #define WEBDRIVER_COMMANDS_EXECUTE_ASYNC_SCRIPT_COMMAND_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/webdriver_command.h"
12 |
13 | namespace base {
14 | class DictionaryValue;
15 | }
16 |
17 | namespace webdriver {
18 |
19 | class Response;
20 |
21 | /// Inject a snippet of javascript into the page and return its result.
22 | /// WebElements that should be passed to the script as an argument should be
23 | /// specified in the arguments array as WebElement JSON arguments. Likewise,
24 | /// any WebElements in the script result will be returned to the client as
25 | /// WebElement JSON objects.
26 | class ExecuteAsyncScriptCommand : public ViewCommand {
27 | public:
28 | ExecuteAsyncScriptCommand(const std::vector& path_segments,
29 | const base::DictionaryValue* const parameters);
30 | virtual ~ExecuteAsyncScriptCommand();
31 |
32 | virtual bool DoesPost() const OVERRIDE;
33 | virtual void ExecutePost(Response* const response) OVERRIDE;
34 |
35 | private:
36 | DISALLOW_COPY_AND_ASSIGN(ExecuteAsyncScriptCommand);
37 | };
38 |
39 | } // namespace webdriver
40 |
41 | #endif // WEBDRIVER_COMMANDS_EXECUTE_ASYNC_SCRIPT_COMMAND_H_
42 |
--------------------------------------------------------------------------------
/src/third_party/webdriver/README.chromium:
--------------------------------------------------------------------------------
1 | Name: Webdriver
2 | Short Name: selenium
3 | URL: http://selenium.googlecode.com/svn/trunk/py
4 | http://selenium.googlecode.com/svn/trunk/common/src/web
5 | Version: unknown
6 | Revision: 16922
7 | Security Critical: no
8 | License: Apache 2, MIT and GPL
9 |
10 |
11 | Description:
12 | WebDriver is a clean, fast framework for automated testing of webapps.
13 |
14 | Contents:
15 | python/
16 | Python bindings and tests for WebDriver pulled in via DEPS.
17 |
18 | test_data/
19 | Select files from http://selenium.googlecode.com/svn/trunk/common/src/web.
20 | At revision 17149. Necessary data for running the python webdriver tests.
21 |
22 | atoms.h, atoms.cc
23 | These atoms are generated by the webdriver team and are to be checked in
24 | manually. The current version was generated from revision 17589.
25 |
26 | To generate the atoms using the code found in selenium tree:
27 | $ svn checkout http://selenium.googlecode.com/svn/trunk/ selenium-read-only
28 | $ cd selenium-read-only
29 | $ go //javascript/chrome-driver:atoms
30 | $ cp build/javascript/chrome-driver/atoms.h \
31 | /src/third_party/webdriver/atoms.h
32 | $ cp build/javascript/chrome-driver/atoms.cc \
33 | /src/third_party/webdriver/atoms.cc
34 |
35 | The atoms.h/cc files are only used directly in the chrome version of
36 | webdriver found under the path src/chrome/test/webdriver.
37 |
38 |
--------------------------------------------------------------------------------
/src/base/synchronization/lock_impl_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/synchronization/lock_impl.h"
6 |
7 | #include
8 |
9 | #include "base/logging.h"
10 |
11 | namespace base {
12 | namespace internal {
13 |
14 | LockImpl::LockImpl() {
15 | #ifndef NDEBUG
16 | // In debug, setup attributes for lock error checking.
17 | pthread_mutexattr_t mta;
18 | int rv = pthread_mutexattr_init(&mta);
19 | DCHECK_EQ(rv, 0);
20 | rv = pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_ERRORCHECK);
21 | DCHECK_EQ(rv, 0);
22 | rv = pthread_mutex_init(&os_lock_, &mta);
23 | DCHECK_EQ(rv, 0);
24 | rv = pthread_mutexattr_destroy(&mta);
25 | DCHECK_EQ(rv, 0);
26 | #else
27 | // In release, go with the default lock attributes.
28 | pthread_mutex_init(&os_lock_, NULL);
29 | #endif
30 | }
31 |
32 | LockImpl::~LockImpl() {
33 | int rv = pthread_mutex_destroy(&os_lock_);
34 | DCHECK_EQ(rv, 0);
35 | }
36 |
37 | bool LockImpl::Try() {
38 | int rv = pthread_mutex_trylock(&os_lock_);
39 | DCHECK(rv == 0 || rv == EBUSY);
40 | return rv == 0;
41 | }
42 |
43 | void LockImpl::Lock() {
44 | int rv = pthread_mutex_lock(&os_lock_);
45 | DCHECK_EQ(rv, 0);
46 | }
47 |
48 | void LockImpl::Unlock() {
49 | int rv = pthread_mutex_unlock(&os_lock_);
50 | DCHECK_EQ(rv, 0);
51 | }
52 |
53 | } // namespace internal
54 | } // namespace base
55 |
--------------------------------------------------------------------------------
/inc/base/threading/thread_checker_impl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_THREADING_THREAD_CHECKER_IMPL_H_
6 | #define BASE_THREADING_THREAD_CHECKER_IMPL_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/synchronization/lock.h"
10 | #include "base/threading/platform_thread.h"
11 |
12 | namespace base {
13 |
14 | // Real implementation of ThreadChecker, for use in debug mode, or
15 | // for temporary use in release mode (e.g. to CHECK on a threading issue
16 | // seen only in the wild).
17 | //
18 | // Note: You should almost always use the ThreadChecker class to get the
19 | // right version for your build configuration.
20 | class BASE_EXPORT ThreadCheckerImpl {
21 | public:
22 | ThreadCheckerImpl();
23 | ~ThreadCheckerImpl();
24 |
25 | bool CalledOnValidThread() const;
26 |
27 | // Changes the thread that is checked for in CalledOnValidThread. This may
28 | // be useful when an object may be created on one thread and then used
29 | // exclusively on another thread.
30 | void DetachFromThread();
31 |
32 | private:
33 | void EnsureThreadIdAssigned() const;
34 |
35 | mutable base::Lock lock_;
36 | // This is mutable so that CalledOnValidThread can set it.
37 | // It's guarded by |lock_|.
38 | mutable PlatformThreadId valid_thread_id_;
39 | };
40 |
41 | } // namespace base
42 |
43 | #endif // BASE_THREADING_THREAD_CHECKER_IMPL_H_
44 |
--------------------------------------------------------------------------------
/src/Test/GraphicsWebViewTest.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "GraphicsWebViewTest.h"
21 |
22 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
23 | #include
24 | #else
25 | #include
26 | #endif
27 |
28 | GraphicsWebViewTestWindows::GraphicsWebViewTestWindows(QWidget *parent) :
29 | QGraphicsView(parent) {
30 | this->setWindowTitle("Test Widget");
31 |
32 | QGraphicsScene *pScene = new QGraphicsScene();
33 | pWebView = new QGraphicsWebView();
34 | pScene->addItem(pWebView);
35 |
36 | this->setScene(pScene);
37 | }
38 |
39 | GraphicsWebViewTestWindows::~GraphicsWebViewTestWindows() {
40 | delete pWebView;
41 | }
42 |
--------------------------------------------------------------------------------
/src/base/third_party/dynamic_annotations/LICENSE:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2008-2009, Google Inc.
2 | * All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are
6 | * met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Neither the name of Google Inc. nor the names of its
11 | * contributors may be used to endorse or promote products derived from
12 | * this software without specific prior written permission.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | *
26 | * ---
27 | * Author: Kostya Serebryany
28 | */
29 |
--------------------------------------------------------------------------------
/inc/base/mac/scoped_nsautorelease_pool.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_
6 | #define BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/basictypes.h"
10 |
11 | #if defined(__OBJC__)
12 | @class NSAutoreleasePool;
13 | #else // __OBJC__
14 | class NSAutoreleasePool;
15 | #endif // __OBJC__
16 |
17 | namespace base {
18 | namespace mac {
19 |
20 | // ScopedNSAutoreleasePool allocates an NSAutoreleasePool when instantiated and
21 | // sends it a -drain message when destroyed. This allows an autorelease pool to
22 | // be maintained in ordinary C++ code without bringing in any direct Objective-C
23 | // dependency.
24 |
25 | class BASE_EXPORT ScopedNSAutoreleasePool {
26 | public:
27 | ScopedNSAutoreleasePool();
28 | ~ScopedNSAutoreleasePool();
29 |
30 | // Clear out the pool in case its position on the stack causes it to be
31 | // alive for long periods of time (such as the entire length of the app).
32 | // Only use then when you're certain the items currently in the pool are
33 | // no longer needed.
34 | void Recycle();
35 | private:
36 | NSAutoreleasePool* autorelease_pool_;
37 |
38 | private:
39 | DISALLOW_COPY_AND_ASSIGN(ScopedNSAutoreleasePool);
40 | };
41 |
42 | } // namespace mac
43 | } // namespace base
44 |
45 | #endif // BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_
46 |
--------------------------------------------------------------------------------
/src/Test/FormHandlingTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef FORMHANDLINGTEST_H
21 | #define FORMHANDLINGTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class FormHandlingTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 |
29 | private:
30 | QPushButton *pTxtBtn;
31 | QPushButton *pImageBtn;
32 | QPlainTextEdit *ptxtAreaWorking;
33 | QLineEdit *pinputElemWithText;
34 | QLineEdit *pinputElemEmpty;
35 |
36 | public:
37 | explicit FormHandlingTestWidget(QWidget *parent = 0);
38 | virtual ~FormHandlingTestWidget();
39 |
40 | signals:
41 |
42 | private slots:
43 | void setNewWindowTitle();
44 |
45 | };
46 |
47 | #endif // FORMHANDLINGTEST_H
48 |
--------------------------------------------------------------------------------
/src/Test/ClickScrollingTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef CLICKSCROLLINGTEST_H
21 | #define CLICKSCROLLINGTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | namespace Ui {
26 | class ClickScrollingTestWidget;
27 | }
28 |
29 | class ClickScrollingTestWidget : public QMainWindow
30 | {
31 | Q_OBJECT
32 |
33 | public:
34 | explicit ClickScrollingTestWidget(QWidget *parent = 0);
35 | ~ClickScrollingTestWidget();
36 |
37 | private:
38 | Ui::ClickScrollingTestWidget *ui;
39 | private slots:
40 | void ClickOnVisibleButton();
41 | void ClickOnButtonHiddenByOverflow();
42 | void ClickOnPartiallyVisibleRadioButton();
43 | };
44 |
45 | #endif // CLICKSCROLLINGTEST_H
46 |
--------------------------------------------------------------------------------
/src/Test/WindowWithEmbeddedViewTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WINDOWWITHEMBEDDEDVIEWTEST_H
21 | #define WINDOWWITHEMBEDDEDVIEWTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class QWebView;
26 |
27 | class WindowWithEmbeddedViewTestWidget : public QWidget
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit WindowWithEmbeddedViewTestWidget(QWidget *parent = 0);
32 | ~WindowWithEmbeddedViewTestWidget();
33 |
34 | public slots:
35 | void loadHTML();
36 | void setHTMLTitle();
37 |
38 | private:
39 | QPushButton* pButton;
40 | QLineEdit* pLineEdit;
41 | QLabel *pLabel;
42 | QWebView *pView;
43 |
44 | };
45 |
46 | #endif // WINDOWWITHEMBEDDEDVIEWTEST_H
47 |
--------------------------------------------------------------------------------
/src/Test/StaleElementReferenceTest.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "StaleElementReferenceTest.h"
21 |
22 | StaleElementReferenceTestWidget::StaleElementReferenceTestWidget(QWidget *parent):
23 | QWidget(parent)
24 | {
25 | plblCaption = new QLabel("This Is Caption", this);
26 | plblCaption->setObjectName("captionLabel");
27 |
28 | ppushBtn = new QPushButton("Click me", this);
29 | ppushBtn->setObjectName("clickButton");
30 |
31 | QVBoxLayout *pvbl = new QVBoxLayout(this);
32 | pvbl->addWidget(plblCaption);
33 | pvbl->addWidget(ppushBtn);
34 | this->setLayout(pvbl);
35 |
36 | }
37 |
38 | StaleElementReferenceTestWidget::~StaleElementReferenceTestWidget()
39 | {
40 | }
41 |
--------------------------------------------------------------------------------
/inc/base/win/scoped_co_mem.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_WIN_SCOPED_CO_MEM_H_
6 | #define BASE_WIN_SCOPED_CO_MEM_H_
7 |
8 | #include
9 |
10 | #include "base/basictypes.h"
11 | #include "base/logging.h"
12 |
13 | namespace base {
14 | namespace win {
15 |
16 | // Simple scoped memory releaser class for COM allocated memory.
17 | // Example:
18 | // base::win::ScopedCoMem file_item;
19 | // SHGetSomeInfo(&file_item, ...);
20 | // ...
21 | // return; <-- memory released
22 | template
23 | class ScopedCoMem {
24 | public:
25 | ScopedCoMem() : mem_ptr_(NULL) {}
26 | ~ScopedCoMem() {
27 | Reset(NULL);
28 | }
29 |
30 | T** operator&() { // NOLINT
31 | DCHECK(mem_ptr_ == NULL); // To catch memory leaks.
32 | return &mem_ptr_;
33 | }
34 |
35 | operator T*() {
36 | return mem_ptr_;
37 | }
38 |
39 | T* operator->() {
40 | DCHECK(mem_ptr_ != NULL);
41 | return mem_ptr_;
42 | }
43 |
44 | const T* operator->() const {
45 | DCHECK(mem_ptr_ != NULL);
46 | return mem_ptr_;
47 | }
48 |
49 | void Reset(T* ptr) {
50 | if (mem_ptr_)
51 | CoTaskMemFree(mem_ptr_);
52 | mem_ptr_ = ptr;
53 | }
54 |
55 | private:
56 | T* mem_ptr_;
57 |
58 | DISALLOW_COPY_AND_ASSIGN(ScopedCoMem);
59 | };
60 |
61 | } // namespace win
62 | } // namespace base
63 |
64 | #endif // BASE_WIN_SCOPED_CO_MEM_H_
65 |
--------------------------------------------------------------------------------
/src/Test/VisibilityTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef VISIBILITYTEST_H
21 | #define VISIBILITYTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class VisibilityTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 |
29 | private:
30 | QLabel *plblDis;
31 | QLabel *plblEn;
32 | QLabel *plblZero;
33 | QPushButton *pbtnCanHide;
34 | QPushButton *pbtnHidden;
35 | QLineEdit *ptxtHidden;
36 | QScrollArea *pscrollArea;
37 | QPushButton *ppushBtn;
38 |
39 | public:
40 | explicit VisibilityTestWidget(QWidget *parent = 0);
41 | virtual ~VisibilityTestWidget();
42 |
43 | public slots:
44 | void hideButton();
45 |
46 | };
47 |
48 | #endif // VISIBILITYTEST_H
49 |
--------------------------------------------------------------------------------
/src/Test/GraphicsWebViewTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef GRAPHICS_WEB_VIEW_TEST_H
21 | #define GRAPHICS_WEB_VIEW_TEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
26 | #include
27 | #include
28 | #else
29 | #include
30 | #include
31 | #endif
32 |
33 | class GraphicsWebViewTestWindows : public QGraphicsView
34 | {
35 | Q_OBJECT
36 | public:
37 | explicit GraphicsWebViewTestWindows(QWidget *parent = 0);
38 | ~GraphicsWebViewTestWindows();
39 | private:
40 | QGraphicsWebView *pWebView;
41 | };
42 |
43 | #endif // GRAPHICS_WEB_VIEW_TEST_H
44 |
--------------------------------------------------------------------------------
/inc/base/single_thread_task_runner.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_SINGLE_THREAD_TASK_RUNNER_H_
6 | #define BASE_SINGLE_THREAD_TASK_RUNNER_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/sequenced_task_runner.h"
10 |
11 | namespace base {
12 |
13 | // A SingleThreadTaskRunner is a SequencedTaskRunner with one more
14 | // guarantee; namely, that all tasks are run on a single dedicated
15 | // thread. Most use cases require only a SequencedTaskRunner, unless
16 | // there is a specific need to run tasks on only a single dedicated.
17 | //
18 | // Some theoretical implementations of SingleThreadTaskRunner:
19 | //
20 | // - A SingleThreadTaskRunner that uses a single worker thread to
21 | // run posted tasks (i.e., a message loop).
22 | //
23 | // - A SingleThreadTaskRunner that stores the list of posted tasks
24 | // and has a method Run() that runs each runnable task in FIFO
25 | // order that must be run only from the thread the
26 | // SingleThreadTaskRunner was created on.
27 | class BASE_EXPORT SingleThreadTaskRunner : public SequencedTaskRunner {
28 | public:
29 | // A more explicit alias to RunsTasksOnCurrentThread().
30 | bool BelongsToCurrentThread() const {
31 | return RunsTasksOnCurrentThread();
32 | }
33 |
34 | protected:
35 | virtual ~SingleThreadTaskRunner() {}
36 | };
37 |
38 | } // namespace base
39 |
40 | #endif // BASE_SERIAL_TASK_RUNNER_H_
41 |
--------------------------------------------------------------------------------
/inc/extension_qt/qml_web_view_enumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WEBDRIVER_QML_WEB_VIEW_ENUMERATOR_H_
21 | #define WEBDRIVER_QML_WEB_VIEW_ENUMERATOR_H_
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include "webdriver_view_enumerator.h"
28 |
29 | class QDeclarativeItem;
30 |
31 | namespace webdriver {
32 |
33 | /// class for QDeclarativeWebView enumerator
34 | class QmlWebViewEnumeratorImpl : public AbstractViewEnumeratorImpl {
35 | public:
36 | virtual void EnumerateViews(Session* session, std::set* views) const;
37 | private:
38 | bool isWebView(QDeclarativeItem* item) const;
39 | };
40 |
41 | } // namespace webdriver
42 |
43 | #endif // WEBDRIVER_QML_WEB_VIEW_ENUMERATOR_H_
44 |
--------------------------------------------------------------------------------
/inc/base/threading/post_task_and_reply_impl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This file contains the implementation shared by
6 | // MessageLoopProxy::PostTaskAndReply and WorkerPool::PostTaskAndReply.
7 |
8 | #ifndef BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
9 | #define BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
10 |
11 | #include "base/callback_forward.h"
12 | #include "base/location.h"
13 |
14 | namespace base {
15 | namespace internal {
16 |
17 | // Inherit from this in a class that implements PostTask appropriately
18 | // for sending to a destination thread.
19 | //
20 | // Note that 'reply' will always get posted back to your current
21 | // MessageLoop.
22 | //
23 | // If you're looking for a concrete implementation of
24 | // PostTaskAndReply, you probably want base::MessageLoopProxy, or you
25 | // may want base::WorkerPool.
26 | class PostTaskAndReplyImpl {
27 | public:
28 | // Implementation for MessageLoopProxy::PostTaskAndReply and
29 | // WorkerPool::PostTaskAndReply.
30 | bool PostTaskAndReply(const tracked_objects::Location& from_here,
31 | const Closure& task,
32 | const Closure& reply);
33 |
34 | private:
35 | virtual bool PostTask(const tracked_objects::Location& from_here,
36 | const Closure& task) = 0;
37 | };
38 |
39 | } // namespace internal
40 | } // namespace base
41 |
42 | #endif // BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
43 |
--------------------------------------------------------------------------------
/src/base/android/jni_generator/jni_generator.gyp:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | {
6 | 'targets': [
7 | {
8 | 'target_name': 'jni_generator_py_tests',
9 | 'type': 'none',
10 | 'actions': [
11 | {
12 | 'action_name': 'run_jni_generator_py_tests',
13 | 'inputs': [
14 | 'jni_generator.py',
15 | 'jni_generator_tests.py',
16 | 'SampleForTests.java',
17 | 'golden_sample_for_tests_jni.h',
18 | ],
19 | 'outputs': [
20 | '',
21 | ],
22 | 'action': [
23 | 'python', 'jni_generator_tests.py',
24 | ],
25 | },
26 | ],
27 | },
28 | {
29 | 'target_name': 'jni_sample_header',
30 | 'type': 'none',
31 | 'sources': [
32 | 'SampleForTests.java',
33 | ],
34 | 'variables': {
35 | 'jni_gen_dir': 'base',
36 | },
37 | 'includes': [ '../../../build/jni_generator.gypi' ],
38 | },
39 | {
40 | 'target_name': 'jni_generator_tests',
41 | 'type': 'executable',
42 | 'dependencies': [
43 | '../../base.gyp:test_support_base',
44 | 'jni_generator_py_tests',
45 | 'jni_sample_header',
46 | ],
47 | 'include_dirs': [
48 | '<(SHARED_INTERMEDIATE_DIR)/base',
49 | ],
50 | 'sources': [
51 | 'sample_for_tests.cc',
52 | ],
53 | },
54 | ],
55 | }
56 |
--------------------------------------------------------------------------------
/inc/base/json/string_escape.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | //
5 | // This file defines utility functions for escaping strings.
6 |
7 | #ifndef BASE_JSON_STRING_ESCAPE_H_
8 | #define BASE_JSON_STRING_ESCAPE_H_
9 |
10 | #include
11 |
12 | #include "base/base_export.h"
13 | #include "base/string16.h"
14 |
15 | namespace base {
16 |
17 | // Escape |str| appropriately for a JSON string literal, _appending_ the
18 | // result to |dst|. This will create unicode escape sequences (\uXXXX).
19 | // If |put_in_quotes| is true, the result will be surrounded in double quotes.
20 | // The outputted literal, when interpreted by the browser, should result in a
21 | // javascript string that is identical and the same length as the input |str|.
22 | BASE_EXPORT void JsonDoubleQuote(const std::string& str,
23 | bool put_in_quotes,
24 | std::string* dst);
25 |
26 | // Same as above, but always returns the result double quoted.
27 | BASE_EXPORT std::string GetDoubleQuotedJson(const std::string& str);
28 |
29 | BASE_EXPORT void JsonDoubleQuote(const string16& str,
30 | bool put_in_quotes,
31 | std::string* dst);
32 |
33 | // Same as above, but always returns the result double quoted.
34 | BASE_EXPORT std::string GetDoubleQuotedJson(const string16& str);
35 |
36 | } // namespace base
37 |
38 | #endif // BASE_JSON_STRING_ESCAPE_H_
39 |
--------------------------------------------------------------------------------
/src/webdriver/whitelist.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | whitelist
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | allow or deny
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/Test/WindowWithDeclarativeViewTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef WINDOWWITHDECLARATIVEVIEWTEST_H
21 | #define WINDOWWITHDECLARATIVEVIEWTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | #include
26 |
27 | class WindowWithDeclarativeViewTestWidget : public QWidget
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit WindowWithDeclarativeViewTestWidget(QWidget *parent = 0);
32 | ~WindowWithDeclarativeViewTestWidget();
33 |
34 | public slots:
35 | void loadQML();
36 | void displayStatus();
37 |
38 | private:
39 | QPushButton* pButton;
40 | QLineEdit* pLineEdit;
41 | QLabel *pLabel;
42 | QDeclarativeView *pView;
43 |
44 |
45 | };
46 |
47 | #endif // WINDOWWITHDECLARATIVEVIEWTEST_H
48 |
--------------------------------------------------------------------------------
/src/Test/XPathElementFindingTest.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #ifndef XPATHELEMENTFINDINGTEST_H
21 | #define XPATHELEMENTFINDINGTEST_H
22 |
23 | #include "CommonQtTestHeaders.h"
24 |
25 | class XPathElementFindingTestWidget : public QWidget
26 | {
27 | Q_OBJECT
28 |
29 | private:
30 | QPushButton *ppushBtn;
31 | QTextEdit *ptxtAreaWorking;
32 | QLineEdit *pinputElemWithText;
33 | QLineEdit *pinputElemEmpty;
34 | QLineEdit *pinputElemReadOnly;
35 | QScrollArea *pscrollArea;
36 | QRadioButton *pradioBtn1;
37 | QRadioButton *pradioBtn2;
38 |
39 | public:
40 | explicit XPathElementFindingTestWidget(QWidget *parent = 0);
41 | virtual ~XPathElementFindingTestWidget();
42 |
43 | };
44 |
45 | #endif // XPATHELEMENTFINDINGTEST_H
46 |
--------------------------------------------------------------------------------
/src/webdriver/webdriver_session_manager.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "webdriver_session_manager.h"
6 |
7 | #include "webdriver_session.h"
8 |
9 | namespace webdriver {
10 |
11 | void SessionManager::Add(Session* session) {
12 | base::AutoLock lock(map_lock_);
13 | map_[session->id()] = session;
14 | }
15 |
16 | bool SessionManager::Has(const std::string& id) const {
17 | base::AutoLock lock(map_lock_);
18 | return map_.find(id) != map_.end();
19 | }
20 |
21 | bool SessionManager::Remove(const std::string& id) {
22 | std::map::iterator it;
23 | base::AutoLock lock(map_lock_);
24 | it = map_.find(id);
25 | if (it == map_.end())
26 | return false;
27 | map_.erase(it);
28 | return true;
29 | }
30 |
31 | Session* SessionManager::GetSession(const std::string& id) const {
32 | std::map::const_iterator it;
33 | base::AutoLock lock(map_lock_);
34 | it = map_.find(id);
35 | if (it == map_.end())
36 | return NULL;
37 | return it->second;
38 | }
39 |
40 | std::map SessionManager::GetSessions()
41 | {
42 | base::AutoLock lock(map_lock_);
43 | return map_;
44 | }
45 |
46 | SessionManager::SessionManager() {}
47 |
48 | SessionManager::~SessionManager() {}
49 |
50 | // static
51 | SessionManager* SessionManager::GetInstance() {
52 | return Singleton::get();
53 | }
54 |
55 | } // namespace webdriver
56 |
--------------------------------------------------------------------------------
/src/webdriver/url_command_wrapper.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef WEBDRIVER_COMMANDS_URL_COMMAND_WRAPPER_H_
6 | #define WEBDRIVER_COMMANDS_URL_COMMAND_WRAPPER_H_
7 |
8 | #include
9 | #include
10 |
11 | #include "commands/command.h"
12 |
13 | namespace webdriver {
14 |
15 | class Response;
16 |
17 | class CommandWrapper : public Command {
18 | public:
19 | CommandWrapper(Command* delegate);
20 | virtual ~CommandWrapper();
21 |
22 | virtual bool DoesDelete() const OVERRIDE;
23 | virtual bool DoesGet() const OVERRIDE;
24 | virtual bool DoesPost() const OVERRIDE;
25 | virtual bool Init(Response* const response) OVERRIDE;
26 | virtual void Finish(Response* const response) OVERRIDE;
27 | virtual void ExecuteDelete(Response* const response) OVERRIDE;
28 | virtual void ExecuteGet(Response* const response) OVERRIDE;
29 | virtual void ExecutePost(Response* const response) OVERRIDE;
30 | protected:
31 | scoped_ptr delegate_;
32 |
33 | private:
34 | DISALLOW_COPY_AND_ASSIGN(CommandWrapper);
35 | };
36 |
37 | class UrlCommandWrapper : public CommandWrapper {
38 | public:
39 | UrlCommandWrapper(Command* delegate);
40 | virtual ~UrlCommandWrapper();
41 |
42 | virtual void ExecutePost(Response* const response) OVERRIDE;
43 |
44 | private:
45 | DISALLOW_COPY_AND_ASSIGN(UrlCommandWrapper);
46 | };
47 |
48 | } // namespace webdriver
49 |
50 | #endif // WEBDRIVER_COMMANDS_URL_COMMAND_WRAPPER_H_
51 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/uinput_event_dispatcher.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "build/build_config.h"
21 | #include "extension_qt/uinput_event_dispatcher.h"
22 |
23 | #if defined(OS_LINUX)
24 |
25 | UInputEventDispatcher::UInputEventDispatcher(UInputManager *manager)
26 | : _eventManager(manager)
27 | {
28 | }
29 |
30 | UInputEventDispatcher::~UInputEventDispatcher()
31 | {
32 | }
33 |
34 | bool UInputEventDispatcher::dispatch(QEvent *event, bool consumed)
35 | {
36 | if (consumed)
37 | return false;
38 |
39 | QKeyEvent *keyEvent = dynamic_cast(event);
40 | if(NULL != keyEvent)
41 | {
42 | _eventManager->injectKeyEvent(keyEvent);
43 |
44 | return true;
45 | }
46 |
47 | return false;
48 | }
49 |
50 | #endif // OS_LINUX
51 |
--------------------------------------------------------------------------------
/src/webdriver/extension_qt/declarative_item_view_handle.cc:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | **
3 | ** Copyright © 1992-2014 Cisco and/or its affiliates. All rights reserved.
4 | ** All rights reserved.
5 | **
6 | ** $CISCO_BEGIN_LICENSE:LGPL$
7 | **
8 | ** GNU Lesser General Public License Usage
9 | ** Alternatively, this file may be used under the terms of the GNU Lesser
10 | ** General Public License version 2.1 as published by the Free Software
11 | ** Foundation and appearing in the file LICENSE.LGPL included in the
12 | ** packaging of this file. Please review the following information to
13 | ** ensure the GNU Lesser General Public License version 2.1 requirements
14 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15 | **
16 | ** $CISCO_END_LICENSE$
17 | **
18 | ****************************************************************************/
19 |
20 | #include "extension_qt/declarative_item_view_handle.h"
21 |
22 | namespace webdriver {
23 |
24 | QDeclarativeItemViewHandle::QDeclarativeItemViewHandle()
25 | : view_(NULL), container_(NULL) { }
26 |
27 | QDeclarativeItemViewHandle::QDeclarativeItemViewHandle(QDeclarativeItem* view, QDeclarativeView* container)
28 | : view_(view), container_(container) { }
29 |
30 | bool QDeclarativeItemViewHandle::equals(const ViewHandle* other) const {
31 | const QDeclarativeItemViewHandle* toCompare = dynamic_cast(other);
32 | if (NULL == toCompare) return false;
33 |
34 | return (view_ == toCompare->view_)&&(container_ == toCompare->container_);
35 | }
36 |
37 | } // namespace webdriver
38 |
--------------------------------------------------------------------------------