Add python coverage module to third_party
[chromium-blink-merge.git] / chrome / test / BUILD.gn
blob65792a10055f20248cae00a93158ec4dd656140b
1 # Copyright 2014 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/features.gni")
6 import("//build/config/ui.gni")
8 gypi_values = exec_script(
9     "//build/gypi_to_gn.py",
10     [ rebase_path("../chrome_tests.gypi") ],
11     "scope",
12     [ "../chrome_tests.gypi" ])
14 # This target exists to reference other test executables to bring these files
15 # into the build.
16 group("test") {
17   testonly = true
18   deps = [
19     "//chrome/test/perf",
20   ]
23 # GYP version: chrome/chrome_tests_unit.gypi:test_support_common
24 source_set("test_support") {
25   defines = []
26   testonly = true
28   sources = [
29     "base/chrome_process_util.cc",
30     "base/chrome_process_util.h",
31     "base/chrome_process_util_mac.cc",
32     "base/chrome_render_view_host_test_harness.cc",
33     "base/chrome_render_view_host_test_harness.h",
34     "base/chrome_test_launcher.cc",
35     "base/chrome_test_launcher.h",
36     "base/chrome_test_suite.cc",
37     "base/chrome_test_suite.h",
38     "base/chrome_unit_test_suite.cc",
39     "base/chrome_unit_test_suite.h",
40     "base/find_in_page_observer.cc",
41     "base/find_in_page_observer.h",
42     "base/history_index_restore_observer.cc",
43     "base/history_index_restore_observer.h",
44     "base/in_process_browser_test.cc",
45     "base/in_process_browser_test.h",
46     "base/profile_mock.cc",
47     "base/profile_mock.h",
48     "base/scoped_browser_locale.cc",
49     "base/scoped_browser_locale.h",
50     "base/scoped_testing_local_state.cc",
51     "base/scoped_testing_local_state.h",
52     "base/test_browser_window.cc",
53     "base/test_browser_window.h",
54     "base/test_launcher_utils.cc",
55     "base/test_launcher_utils.h",
56     "base/test_switches.cc",
57     "base/test_switches.h",
58     "base/testing_browser_process.cc",
59     "base/testing_browser_process.h",
60     "base/testing_browser_process_platform_part.h",
61     "base/testing_browser_process_platform_part.cc",
62     "base/testing_io_thread_state.cc",
63     "base/testing_io_thread_state.h",
64     "base/testing_pref_service_syncable.cc",
65     "base/testing_pref_service_syncable.h",
66     "base/testing_profile.cc",
67     "base/testing_profile.h",
68     "base/testing_profile_manager.cc",
69     "base/testing_profile_manager.h",
70     "base/tracing.cc",
71     "base/tracing.h",
72     "base/ui_test_utils.cc",
73     "base/ui_test_utils.h",
74     "logging/win/file_logger.cc",
75     "logging/win/file_logger.h",
76     "logging/win/log_file_printer.cc",
77     "logging/win/log_file_printer.h",
78     "logging/win/log_file_reader.cc",
79     "logging/win/log_file_reader.h",
80     "logging/win/mof_data_parser.cc",
81     "logging/win/mof_data_parser.h",
82     "logging/win/test_log_collector.cc",
83     "logging/win/test_log_collector.h",
84   ]
86   # New deps should go in the non-iOS section below.
87   public_deps = [
88     "//content/test:test_support",
89   ]
90   deps = [
91     "//base:prefs_test_support",
92     "//base/test:test_support",
93     "//chrome:resources",
94     "//chrome:strings",
95     "//chrome/app:test_support",
96     #"//chrome/app/theme:theme_resources",
97     "//chrome/browser:test_support",
98     "//chrome/common:test_support",
99     "//chrome/renderer:test_support",
100     "//components/bookmarks/test",
101     "//components/component_updater:test_support",
102     "//components/gcm_driver:test_support",
103     "//components/history/core/test:test",
104     "//components/metrics:test_support",
105     "//components/omnibox:test_support",
106     "//components/ownership",
107     "//components/password_manager/core/browser:test_support",
108     "//components/pref_registry:test_support",
109     "//components/search_engines:test_support",
110     "//components/signin/core/browser:test_support",
111     "//components/sync_driver:test_support",
112     "//content/public/app:both",
113     "//ui/gfx:test_support",
114     "//net",
115     "//net:test_support",
116     "//skia",
117     "//sql",
118     "//sql:test_support",
119     "//sync",
120     "//testing/gmock",
121     "//testing/gtest",
122     "//third_party/zlib",
123     "//ui/message_center:test_support",
124   ]
126   if (!is_ios) {
127     deps += [
128       "//chrome/plugin",
129       "//chrome/renderer",
130       "//chrome/utility",
131       "//content/public/child",
132       "//content/public/common",
133       "//content/public/plugin",
134       "//content/public/renderer",
135       "//content/public/utility",
136       "//components/autofill/core/browser:test_support",
137       "//components/captive_portal:test_support",
138       "//components/infobars/core",
139       "//components/sessions:test_support",
140       "//google_apis:test_support",
141       "//ipc:test_support",
142       "//media:test_support",
143       "//ppapi:ppapi_shared",
144       "//sql:test_support",
145       "//third_party/leveldatabase",
146       "//ui/base",
147       "//ui/events:events_base",
148       "//ui/gl",
149     ]
150   }
152   if (enable_extensions) {
153     deps += [
154       "//chrome/common/extensions/api",
155       "//extensions:test_support",
156     ]
157   }
159   if (is_linux) {
160     deps += [ "//crypto:platform" ]
161   }
162   if (is_win) {
163     deps += [
164       "//third_party/wtl",
165       "//ui/snapshot:test_support",
166     ]
167     if (use_aura) {
168       deps += [
169         #'../win8/win8.gyp:test_registrar_constants',  TODO(GYP)
170         #'../win8/win8.gyp:test_support_win8',  TODO(GYP)
171       ]
172     }
173   }
175   if (enable_plugins) {
176     sources += [
177       "ppapi/ppapi_test.cc",
178       "ppapi/ppapi_test.h",
179     ]
180   }
182   if (use_ash) {
183     deps += [ "//ash:test_support" ]
184   }
185   if (toolkit_views) {
186     deps += [ "//ui/views:test_support" ]
187   }
189   if (enable_background) {
190     defines += [ "ENABLE_BACKGROUND=1" ]
191   }
193   if (enable_extensions) {
194     deps += [
195       "//chrome/common/extensions/api",
196       "//extensions:test_support",
197     ]
198   }
201 source_set("test_support_unit") {
202   testonly = true
203   sources = [
204     "../browser/sync/glue/session_sync_test_helper.cc",
205     "../browser/sync/glue/session_sync_test_helper.h",
206     "base/run_all_unittests.cc",
207   ]
209   deps = [
210     ":test_support",
211     "//base",
212     "//chrome:resources",
213     "//chrome:strings",
214     "//chrome/browser",
215     "//chrome/common",
216     "//mojo/edk/system",
217     "//mojo/environment:chromium",
218   ]
221 source_set("sync_integration_test_support") {
222   testonly = true
224   sources = rebase_path(gypi_values.test_support_sync_integration_sources,
225                         ".", "//chrome")
226   deps = [
227     ":test_support",
228     "//base",
229     "//chrome",
230     "//chrome/browser",
231     "//components/invalidation",
232     "//components/invalidation:test_support",
233     "//net",
234     "//skia",
235     "//sync",
236     "//sync:test_support_sync_testserver",
237     "//sync:test_support_sync_fake_server",
238     "//ui/app_list:test_support",
239   ]
241   if (is_mac) {
242     sources -= [
243       "../browser/sync/test/integration/dictionary_helper.cc",
244       "../browser/sync/test/integration/dictionary_helper.h",
245       "../browser/sync/test/integration/dictionary_load_observer.cc",
246       "../browser/sync/test/integration/dictionary_load_observer.h",
247     ]
248   }
249   if (!enable_app_list) {
250     sources -= [
251       "../browser/sync/test/integration/sync_app_list_helper.cc",
252       "../browser/sync/test/integration/sync_app_list_helper.h",
253     ]
254   }
257 test("sync_integration_tests") {
258   sources = rebase_path(gypi_values.sync_integration_tests_sources,
259                         ".", "//chrome")
261   # TODO(phajdan.jr): Only temporary, to make transition easier.
262   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
264   deps = [
265     ":sync_integration_test_support",
266     ":test_support",
267     "//base/allocator",
268     "//chrome:packed_extra_resources",
269     "//chrome:packed_resources",
270     "//chrome:resources",
271     "//chrome:strings",
272     "//chrome/common",
273     "//chrome/renderer",
274     "//crypto:platform",
275     "//sync",
276     "//testing/gmock",
277     "//testing/gtest",
278     "//third_party/icu",
279     "//third_party/leveldatabase",
280     "//third_party/npapi",
281     "//third_party/WebKit/public:blink",
282   ]
284   if (cld_version == 0 || cld_version == 2) {
285     # Language detection is irrelevant to sync, so it can depend on any
286     # implementation for CLD2. Dynamic is smaller, so go with dynamic.
287     deps += [ "//third_party/cld_2:cld2_dynamic" ]
288   }
289   if (is_mac) {
290     # Dictionary sync is disabled on Mac.
291     sources -= [
292       "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc",
293       "../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
294       "../browser/sync/test/integration/two_client_dictionary_sync_test.cc",
295     ]
297     # The sync_integration_tests do not run on mac without this flag.
298     # Search for comments about "xcode_settings" elsewhere in this file.
299     ldflags = [ "-Wl,-ObjC" ]
300   }
301   if (is_win) {
302     # TODO(GYP) figure out what these should map to.
303     #sources += [
304     #  '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc',
305     #  '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',
306     #]
307     deps += [
308       "//third_party/wtl",
309       #'chrome_version_resources',  TODO(GYP)
310     ]
311   } else {
312     sources -= [
313       "../app/chrome_version.rc.version",
314     ]
315   }
317   if (toolkit_views) {
318     deps += [ "//ui/views" ]
319   }
320   if (enable_basic_printing || enable_print_preview) {
321     deps += [ "//printing" ]
322   }
323   if (!enable_app_list) {
324     sources -= [
325       "../browser/sync/test/integration/single_client_app_list_sync_test.cc",
326       "../browser/sync/test/integration/two_client_app_list_sync_test.cc",
327     ]
328   }
329   if (!enable_managed_users) {
330     sources -= [
331       "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc",
332     ]
333   }
336 test("sync_performance_tests") {
337   sources = rebase_path(gypi_values.sync_performance_tests_sources,
338                         ".", "//chrome")
340   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
342   deps = [
343     ":sync_integration_test_support",
344     "//base/allocator",
345     "//crypto:platform",
346     "//sync",
347     "//testing/gmock",
348     "//testing/gtest",
349   ]
351   if (cld_version == 0 || cld_version == 2) {
352     # Language detection is irrelevant to sync, so it can depend on any
353     # implementation for CLD2. Dynamic is smaller, so go with dynamic.
354     deps += [ "//third_party/cld_2:cld2_dynamic" ]
355   }
357   if (is_mac) {
358     # Dictionary sync is disabled on Mac.
359     sources -= [
360       "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc",
361     ]
363     # The sync_performance_tests do not run on mac without this flag.
364     # Search for comments about "xcode_settings" elsewhere in this file.
365     ldflags = [ "-Wl,-ObjC" ]
366   }
367   if (is_win) {
368     # TODO(GYP) figure out what these should map to.
369     #sources += [
370     #  '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc',
371     #  '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',
372     #]
373     deps += [
374       "//third_party/wtl",
375       #'chrome_version_resources',  TODO(GYP)
376     ]
377   } else {
378     sources -= [
379       "../app/chrome_version.rc.version",
380     ]
381   }
383   if (toolkit_views) {
384     deps += [ "//ui/views" ]
385   }