From 610288e581b8584066c6e0f23d57e02515c9333c Mon Sep 17 00:00:00 2001 From: jam Date: Thu, 5 Mar 2015 14:05:18 -0800 Subject: [PATCH] Fix more GN browser_tests on Linux: ExtensionResourceRequestPolicyTest.ExtensionAccessibleResources InspectUITest.AndroidTargets InspectUITest.InspectUIPage InspectUITest.ReloadCrash InspectUITest.SharedWorker LocalDiscoveryUITest.AddRowTest LocalDiscoveryUITest.EmptyTest LocalDiscoveryUITest.RegisterTest PasswordManagerInternalsWebUIBrowserTest.LogSavePasswordProgress PasswordManagerInternalsWebUIBrowserTest.LogSavePasswordProgress_FlushedOnReload PasswordManagerInternalsWebUIBrowserTest.LogSavePasswordProgress_MultipleTabsIdentical PasswordManagerInternalsWebUIBrowserTest.LogSavePasswordProgress_NavigateAway PasswordManagerInternalsWebUIBrowserTest.LogSavePasswordProgress_NotFlushedOnReloadIfMultiple PortForwardingTest.LoadPageWithStyleAnsScript WebUIBrowserAsyncTest.TestAsyncDoneFailFirstSyncPass WebUIBrowserAsyncTest.TestAsyncFailsAssert WebUIBrowserAsyncTest.TestAsyncFailsExpect WebUIBrowserAsyncTest.TestAsyncPassPass WebUIBrowserAsyncTest.TestAsyncPassThenFail WebUIBrowserAsyncTest.TestAsyncPasses WebUIBrowserAsyncTest.TestSyncOkTestFail WebUIBrowserAsyncTest.TestSyncPasses WebUIBrowserAsyncTest.TestTestDoneEarlyPasses WebUIBrowserAsyncTest.TestTestDoneEarlyPassesAsync WebUIBrowserExpectFailTest.TestFailsAsyncFast WebUIBrowserExpectFailTest.TestFailsFast WebUIBrowserExpectFailTest.TestRuntimeErrorFailsFast BUG=463180 Review URL: https://codereview.chromium.org/976133002 Cr-Commit-Position: refs/heads/master@{#319337} --- chrome/browser/chromeos/BUILD.gn | 2 +- chrome/browser/ui/BUILD.gn | 2 +- .../chromeos/accounts_options_browsertest.js | 2 +- .../chromeos/date_time_options_browsertest.js | 2 +- chrome/test/BUILD.gn | 177 ++++++++++----------- 5 files changed, 88 insertions(+), 97 deletions(-) diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index ddbb0ad5c24c..0436a7b04a69 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn @@ -10,7 +10,7 @@ import("//third_party/protobuf/proto_library.gni") gypi_values = exec_script("//build/gypi_to_gn.py", [ rebase_path("../../chrome_browser_chromeos.gypi") ], "scope", - [ "chrome_browser_chromeos.gypi" ]) + [ "../../chrome_browser_chromeos.gypi" ]) source_set("chromeos") { assert(enable_extensions, "ChromeOS Chrome has to be built with extensions") diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 47f303997de7..585bf4bf320e 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn @@ -30,6 +30,7 @@ static_library("ui") { # browser, then we can clean up these dependencies. public_deps = [ "//components/dom_distiller/core", + "//content/public/browser", "//sync", ] deps = [ @@ -55,7 +56,6 @@ static_library("ui") { "//components/resources", "//components/strings", "//components/update_client", - "//content/public/browser", "//content/public/common", "//crypto", "//skia", diff --git a/chrome/browser/ui/webui/options/chromeos/accounts_options_browsertest.js b/chrome/browser/ui/webui/options/chromeos/accounts_options_browsertest.js index 838d6d0a125f..1b00b9827fd7 100644 --- a/chrome/browser/ui/webui/options/chromeos/accounts_options_browsertest.js +++ b/chrome/browser/ui/webui/options/chromeos/accounts_options_browsertest.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -GEN_INCLUDE(['chrome/browser/ui/webui/options/options_browsertest_base.js']); +GEN_INCLUDE(['../options_browsertest_base.js']); function AccountsOptionsWebUITest() {} diff --git a/chrome/browser/ui/webui/options/chromeos/date_time_options_browsertest.js b/chrome/browser/ui/webui/options/chromeos/date_time_options_browsertest.js index 40335996828b..4f0845beb378 100644 --- a/chrome/browser/ui/webui/options/chromeos/date_time_options_browsertest.js +++ b/chrome/browser/ui/webui/options/chromeos/date_time_options_browsertest.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -GEN_INCLUDE(['chrome/browser/ui/webui/options/options_browsertest_base.js']); +GEN_INCLUDE(['../options_browsertest_base.js']); GEN('#if defined(OS_CHROMEOS)'); diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c1a7a2a09b82..480a9e079652 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -490,110 +490,102 @@ if (!is_android) { } } - # TODO(GYP) when v8's GN build supports "//v8:d8" then enable the code - # controlled by this flag (and the flg itself can be deleted). - has_d8_definition = false - - if (has_d8_definition) { - template("js2webui") { - action_name = target_name + "_action" - source_set_name = target_name - - action_foreach(action_name) { - testonly = true - visibility = [ ":$source_set_name" ] - script = "//tools/gypv8sh.py" - - sources = invoker.sources - - d8_path = - get_label_info("//v8:d8($host_toolchain)", "root_out_dir") + "/d8" - if (is_win) { - d8_path += ".exe" - } - - input_js = [ - "//chrome/third_party/mock4js/mock4js.js", - "//chrome/test/data/webui/test_api.js", - "//chrome/test/base/js2gtest.js", - ] - inputs = [ d8_path ] + input_js + template("js2webui") { + action_name = target_name + "_action" + source_set_name = target_name - outputs = [ - "$target_gen_dir/{{source_name_part}}-gen.cc", - "$root_out_dir/test_data/chrome/{{source_root_relative_dir}}/{{source_file_part}}", - ] + action_foreach(action_name) { + testonly = true + visibility = [ ":$source_set_name" ] + script = "//tools/gypv8sh.py" - args = [ - # Need "./" for script to find binary (cur dir is not on path). - "./" + rebase_path(d8_path, root_build_dir), - ] - args += rebase_path(input_js, root_build_dir) + [ "webui" ] - if (v8_use_external_startup_data) { - args += [ "--external=y" ] - } else { - args += [ "--external=n" ] - } - args += [ - "{{source}}", - "{{source_root_relative_dir}}/{{source_file_part}}", - ] - args += rebase_path(outputs, root_build_dir) + sources = invoker.sources - deps = [ - "//v8:d8($host_toolchain)", - ] + d8_path = + get_label_info("//v8:d8($host_toolchain)", "root_out_dir") + "/d8" + if (is_win) { + d8_path += ".exe" } - source_set(source_set_name) { - testonly = true - if (defined(invoker.visibility)) { - visibility = invoker.visibility - } - sources = get_target_outputs(":$action_name") - defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] - deps = [ - ":$action_name", - - # The generator implicitly makes includes from these targets. - "//testing/gmock", - "//testing/gtest", - "//url", - ] - if (defined(invoker.deps)) { - deps += invoker.deps - } + input_js = [ + "//chrome/third_party/mock4js/mock4js.js", + "//chrome/test/data/webui/test_api.js", + "//chrome/test/base/js2gtest.js", + ] + inputs = [ d8_path ] + input_js + + outputs = [ + "$target_gen_dir/{{source_name_part}}-gen.cc", + "$root_out_dir/test_data/chrome/{{source_root_relative_dir}}/{{source_file_part}}", + ] + + args = [ + # Need "./" for script to find binary (cur dir is not on path). + "./" + rebase_path(d8_path, root_build_dir), + ] + args += rebase_path(input_js, root_build_dir) + [ "webui" ] + if (v8_use_external_startup_data) { + args += [ "--external=y" ] + } else { + args += [ "--external=n" ] } + args += [ + "{{source}}", + "{{source_root_relative_dir}}/{{source_file_part}}", + ] + args += rebase_path(outputs, root_build_dir) + + deps = [ + "//v8:d8($host_toolchain)", + ] } - js2webui("browser_tests_js_webui") { - 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" ] - } - if (!is_chromeos) { - sources -= [ - "data/webui/certificate_viewer_dialog_test.js", - "test/data/chromeos/oobe_webui_browsertest.js", - ] - } - if (!enable_app_list) { - sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ] - } - if (!enable_supervised_users) { - sources -= - [ "../browser/ui/webui/downloads_ui_supervised_browsertest.js" ] + source_set(source_set_name) { + testonly = true + if (defined(invoker.visibility)) { + visibility = invoker.visibility } + sources = get_target_outputs(":$action_name") + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] deps = [ - "//skia", + ":$action_name", + + # The generator implicitly makes includes from these targets. + "//testing/gmock", + "//testing/gtest", + "//url", ] + if (defined(invoker.deps)) { + deps += invoker.deps + } } } + js2webui("browser_tests_js_webui") { + 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" ] + } + if (!is_chromeos) { + sources -= [ "data/webui/certificate_viewer_dialog_test.js" ] + } + if (!enable_app_list) { + sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ] + } + if (!enable_supervised_users) { + sources -= + [ "../browser/ui/webui/downloads_ui_supervised_browsertest.js" ] + } + deps = [ + "//chrome/browser/ui", + "//skia", + ] + } + test("browser_tests") { sources = [ "base/browser_tests_main.cc", @@ -608,6 +600,7 @@ if (!is_android) { "//chrome") deps = [ + ":browser_tests_js_webui", ":sync_integration_test_support", ":test_support", "//base", @@ -620,6 +613,7 @@ if (!is_android) { "//chrome:resources", "//chrome:strings", "//chrome/browser", + "//chrome/browser/resources:extension_resource_demo", "//chrome/common/extensions/api", "//chrome/renderer", "//components/autofill/content/browser:risk_proto", @@ -662,9 +656,6 @@ if (!is_android) { "//ui/web_dialogs:test_support", "//v8", ] - if (has_d8_definition) { - deps += [ ":browser_tests_js_webui" ] - } # Runtime dependencies data_deps = [ -- 2.11.4.GIT