Commit ad912fc2 authored by brettw's avatar brettw Committed by Commit bot

Add chrome driver to the GN build.

BUG=

Review URL: https://codereview.chromium.org/958743003

Cr-Commit-Position: refs/heads/master@{#318272}
parent 1f47db6e
......@@ -32,7 +32,6 @@ group("gyp_all") {
deps = [
":gn_all",
# "//chrome/test:chromedriver_unittests", # TODO(GYP)
# "//components:components_browsertests", # TODO(GYP)
# "//components/nacl:nacl_loader_unittests", # TODO(GYP)
# "//google_apis:google_apis_unittests", # TODO(GYP)
......@@ -61,6 +60,7 @@ group("gn_all") {
"//chrome/test:interactive_ui_tests",
"//chrome/test:sync_integration_tests",
"//chrome/test:unit_tests",
"//chrome/test/chromedriver:chromedriver_unittests",
"//components:components_unittests",
"//content/shell:content_shell",
"//content/test:content_browsertests",
......@@ -306,7 +306,6 @@ if (is_linux) {
group("linux_default_tests") {
testonly = true
deps = [
# chromedriver_unittests TODO(GYP)
# components_browsertests TODO(GYP)
# device_unittests TODO(GYP)
# nacl_loader_unittests TODO(GYP)
......@@ -317,8 +316,9 @@ if (is_linux) {
"//cc:cc_unittests", # PASSES 2/25/2015
"//chrome/test:browser_tests",
"//chrome/test:interactive_ui_tests",
"//chrome/test:sync_integration_tests", # TODO(GYP) multiple crashes.
"//chrome/test:sync_integration_tests", # Crashes for brettw in GN and GYP.
"//chrome/test:unit_tests", # PASSES 2/25/2015
"//chrome/test/chromedriver:chromedriver_unittests", # PASSES 2/25/2015
"//components:components_unittests", # TODO(GYP) multiple crashes.
"//content/test:content_browsertests",
"//content/test:content_unittests", # PASSES 2/25/2015
......
# 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.
# This file loads the chrome_tests variables which is then shared between
# all BUILD.gn files that need it.
chrome_tests_gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("chrome_tests.gypi") ],
"scope",
[ "chrome_tests.gypi" ])
......@@ -1087,12 +1087,6 @@
'browser/ui/panels/stacked_panel_browsertest.cc',
],
'chrome_automation_client_lib_sources': [
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/embedded_automation_extension.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/embedded_automation_extension.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/js.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/js.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/user_data_dir.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/user_data_dir.h',
'test/chromedriver/chrome/adb.h',
'test/chromedriver/chrome/adb_impl.cc',
'test/chromedriver/chrome/adb_impl.h',
......@@ -1201,8 +1195,6 @@
'chrome_driver_lib_sources': [
'../third_party/webdriver/atoms.cc',
'../third_party/webdriver/atoms.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/version.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/version.h',
'common/chrome_constants.cc',
'common/chrome_constants.h',
'test/chromedriver/alert_commands.cc',
......@@ -1671,6 +1663,7 @@
], # conditions
},
{
# GN version: //chrome/test/chromedriver:automation_client_lib
'target_name': 'automation_client_lib',
'type': 'static_library',
'hard_dependency': 1,
......@@ -1697,9 +1690,16 @@
},
'sources': [
'<@(chrome_automation_client_lib_sources)',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/embedded_automation_extension.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/embedded_automation_extension.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/js.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/js.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/user_data_dir.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/chrome/user_data_dir.h',
],
'actions': [
{
# GN version: //chrome/test/chromedriver:embed_js_in_cpp
'action_name': 'embed_js_in_cpp',
'inputs': [
'test/chromedriver/cpp_source.py',
......@@ -1729,6 +1729,7 @@
'message': 'Generating sources for embedding js in chromedriver',
},
{
# GN version: //chrome/test/chromedriver:embed_user_data_dir_in_cpp
'action_name': 'embed_user_data_dir_in_cpp',
'inputs': [
'test/chromedriver/cpp_source.py',
......@@ -1750,6 +1751,7 @@
'message': 'Generating sources for embedding user data dir in chromedriver',
},
{
# GN version: //chrome/test/chromedriver:embed_extension_in_cpp
'action_name': 'embed_extension_in_cpp',
'inputs': [
'test/chromedriver/cpp_source.py',
......@@ -1775,6 +1777,7 @@
'msvs_disabled_warnings': [ 4267, ],
},
{
# GN version: //chrome/test/chromedriver:lib
'target_name': 'chromedriver_lib',
'type': 'static_library',
'hard_dependency': 1,
......@@ -1796,9 +1799,12 @@
],
'sources': [
'<@(chrome_driver_lib_sources)',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/version.cc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/test/chromedriver/version.h',
],
'actions': [
{
# GN version: //chrome/test/chromedriver:embed_version_in_cpp
'action_name': 'embed_version_in_cpp',
'inputs': [
'test/chromedriver/cpp_source.py',
......@@ -1836,6 +1842,7 @@
'msvs_disabled_warnings': [ 4267, ],
},
{
# GN version: //chrome/test/chromedriver
'target_name': 'chromedriver',
'type': 'executable',
'dependencies': [
......@@ -1851,6 +1858,7 @@
'msvs_disabled_warnings': [ 4267, ],
},
{
# GN version: //chrome/test/chromedriver:chromedriver_unittests
'target_name': 'chromedriver_unittests',
'type': 'executable',
'dependencies': [
......@@ -1876,6 +1884,7 @@
# ChromeDriver tests that aren't run on the main buildbot. Available
# as an optional test type on trybots.
{
# GN version: //chrome/test/chromedriver:chromedriver_tests
'target_name': 'chromedriver_tests',
'type': 'executable',
'dependencies': [
......
......@@ -216,15 +216,13 @@ source_set("test_support_unit") {
}
if (!is_android && (!is_win || link_chrome_on_windows)) {
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../chrome_tests.gypi") ],
"scope",
[ "../chrome_tests.gypi" ])
import("//chrome/chrome_tests.gni")
test("interactive_ui_tests") {
sources = rebase_path(gypi_values.chrome_interactive_ui_test_sources,
".",
"//chrome")
sources =
rebase_path(chrome_tests_gypi_values.chrome_interactive_ui_test_sources,
".",
"//chrome")
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
ldflags = []
......@@ -267,10 +265,10 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
]
if (toolkit_views) {
sources +=
rebase_path(gypi_values.chrome_interactive_ui_test_views_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_interactive_ui_test_views_sources,
".",
"//chrome")
deps += [
"//ui/views",
"//ui/views:test_support",
......@@ -278,7 +276,7 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
]
if (!is_mac) {
sources += rebase_path(
gypi_values.chrome_interactive_ui_test_views_non_mac_sources,
chrome_tests_gypi_values.chrome_interactive_ui_test_views_non_mac_sources,
".",
"//chrome")
}
......@@ -306,16 +304,16 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
} else {
# Everything but desktop Linux.
sources += rebase_path(
gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources,
chrome_tests_gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources,
".",
"//chrome")
}
if (is_chromeos) {
sources +=
rebase_path(gypi_values.chrome_interactive_ui_test_chromeos_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_interactive_ui_test_chromeos_sources,
".",
"//chrome")
sources += [ "../browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc" ]
sources -= [
# Use only the _chromeos version on ChromeOS.
......@@ -344,15 +342,15 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
}
} else {
# ChromeOS doesn't use panels, everybody else does.
sources +=
rebase_path(gypi_values.chrome_interactive_ui_test_panels_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_interactive_ui_test_panels_sources,
".",
"//chrome")
# TODO(tapted): Include on mac when views panels are ported.
if (toolkit_views && !is_mac) {
sources += rebase_path(
gypi_values.chrome_interactive_ui_test_panels_views_sources,
chrome_tests_gypi_values.chrome_interactive_ui_test_panels_views_sources,
".",
"//chrome")
}
......@@ -361,15 +359,16 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
if (!is_linux) {
# Non-Linux platforms (Linux includes ChromeOS here).
sources += rebase_path(
gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources,
chrome_tests_gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources,
".",
"//chrome")
}
if (is_win) {
sources += rebase_path(gypi_values.chrome_interactive_ui_test_win_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_interactive_ui_test_win_sources,
".",
"//chrome")
sources += [ "$root_gen_dir/chrome/other_version.rc" ]
deps += [
"//chrome:chrome_version_resources",
......@@ -400,22 +399,23 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
}
if (enable_app_list) {
sources +=
rebase_path(gypi_values.chrome_interactive_ui_test_app_list_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_interactive_ui_test_app_list_sources,
".",
"//chrome")
}
if (use_ash) {
sources += rebase_path(gypi_values.chrome_interactive_ui_test_ash_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_interactive_ui_test_ash_sources,
".",
"//chrome")
deps += [ "//ash:test_support" ]
}
if (enable_notifications) {
sources += rebase_path(
gypi_values.chrome_interactive_ui_test_notifications_sources,
chrome_tests_gypi_values.chrome_interactive_ui_test_notifications_sources,
".",
"//chrome")
......@@ -448,9 +448,10 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
source_set("sync_integration_test_support") {
testonly = true
sources = rebase_path(gypi_values.test_support_sync_integration_sources,
".",
"//chrome")
sources = rebase_path(
chrome_tests_gypi_values.test_support_sync_integration_sources,
".",
"//chrome")
public_deps = [
"//chrome/browser",
]
......@@ -567,9 +568,10 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
}
js2webui("browser_tests_js_webui") {
sources = rebase_path(gypi_values.chrome_browser_tests_webui_js_sources,
".",
"//chrome")
sources = rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_webui_js_sources,
".",
"//chrome")
if (is_chrome_branded) {
# crbug.com/230471
sources -= [ "data/webui/accessibility_audit_browsertest.js" ]
......@@ -598,11 +600,13 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
"base/browser_tests_main.cc",
]
sources +=
rebase_path(gypi_values.chrome_browser_tests_sources, ".", "//chrome")
sources +=
rebase_path(gypi_values.chrome_browser_extensions_test_support_sources,
rebase_path(chrome_tests_gypi_values.chrome_browser_tests_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_extensions_test_support_sources,
".",
"//chrome")
deps = [
":sync_integration_test_support",
......@@ -757,21 +761,23 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
deps += [ "//ui/events:test_support" ]
}
if (toolkit_views) {
sources += rebase_path(gypi_values.chrome_browser_tests_views_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_views_sources,
".",
"//chrome")
deps += [ "//ui/views" ]
if (!is_mac) {
sources +=
rebase_path(gypi_values.chrome_browser_tests_views_non_mac_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_views_non_mac_sources,
".",
"//chrome")
}
}
if (is_chromeos) {
sources += rebase_path(gypi_values.chrome_browser_tests_chromeos_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_chromeos_sources,
".",
"//chrome")
sources -= [
"../../apps/load_and_launch_browsertest.cc",
"../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
......@@ -808,18 +814,20 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
}
}
if (enable_configuration_policy) {
sources += rebase_path(gypi_values.chrome_browser_tests_policy_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_policy_sources,
".",
"//chrome")
}
if (enable_web_speech) {
sources += rebase_path(gypi_values.chrome_browser_tests_speech_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_speech_sources,
".",
"//chrome")
}
if (safe_browsing_mode == 1) {
sources += rebase_path(
gypi_values.chrome_browser_tests_full_safe_browsing_sources,
chrome_tests_gypi_values.chrome_browser_tests_full_safe_browsing_sources,
".",
"//chrome")
defines += [ "FULL_SAFE_BROWSING" ]
......@@ -950,15 +958,16 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
]
}
if (enable_app_list) {
sources += rebase_path(gypi_values.chrome_browser_tests_app_list_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_app_list_sources,
".",
"//chrome")
}
if (enable_supervised_users) {
sources +=
rebase_path(gypi_values.chrome_browser_tests_supervised_user_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_supervised_user_sources,
".",
"//chrome")
}
if (enable_pepper_cdms) {
# Runtime dependencies.
......@@ -1009,9 +1018,10 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
]
}
if (enable_remoting) {
sources += rebase_path(gypi_values.chrome_browser_tests_remoting_sources,
".",
"//chrome")
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_remoting_sources,
".",
"//chrome")
#deps += [ "//remoting:remoting_webapp" ] TODO(GYP)
}
if (use_x11) {
......@@ -1021,7 +1031,9 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
test("sync_integration_tests") {
sources =
rebase_path(gypi_values.sync_integration_tests_sources, ".", "//chrome")
rebase_path(chrome_tests_gypi_values.sync_integration_tests_sources,
".",
"//chrome")
# TODO(phajdan.jr): Only temporary, to make transition easier.
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
......@@ -1099,7 +1111,9 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
test("sync_performance_tests") {
sources =
rebase_path(gypi_values.sync_performance_tests_sources, ".", "//chrome")
rebase_path(chrome_tests_gypi_values.sync_performance_tests_sources,
".",
"//chrome")
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
......
# 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/ui.gni")
import("//chrome/chrome_tests.gni")
import("//testing/test.gni")
# GYP version: chrome/chrome_tests.gypi:automation_client_lib
# (embed_js_in_cpp action)
action("embed_js_in_cpp") {
script = "embed_js_in_cpp.py"
js_files = [
"js/add_cookie.js",
"js/call_function.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)
}
# GYP version: chrome/chrome_tests.gypi:automation_client_lib
# (embed_user_data_dir_in_cpp action)
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)
}
# GYP version: chrome/chrome_tests.gypi:automation_client_lib
# (embed_extension_in_cpp action)
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)
}
# GYP version: chrome/chrome_tests.gypi:automation_client_lib
source_set("automation_client_lib") {
sources =
rebase_path(chrome_tests_gypi_values.chrome_automation_client_lib_sources,
".",
"//chrome")
# 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_js_in_cpp",
":embed_user_data_dir_in_cpp",
"//base",
"//base/third_party/dynamic_annotations",
"//net",
"//third_party/zlib:zip",
"//third_party/zlib:minizip",
"//ui/accessibility:ax_gen",
"//ui/base",
"//ui/gfx",
"//ui/gfx/geometry",
"//url",
]
}
# GYP version: chrome/chrome_tests.gypi:chromedriver_lib
# (embed_version_in_cpp action)
action("embed_version_in_cpp") {
script = "embed_version_in_cpp.py"
inputs = [
"cpp_source.py",
"VERSION",
]
outputs = [
"$target_gen_dir/version.cc",
"$target_gen_dir/version.h",
]
args = [
"--version-file",
rebase_path("VERSION", root_build_dir),
"--directory",
rebase_path(target_gen_dir, root_build_dir),
]
}
# GYP version: chrome/chrome_tests.gypi:chromedriver_lib
source_set("lib") {
sources = rebase_path(chrome_tests_gypi_values.chrome_driver_lib_sources,
".",
"//chrome")
# Also compile the generated version files.
sources += get_target_outputs(":embed_version_in_cpp")
# These aren't automatically filtered out.
if (!use_x11) {
sources -= [ "keycode_text_conversion_x.cc" ]
}
if (!use_ozone) {
sources -= [ "keycode_text_conversion_ozone.cc" ]
}
deps = [
":automation_client_lib",
":embed_version_in_cpp",
"//base",
"//base/third_party/dynamic_annotations",
"//crypto",
"//net",
"//net:http_server",
"//third_party/zlib",
"//ui/base",
"//ui/events:events_base",
"//ui/gfx",
"//ui/gfx/geometry",
]
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
deps += [ "//ui/gfx/x" ]
}
}
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",
]
}
test("chromedriver_unittests") {
sources =
rebase_path(chrome_tests_gypi_values.chrome_driver_unittests_sources,
".",
"//chrome")
# 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:http_server",
"//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 = rebase_path(chrome_tests_gypi_values.chrome_driver_tests_sources,
".",
"//chrome")
# 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:http_server",
"//net:test_support",
"//testing/gtest",
"//url",
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment