Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / chromedriver / BUILD.gn
blob6ef1817a327d161ed6a6c1e245d7665acd70c184
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_extension_in_cpp",
99     ":embed_js_in_cpp",
100     ":embed_user_data_dir_in_cpp",
101     "//base",
102     "//base/third_party/dynamic_annotations",
103     "//net",
104     "//third_party/zlib:zip",
105     "//third_party/zlib:minizip",
106     "//ui/accessibility:ax_gen",
107     "//ui/base",
108     "//ui/gfx",
109     "//ui/gfx/geometry",
110     "//url",
111   ]
114 # GYP version: chrome/chrome_tests.gypi:chromedriver_lib
115 #              (embed_version_in_cpp action)
116 action("embed_version_in_cpp") {
117   script = "embed_version_in_cpp.py"
118   inputs = [
119     "cpp_source.py",
120     "VERSION",
121   ]
122   outputs = [
123     "$target_gen_dir/version.cc",
124     "$target_gen_dir/version.h",
125   ]
127   args = [
128     "--version-file",
129     rebase_path("VERSION", root_build_dir),
130     "--directory",
131     rebase_path(target_gen_dir, root_build_dir),
132   ]
135 # GYP version: chrome/chrome_tests.gypi:chromedriver_lib
136 source_set("lib") {
137   sources = rebase_path(chrome_tests_gypi_values.chrome_driver_lib_sources,
138                         ".",
139                         "//chrome")
141   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
142   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
144   # Also compile the generated version files.
145   sources += get_target_outputs(":embed_version_in_cpp")
147   # These aren't automatically filtered out.
148   if (!use_x11) {
149     sources -= [ "keycode_text_conversion_x.cc" ]
150   }
151   if (!use_ozone) {
152     sources -= [ "keycode_text_conversion_ozone.cc" ]
153   }
155   deps = [
156     ":automation_client_lib",
157     ":embed_version_in_cpp",
158     "//base",
159     "//base/third_party/dynamic_annotations",
160     "//crypto",
161     "//net",
162     "//net:http_server",
163     "//third_party/zlib",
164     "//ui/base",
165     "//ui/events:dom_keycode_converter",
166     "//ui/events:events_base",
167     "//ui/gfx",
168     "//ui/gfx/geometry",
169   ]
171   if (use_x11) {
172     configs += [ "//build/config/linux:x11" ]
173     deps += [ "//ui/gfx/x" ]
174   }
177 executable("chromedriver") {
178   sources = [
179     "server/chromedriver_server.cc",
180   ]
182   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
183   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
185   deps = [
186     ":lib",
187     "//build/config/sanitizers:deps",
188   ]
191 # TODO(GYP): Delete this after we've converted everything to GN.
192 # The _run targets exist only for compatibility w/ GYP.
193 group("chromedriver_unittests_run") {
194   testonly = true
195   deps = [
196     ":chromedriver_unittests",
197   ]
200 test("chromedriver_unittests") {
201   sources =
202       rebase_path(chrome_tests_gypi_values.chrome_driver_unittests_sources,
203                   ".",
204                   "//chrome")
206   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
207   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
209   data = [
210     "//chrome/test/data/chromedriver/",
211   ]
213   deps = [
214     ":lib",
215     "//base",
216     "//base/test:run_all_unittests",
217     "//net",
218     "//net:http_server",
219     "//testing/gtest",
220     "//ui/base",
221     "//ui/gfx",
222     "//ui/gfx/geometry",
223   ]
226 # ChromeDriver tests that aren't run on the main buildbot. Available as an
227 # optional test type on trybots.
228 test("chromedriver_tests") {
229   sources = rebase_path(chrome_tests_gypi_values.chrome_driver_tests_sources,
230                         ".",
231                         "//chrome")
233   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
234   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
236   deps = [
237     ":lib",
238     "//base",
239     "//base/test:run_all_unittests",
240     "//net",
241     "//net:http_server",
242     "//net:test_support",
243     "//testing/gtest",
244     "//url",
245   ]