Revert of Fix missing GN dependencies. (patchset #4 id:60001 of https://codereview...
[chromium-blink-merge.git] / chrome / test / chromedriver / BUILD.gn
blob4f040b4c675602cddf63d658e4668aef3b96197a
1 # Copyright 2015 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.
5 import("//build/config/ui.gni")
6 import("//chrome/chrome_tests.gni")
7 import("//testing/test.gni")
9 # GYP version: chrome/chrome_tests.gypi:automation_client_lib
10 #              (embed_js_in_cpp action)
11 action("embed_js_in_cpp") {
12   script = "embed_js_in_cpp.py"
14   js_files = [
15     "js/add_cookie.js",
16     "js/call_function.js",
17     "js/execute_async_script.js",
18     "js/focus.js",
19     "js/get_element_region.js",
20     "js/is_option_element_toggleable.js",
21   ]
23   inputs = [ "cpp_source.py" ] + js_files
25   outputs = [
26     "$target_gen_dir/chrome/js.cc",
27     "$target_gen_dir/chrome/js.h",
28   ]
29   args = [
30     "--directory",
31     rebase_path("$target_gen_dir/chrome", root_build_dir),
32   ]
33   args += rebase_path(js_files, root_build_dir)
36 # GYP version: chrome/chrome_tests.gypi:automation_client_lib
37 #              (embed_user_data_dir_in_cpp action)
38 action("embed_user_data_dir_in_cpp") {
39   script = "embed_user_data_dir_in_cpp.py"
41   files = [
42     "chrome/preferences.txt",
43     "chrome/local_state.txt",
44   ]
46   inputs = [ "cpp_source.py" ] + files
47   outputs = [
48     "$target_gen_dir/chrome/user_data_dir.cc",
49     "$target_gen_dir/chrome/user_data_dir.h",
50   ]
52   args = [
53     "--directory",
54     rebase_path("$target_gen_dir/chrome", root_build_dir),
55   ]
56   args += rebase_path(files, root_build_dir)
59 # GYP version: chrome/chrome_tests.gypi:automation_client_lib
60 #              (embed_extension_in_cpp action)
61 action("embed_extension_in_cpp") {
62   script = "embed_extension_in_cpp.py"
64   files = [
65     "extension/background.js",
66     "extension/manifest.json",
67   ]
69   inputs = [ "cpp_source.py" ] + files
70   outputs = [
71     "$target_gen_dir/chrome/embedded_automation_extension.cc",
72     "$target_gen_dir/chrome/embedded_automation_extension.h",
73   ]
75   args = [
76     "--directory",
77     rebase_path("$target_gen_dir/chrome", root_build_dir),
78   ]
79   args += rebase_path(files, root_build_dir)
82 # GYP version: chrome/chrome_tests.gypi:automation_client_lib
83 source_set("automation_client_lib") {
84   sources =
85       rebase_path(chrome_tests_gypi_values.chrome_automation_client_lib_sources,
86                   ".",
87                   "//chrome")
89   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
90   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
92   # Also compile the generated files.
93   sources += get_target_outputs(":embed_extension_in_cpp")
94   sources += get_target_outputs(":embed_js_in_cpp")
95   sources += get_target_outputs(":embed_user_data_dir_in_cpp")
97   deps = [
98     ":embed_js_in_cpp",
99     ":embed_user_data_dir_in_cpp",
100     "//base",
101     "//base/third_party/dynamic_annotations",
102     "//net",
103     "//third_party/zlib:zip",
104     "//third_party/zlib:minizip",
105     "//ui/accessibility:ax_gen",
106     "//ui/base",
107     "//ui/gfx",
108     "//ui/gfx/geometry",
109     "//url",
110   ]
113 # GYP version: chrome/chrome_tests.gypi:chromedriver_lib
114 #              (embed_version_in_cpp action)
115 action("embed_version_in_cpp") {
116   script = "embed_version_in_cpp.py"
117   inputs = [
118     "cpp_source.py",
119     "VERSION",
120   ]
121   outputs = [
122     "$target_gen_dir/version.cc",
123     "$target_gen_dir/version.h",
124   ]
126   args = [
127     "--version-file",
128     rebase_path("VERSION", root_build_dir),
129     "--directory",
130     rebase_path(target_gen_dir, root_build_dir),
131   ]
134 # GYP version: chrome/chrome_tests.gypi:chromedriver_lib
135 source_set("lib") {
136   sources = rebase_path(chrome_tests_gypi_values.chrome_driver_lib_sources,
137                         ".",
138                         "//chrome")
140   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
141   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
143   # Also compile the generated version files.
144   sources += get_target_outputs(":embed_version_in_cpp")
146   # These aren't automatically filtered out.
147   if (!use_x11) {
148     sources -= [ "keycode_text_conversion_x.cc" ]
149   }
150   if (!use_ozone) {
151     sources -= [ "keycode_text_conversion_ozone.cc" ]
152   }
154   deps = [
155     ":automation_client_lib",
156     ":embed_version_in_cpp",
157     "//base",
158     "//base/third_party/dynamic_annotations",
159     "//crypto",
160     "//net",
161     "//net:http_server",
162     "//third_party/zlib",
163     "//ui/base",
164     "//ui/events:events_base",
165     "//ui/gfx",
166     "//ui/gfx/geometry",
167   ]
169   if (use_x11) {
170     configs += [ "//build/config/linux:x11" ]
171     deps += [ "//ui/gfx/x" ]
172   }
175 executable("chromedriver") {
176   sources = [
177     "server/chromedriver_server.cc",
178   ]
180   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
181   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
183   deps = [
184     ":lib",
185   ]
188 test("chromedriver_unittests") {
189   sources =
190       rebase_path(chrome_tests_gypi_values.chrome_driver_unittests_sources,
191                   ".",
192                   "//chrome")
194   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
195   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
197   deps = [
198     ":lib",
199     "//base",
200     "//base/test:run_all_unittests",
201     "//net",
202     "//net:http_server",
203     "//testing/gtest",
204     "//ui/base",
205     "//ui/gfx",
206     "//ui/gfx/geometry",
207   ]
210 # ChromeDriver tests that aren't run on the main buildbot. Available as an
211 # optional test type on trybots.
212 test("chromedriver_tests") {
213   sources = rebase_path(chrome_tests_gypi_values.chrome_driver_tests_sources,
214                         ".",
215                         "//chrome")
217   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
218   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
220   deps = [
221     ":lib",
222     "//base",
223     "//base/test:run_all_unittests",
224     "//net",
225     "//net:http_server",
226     "//net:test_support",
227     "//testing/gtest",
228     "//url",
229   ]