mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-25 06:46:09 +03:00
450 lines
12 KiB
Plaintext
450 lines
12 KiB
Plaintext
|
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||
|
# Use of this source code is governed by a BSD-style license that can be
|
||
|
# found in the LICENSE file.
|
||
|
|
||
|
import("//build/config/python.gni")
|
||
|
import("//build/config/ui.gni")
|
||
|
import("//build/util/lastchange.gni")
|
||
|
import("//testing/test.gni")
|
||
|
|
||
|
action("embed_js_in_cpp") {
|
||
|
script = "embed_js_in_cpp.py"
|
||
|
|
||
|
js_files = [
|
||
|
"js/call_function.js",
|
||
|
"js/dispatch_touch_event.js",
|
||
|
"js/execute_async_script.js",
|
||
|
"js/focus.js",
|
||
|
"js/get_element_region.js",
|
||
|
"js/is_option_element_toggleable.js",
|
||
|
]
|
||
|
|
||
|
inputs = [ "cpp_source.py" ] + js_files
|
||
|
|
||
|
outputs = [
|
||
|
"$target_gen_dir/chrome/js.cc",
|
||
|
"$target_gen_dir/chrome/js.h",
|
||
|
]
|
||
|
args = [
|
||
|
"--directory",
|
||
|
rebase_path("$target_gen_dir/chrome", root_build_dir),
|
||
|
]
|
||
|
args += rebase_path(js_files, root_build_dir)
|
||
|
}
|
||
|
|
||
|
action("embed_user_data_dir_in_cpp") {
|
||
|
script = "embed_user_data_dir_in_cpp.py"
|
||
|
|
||
|
files = [
|
||
|
"chrome/preferences.txt",
|
||
|
"chrome/local_state.txt",
|
||
|
]
|
||
|
|
||
|
inputs = [ "cpp_source.py" ] + files
|
||
|
outputs = [
|
||
|
"$target_gen_dir/chrome/user_data_dir.cc",
|
||
|
"$target_gen_dir/chrome/user_data_dir.h",
|
||
|
]
|
||
|
|
||
|
args = [
|
||
|
"--directory",
|
||
|
rebase_path("$target_gen_dir/chrome", root_build_dir),
|
||
|
]
|
||
|
args += rebase_path(files, root_build_dir)
|
||
|
}
|
||
|
|
||
|
action("embed_extension_in_cpp") {
|
||
|
script = "embed_extension_in_cpp.py"
|
||
|
|
||
|
files = [
|
||
|
"extension/background.js",
|
||
|
"extension/manifest.json",
|
||
|
]
|
||
|
|
||
|
inputs = [ "cpp_source.py" ] + files
|
||
|
outputs = [
|
||
|
"$target_gen_dir/chrome/embedded_automation_extension.cc",
|
||
|
"$target_gen_dir/chrome/embedded_automation_extension.h",
|
||
|
]
|
||
|
|
||
|
args = [
|
||
|
"--directory",
|
||
|
rebase_path("$target_gen_dir/chrome", root_build_dir),
|
||
|
]
|
||
|
args += rebase_path(files, root_build_dir)
|
||
|
}
|
||
|
|
||
|
source_set("automation_client_lib") {
|
||
|
sources = [
|
||
|
"chrome/adb.h",
|
||
|
"chrome/adb_impl.cc",
|
||
|
"chrome/adb_impl.h",
|
||
|
"chrome/automation_extension.cc",
|
||
|
"chrome/automation_extension.h",
|
||
|
"chrome/chrome.h",
|
||
|
"chrome/chrome_android_impl.cc",
|
||
|
"chrome/chrome_android_impl.h",
|
||
|
"chrome/chrome_desktop_impl.cc",
|
||
|
"chrome/chrome_desktop_impl.h",
|
||
|
"chrome/chrome_finder.cc",
|
||
|
"chrome/chrome_finder.h",
|
||
|
"chrome/chrome_finder_mac.mm",
|
||
|
"chrome/chrome_impl.cc",
|
||
|
"chrome/chrome_impl.h",
|
||
|
"chrome/chrome_remote_impl.cc",
|
||
|
"chrome/chrome_remote_impl.h",
|
||
|
"chrome/console_logger.cc",
|
||
|
"chrome/console_logger.h",
|
||
|
"chrome/debugger_tracker.cc",
|
||
|
"chrome/debugger_tracker.h",
|
||
|
"chrome/device_manager.cc",
|
||
|
"chrome/device_manager.h",
|
||
|
"chrome/device_metrics.cc",
|
||
|
"chrome/device_metrics.h",
|
||
|
"chrome/devtools_client.h",
|
||
|
"chrome/devtools_client_impl.cc",
|
||
|
"chrome/devtools_client_impl.h",
|
||
|
"chrome/devtools_event_listener.cc",
|
||
|
"chrome/devtools_event_listener.h",
|
||
|
"chrome/devtools_http_client.cc",
|
||
|
"chrome/devtools_http_client.h",
|
||
|
"chrome/dom_tracker.cc",
|
||
|
"chrome/dom_tracker.h",
|
||
|
"chrome/frame_tracker.cc",
|
||
|
"chrome/frame_tracker.h",
|
||
|
"chrome/geolocation_override_manager.cc",
|
||
|
"chrome/geolocation_override_manager.h",
|
||
|
"chrome/geoposition.h",
|
||
|
"chrome/heap_snapshot_taker.cc",
|
||
|
"chrome/heap_snapshot_taker.h",
|
||
|
"chrome/javascript_dialog_manager.cc",
|
||
|
"chrome/javascript_dialog_manager.h",
|
||
|
"chrome/log.cc",
|
||
|
"chrome/log.h",
|
||
|
"chrome/mobile_device.cc",
|
||
|
"chrome/mobile_device.h",
|
||
|
"chrome/mobile_device_list.cc",
|
||
|
"chrome/mobile_device_list.h",
|
||
|
"chrome/mobile_emulation_override_manager.cc",
|
||
|
"chrome/mobile_emulation_override_manager.h",
|
||
|
"chrome/navigation_tracker.cc",
|
||
|
"chrome/navigation_tracker.h",
|
||
|
"chrome/network_conditions.cc",
|
||
|
"chrome/network_conditions.h",
|
||
|
"chrome/network_conditions_override_manager.cc",
|
||
|
"chrome/network_conditions_override_manager.h",
|
||
|
"chrome/network_list.cc",
|
||
|
"chrome/network_list.h",
|
||
|
"chrome/non_blocking_navigation_tracker.cc",
|
||
|
"chrome/non_blocking_navigation_tracker.h",
|
||
|
"chrome/page_load_strategy.cc",
|
||
|
"chrome/page_load_strategy.h",
|
||
|
"chrome/status.cc",
|
||
|
"chrome/status.h",
|
||
|
"chrome/ui_events.cc",
|
||
|
"chrome/ui_events.h",
|
||
|
"chrome/util.cc",
|
||
|
"chrome/util.h",
|
||
|
"chrome/version.cc",
|
||
|
"chrome/version.h",
|
||
|
"chrome/web_view.h",
|
||
|
"chrome/web_view_impl.cc",
|
||
|
"chrome/web_view_impl.h",
|
||
|
"net/adb_client_socket.cc",
|
||
|
"net/adb_client_socket.h",
|
||
|
"net/net_util.cc",
|
||
|
"net/net_util.h",
|
||
|
"net/sync_websocket.h",
|
||
|
"net/sync_websocket_factory.cc",
|
||
|
"net/sync_websocket_factory.h",
|
||
|
"net/sync_websocket_impl.cc",
|
||
|
"net/sync_websocket_impl.h",
|
||
|
"net/timeout.cc",
|
||
|
"net/timeout.h",
|
||
|
"net/url_request_context_getter.cc",
|
||
|
"net/url_request_context_getter.h",
|
||
|
"net/websocket.cc",
|
||
|
"net/websocket.h",
|
||
|
]
|
||
|
|
||
|
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
|
||
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||
|
|
||
|
# Also compile the generated files.
|
||
|
sources += get_target_outputs(":embed_extension_in_cpp")
|
||
|
sources += get_target_outputs(":embed_js_in_cpp")
|
||
|
sources += get_target_outputs(":embed_user_data_dir_in_cpp")
|
||
|
|
||
|
deps = [
|
||
|
":embed_extension_in_cpp",
|
||
|
":embed_js_in_cpp",
|
||
|
":embed_user_data_dir_in_cpp",
|
||
|
"//base",
|
||
|
"//base/third_party/dynamic_annotations",
|
||
|
"//net",
|
||
|
"//third_party/blink/public:buildflags",
|
||
|
"//third_party/zlib:minizip",
|
||
|
"//third_party/zlib/google:zip",
|
||
|
"//ui/accessibility:ax_enums_mojo",
|
||
|
"//ui/base",
|
||
|
"//ui/gfx",
|
||
|
"//ui/gfx/geometry",
|
||
|
"//url",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
action("embed_version_in_cpp") {
|
||
|
script = "embed_version_in_cpp.py"
|
||
|
inputs = [
|
||
|
"cpp_source.py",
|
||
|
"VERSION",
|
||
|
"//chrome/VERSION",
|
||
|
|
||
|
# We don't actually use LASTCHANGE as an input file. It is updated
|
||
|
# whenever a different Git revision is checked out, at which point
|
||
|
# version.cc needs to be updated with the new revision info.
|
||
|
lastchange_file,
|
||
|
]
|
||
|
outputs = [
|
||
|
"$target_gen_dir/version.cc",
|
||
|
"$target_gen_dir/version.h",
|
||
|
]
|
||
|
|
||
|
args = [
|
||
|
"--chromedriver-version-file",
|
||
|
rebase_path("VERSION", root_build_dir),
|
||
|
"--chrome-version-file",
|
||
|
rebase_path("//chrome/VERSION", root_build_dir),
|
||
|
"--directory",
|
||
|
rebase_path(target_gen_dir, root_build_dir),
|
||
|
]
|
||
|
}
|
||
|
|
||
|
source_set("lib") {
|
||
|
sources = [
|
||
|
"//third_party/webdriver/atoms.cc",
|
||
|
"//third_party/webdriver/atoms.h",
|
||
|
"alert_commands.cc",
|
||
|
"alert_commands.h",
|
||
|
"basic_types.cc",
|
||
|
"basic_types.h",
|
||
|
"capabilities.cc",
|
||
|
"capabilities.h",
|
||
|
"chrome/browser_info.cc",
|
||
|
"chrome/browser_info.h",
|
||
|
"chrome/scoped_temp_dir_with_retry.cc",
|
||
|
"chrome/scoped_temp_dir_with_retry.h",
|
||
|
"chrome_launcher.cc",
|
||
|
"chrome_launcher.h",
|
||
|
"command.h",
|
||
|
"command_listener.h",
|
||
|
"command_listener_proxy.cc",
|
||
|
"command_listener_proxy.h",
|
||
|
"commands.cc",
|
||
|
"commands.h",
|
||
|
"devtools_events_logger.cc",
|
||
|
"devtools_events_logger.h",
|
||
|
"element_commands.cc",
|
||
|
"element_commands.h",
|
||
|
"element_util.cc",
|
||
|
"element_util.h",
|
||
|
"key_converter.cc",
|
||
|
"key_converter.h",
|
||
|
"keycode_text_conversion.h",
|
||
|
"keycode_text_conversion_mac.mm",
|
||
|
"keycode_text_conversion_win.cc",
|
||
|
"logging.cc",
|
||
|
"logging.h",
|
||
|
"performance_logger.cc",
|
||
|
"performance_logger.h",
|
||
|
"server/http_handler.cc",
|
||
|
"server/http_handler.h",
|
||
|
"session.cc",
|
||
|
"session.h",
|
||
|
"session_commands.cc",
|
||
|
"session_commands.h",
|
||
|
"session_thread_map.h",
|
||
|
"util.cc",
|
||
|
"util.h",
|
||
|
"window_commands.cc",
|
||
|
"window_commands.h",
|
||
|
]
|
||
|
|
||
|
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
|
||
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||
|
|
||
|
# Also compile the generated version files.
|
||
|
sources += get_target_outputs(":embed_version_in_cpp")
|
||
|
|
||
|
if (use_x11) {
|
||
|
sources += [ "keycode_text_conversion_x.cc" ]
|
||
|
}
|
||
|
|
||
|
# The X11 implementation uses part of Ozone implementation.
|
||
|
if (use_ozone || use_x11) {
|
||
|
sources += [ "keycode_text_conversion_ozone.cc" ]
|
||
|
}
|
||
|
|
||
|
deps = [
|
||
|
":automation_client_lib",
|
||
|
":embed_version_in_cpp",
|
||
|
"//base",
|
||
|
"//base/third_party/dynamic_annotations",
|
||
|
"//chrome/common:constants",
|
||
|
"//chrome/common:version_header",
|
||
|
"//crypto",
|
||
|
"//net",
|
||
|
"//net/server:http_server",
|
||
|
"//third_party/zlib",
|
||
|
"//ui/base",
|
||
|
"//ui/events:dom_keycode_converter",
|
||
|
"//ui/events:events_base",
|
||
|
"//ui/events/ozone:events_ozone_layout",
|
||
|
"//ui/gfx",
|
||
|
"//ui/gfx/geometry",
|
||
|
]
|
||
|
|
||
|
if (use_x11) {
|
||
|
configs += [ "//build/config/linux:x11" ]
|
||
|
deps += [ "//ui/gfx/x" ]
|
||
|
}
|
||
|
|
||
|
if (is_mac) {
|
||
|
libs = [ "Carbon.framework" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
executable("chromedriver") {
|
||
|
sources = [
|
||
|
"server/chromedriver_server.cc",
|
||
|
]
|
||
|
|
||
|
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
|
||
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||
|
|
||
|
deps = [
|
||
|
":lib",
|
||
|
"//build/win:default_exe_manifest",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
python_library("chromedriver_py_tests") {
|
||
|
testonly = true
|
||
|
deps = [
|
||
|
":chromedriver",
|
||
|
"//chrome:chrome",
|
||
|
]
|
||
|
|
||
|
pydeps_file = "test/run_py_tests.pydeps"
|
||
|
data = [
|
||
|
"//chrome/test/data/chromedriver/",
|
||
|
"//testing/scripts/run_chromedriver_tests.py",
|
||
|
"//testing/scripts/common.py",
|
||
|
"//testing/xvfb.py",
|
||
|
]
|
||
|
|
||
|
data_deps = [
|
||
|
"//chrome/test/chromedriver",
|
||
|
]
|
||
|
if (is_component_build && is_mac) {
|
||
|
data_deps += [ "//chrome:chrome_framework" ]
|
||
|
}
|
||
|
|
||
|
if (is_win) {
|
||
|
# On Windows, the following target produces the final chrome.exe
|
||
|
data_deps += [ "//chrome:reorder_imports" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
test("chromedriver_unittests") {
|
||
|
sources = [
|
||
|
"capabilities_unittest.cc",
|
||
|
"chrome/browser_info_unittest.cc",
|
||
|
"chrome/chrome_finder_unittest.cc",
|
||
|
"chrome/console_logger_unittest.cc",
|
||
|
"chrome/device_manager_unittest.cc",
|
||
|
"chrome/devtools_client_impl_unittest.cc",
|
||
|
"chrome/devtools_http_client_unittest.cc",
|
||
|
"chrome/dom_tracker_unittest.cc",
|
||
|
"chrome/frame_tracker_unittest.cc",
|
||
|
"chrome/geolocation_override_manager_unittest.cc",
|
||
|
"chrome/heap_snapshot_taker_unittest.cc",
|
||
|
"chrome/javascript_dialog_manager_unittest.cc",
|
||
|
"chrome/mobile_emulation_override_manager_unittest.cc",
|
||
|
"chrome/navigation_tracker_unittest.cc",
|
||
|
"chrome/network_conditions_override_manager_unittest.cc",
|
||
|
"chrome/recorder_devtools_client.cc",
|
||
|
"chrome/recorder_devtools_client.h",
|
||
|
"chrome/status_unittest.cc",
|
||
|
"chrome/stub_chrome.cc",
|
||
|
"chrome/stub_chrome.h",
|
||
|
"chrome/stub_devtools_client.cc",
|
||
|
"chrome/stub_devtools_client.h",
|
||
|
"chrome/stub_web_view.cc",
|
||
|
"chrome/stub_web_view.h",
|
||
|
"chrome/web_view_impl_unittest.cc",
|
||
|
"chrome_launcher_unittest.cc",
|
||
|
"command_listener_proxy_unittest.cc",
|
||
|
"commands_unittest.cc",
|
||
|
"logging_unittest.cc",
|
||
|
"net/adb_client_socket_unittest.cc",
|
||
|
"net/timeout_unittest.cc",
|
||
|
"performance_logger_unittest.cc",
|
||
|
"server/http_handler_unittest.cc",
|
||
|
"session_commands_unittest.cc",
|
||
|
"session_unittest.cc",
|
||
|
"util_unittest.cc",
|
||
|
"window_commands_unittest.cc",
|
||
|
]
|
||
|
|
||
|
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
|
||
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||
|
|
||
|
data = [
|
||
|
"//chrome/test/data/chromedriver/",
|
||
|
]
|
||
|
|
||
|
deps = [
|
||
|
":lib",
|
||
|
"//base",
|
||
|
"//base/test:run_all_unittests",
|
||
|
"//net",
|
||
|
"//net:test_support",
|
||
|
"//net/server:http_server",
|
||
|
"//testing/gmock",
|
||
|
"//testing/gtest",
|
||
|
"//ui/base",
|
||
|
"//ui/gfx",
|
||
|
"//ui/gfx/geometry",
|
||
|
]
|
||
|
}
|
||
|
|
||
|
# ChromeDriver tests that aren't run on the main buildbot. Available as an
|
||
|
# optional test type on trybots.
|
||
|
test("chromedriver_tests") {
|
||
|
sources = [
|
||
|
"key_converter_unittest.cc",
|
||
|
"keycode_text_conversion_unittest.cc",
|
||
|
"net/net_util_unittest.cc",
|
||
|
"net/sync_websocket_impl_unittest.cc",
|
||
|
"net/test_http_server.cc",
|
||
|
"net/test_http_server.h",
|
||
|
"net/websocket_unittest.cc",
|
||
|
]
|
||
|
|
||
|
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
|
||
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||
|
|
||
|
deps = [
|
||
|
":lib",
|
||
|
"//base",
|
||
|
"//base/test:run_all_unittests",
|
||
|
"//net",
|
||
|
"//net:test_support",
|
||
|
"//net/server:http_server",
|
||
|
"//testing/gtest",
|
||
|
"//ui/events:test_support",
|
||
|
"//url",
|
||
|
]
|
||
|
}
|