Update V8 to version 4.6.73.
[chromium-blink-merge.git] / chrome / test / BUILD.gn
blob38bee4f31d6ede5db513178e2e72bdf6170eb6b9
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/chrome_build.gni")
6 import("//build/config/crypto.gni")
7 import("//build/config/features.gni")
8 import("//build/config/ui.gni")
9 import("//chrome/chrome_tests.gni")
10 import("//chrome/test/base/js2gtest.gni")
11 import("//testing/test.gni")
13 declare_args() {
14   # TODO(GYP) http://crbug.com/462791
15   enable_nacl_browsertests = false
18 # This target exists to reference other test executables to bring these files
19 # into the build.
20 group("test") {
21   testonly = true
24 # GYP version: chrome/chrome_tests_unit.gypi:test_support_common
25 source_set("test_support") {
26   defines = []
27   testonly = true
29   sources = [
30     "base/chrome_process_util.cc",
31     "base/chrome_process_util.h",
32     "base/chrome_process_util_mac.cc",
33     "base/chrome_render_view_host_test_harness.cc",
34     "base/chrome_render_view_host_test_harness.h",
35     "base/chrome_test_launcher.cc",
36     "base/chrome_test_launcher.h",
37     "base/chrome_test_suite.cc",
38     "base/chrome_test_suite.h",
39     "base/chrome_unit_test_suite.cc",
40     "base/chrome_unit_test_suite.h",
41     "base/dialog_test_browser_window.cc",
42     "base/dialog_test_browser_window.h",
43     "base/find_in_page_observer.cc",
44     "base/find_in_page_observer.h",
45     "base/history_index_restore_observer.cc",
46     "base/history_index_restore_observer.h",
47     "base/in_process_browser_test.cc",
48     "base/in_process_browser_test.h",
49     "base/in_process_browser_test_mac.cc",
50     "base/profile_mock.cc",
51     "base/profile_mock.h",
52     "base/scoped_browser_locale.cc",
53     "base/scoped_browser_locale.h",
54     "base/scoped_bundle_swizzler_mac.h",
55     "base/scoped_bundle_swizzler_mac.mm",
56     "base/scoped_testing_local_state.cc",
57     "base/scoped_testing_local_state.h",
58     "base/test_browser_window.cc",
59     "base/test_browser_window.h",
60     "base/test_launcher_utils.cc",
61     "base/test_launcher_utils.h",
62     "base/test_switches.cc",
63     "base/test_switches.h",
64     "base/testing_browser_process.cc",
65     "base/testing_browser_process.h",
66     "base/testing_browser_process_platform_part.cc",
67     "base/testing_browser_process_platform_part.h",
68     "base/testing_io_thread_state.cc",
69     "base/testing_io_thread_state.h",
70     "base/testing_pref_service_syncable.cc",
71     "base/testing_pref_service_syncable.h",
72     "base/testing_profile.cc",
73     "base/testing_profile.h",
74     "base/testing_profile_manager.cc",
75     "base/testing_profile_manager.h",
76     "base/tracing.cc",
77     "base/tracing.h",
78     "base/ui_test_utils.cc",
79     "base/ui_test_utils.h",
80     "logging/win/file_logger.cc",
81     "logging/win/file_logger.h",
82     "logging/win/log_file_printer.cc",
83     "logging/win/log_file_printer.h",
84     "logging/win/log_file_reader.cc",
85     "logging/win/log_file_reader.h",
86     "logging/win/mof_data_parser.cc",
87     "logging/win/mof_data_parser.h",
88     "logging/win/test_log_collector.cc",
89     "logging/win/test_log_collector.h",
90   ]
92   configs += [ "//build/config:precompiled_headers" ]
94   # New deps should go in the non-iOS section below.
95   public_deps = [
96     "//content/test:test_support",
97   ]
98   deps = [
99     "//base:prefs_test_support",
100     "//base/test:test_support",
101     "//chrome:resources",
102     "//chrome:strings",
103     "//chrome/app:test_support",
105     #"//chrome/app/theme:theme_resources",
106     "//chrome/browser:test_support",
107     "//chrome/common:test_support",
108     "//chrome/renderer:test_support",
109     "//components/bookmarks/test",
110     "//components/gcm_driver:test_support",
111     "//components/gcm_driver/instance_id:test_support",
112     "//components/history/core/test:test",
113     "//components/metrics:test_support",
114     "//components/omnibox/browser:test_support",
115     "//components/password_manager/core/browser:test_support",
116     "//components/pref_registry:test_support",
117     "//components/rappor:test_support",
118     "//components/search_engines:test_support",
119     "//components/signin/core/browser:test_support",
120     "//components/sync_driver:test_support",
121     "//components/update_client:test_support",
122     "//content/public/app:both",
123     "//ui/gfx:test_support",
124     "//net",
125     "//net:test_support",
126     "//skia",
127     "//sql",
128     "//sql:test_support",
129     "//sync",
130     "//testing/gmock",
131     "//testing/gtest",
132     "//third_party/zlib",
133     "//ui/message_center:test_support",
134   ]
136   if (!is_ios) {
137     deps += [
138       "//chrome/child",
139       "//chrome/plugin",
140       "//chrome/renderer",
141       "//chrome/utility",
142       "//content/public/child",
143       "//content/public/common",
144       "//content/public/plugin",
145       "//content/public/renderer",
146       "//content/public/utility",
147       "//components/autofill/core/browser:test_support",
148       "//components/captive_portal:test_support",
149       "//components/guest_view/browser:test_support",
150       "//components/infobars/core",
151       "//components/sessions:test_support",
152       "//components/user_manager:test_support",
153       "//components/web_resource:test_support",
154       "//google_apis:test_support",
155       "//ipc:test_support",
156       "//media:test_support",
157       "//ppapi/shared_impl",
158       "//sql:test_support",
159       "//third_party/leveldatabase",
160       "//ui/base",
161       "//ui/events:events_base",
162       "//ui/gl",
163     ]
164   }
166   if (enable_extensions) {
167     deps += [
168       "//chrome/common/extensions/api",
169       "//extensions:test_support",
170     ]
171   }
173   if (is_linux) {
174     deps += [ "//crypto:platform" ]
175   }
176   if (is_mac) {
177     # deps += [ '../third_party/ocmock/ocmock.gyp:ocmock' ] TODO(GYP)
178   }
179   if (is_win) {
180     deps += [ "//third_party/wtl" ]
181     if (use_aura) {
182       deps += [
183         "//win8:test_registrar_constants",
184         "//win8:test_support_win8",
185       ]
186     }
187   }
188   if (is_chromeos) {
189     deps += [ "//components/ownership" ]
190   }
192   if (use_aura) {
193     sources += [
194       "base/test_browser_window_aura.cc",
195       "base/test_browser_window_aura.h",
196     ]
197   }
199   if (enable_plugins) {
200     sources += [
201       "ppapi/ppapi_test.cc",
202       "ppapi/ppapi_test.h",
203     ]
204     deps += [ "//pdf" ]
205   }
207   if (use_ash) {
208     deps += [ "//ash:test_support" ]
209   }
210   if (toolkit_views) {
211     deps += [ "//ui/views:test_support" ]
212   }
214   if (enable_extensions) {
215     deps += [
216       "//chrome/common/extensions/api",
217       "//extensions:test_support",
218     ]
219   }
222 if (!is_android) {
223   import("//third_party/protobuf/proto_library.gni")
225   # GYP version: chrome/chrome_tests_unit.gypi:ipc_protobuf_message_test_proto
226   proto_library("test_proto") {
227     sources = [
228       "../common/safe_browsing/ipc_protobuf_message_test.proto",
229     ]
230   }
232   # TODO(GYP): Delete this after we've converted everything to GN.
233   # The _run targets exist only for compatibility w/ GYP.
234   group("interactive_ui_tests_run") {
235     testonly = true
236     deps = [
237       ":interactive_ui_tests",
238     ]
239   }
241   test("interactive_ui_tests") {
242     sources =
243         rebase_path(chrome_tests_gypi_values.chrome_interactive_ui_test_sources,
244                     ".",
245                     "//chrome")
247     configs += [ "//build/config:precompiled_headers" ]
249     data = [
250       "data/",
251       "//net/data/ssl/certificates/",
252       "//net/tools/testserver/",
253       "//ppapi/tests/test_case.html",
254       "//ppapi/tests/test_case.html.mock-http-headers",
255       "//ppapi/tests/test_page.css",
256       "//ppapi/tests/test_page.css.mock-http-headers",
257       "//third_party/pyftpdlib/",
258       "//third_party/pywebsocket/",
259       "//third_party/tlslite/",
260       "//third_party/zlib/google/test/data/",
261       "//tools/metrics/histograms/histograms.xml",
262       "$root_out_dir/pyproto/google/",
263       "$root_out_dir/resources.pak",
264       "$root_out_dir/ui_test.pak",
265     ]
266     if (is_linux || is_win) {
267       data += [
268         "$root_out_dir/chrome_100_percent.pak",
269         "$root_out_dir/locales/en-US.pak",
270         "$root_out_dir/locales/fr.pak",
271       ]
272     }
273     if (is_linux) {
274       data += [ "$root_out_dir/libppapi_tests.so" ]
275     }
277     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
278     ldflags = []
280     deps = [
281       "//base/allocator",
282       "//chrome/browser",
283       "//chrome/browser/devtools",
284       "//chrome/renderer",
285       "//chrome/test:test_support",
286       "//chrome:resources",
287       "//chrome:strings",
288       "//chrome:packed_extra_resources",
289       "//chrome:packed_resources",
290       "//components/resources",
291       "//content/app/resources",
292       "//crypto:platform",
293       "//crypto:test_support",
294       "//google_apis:test_support",
295       "//net",
296       "//net:net_resources",
297       "//net:test_support",
298       "//skia",
299       "//sync",
300       "//testing/gmock",
301       "//testing/gtest",
302       "//third_party/hunspell",
303       "//third_party/icu",
304       "//third_party/libpng",
305       "//third_party/zlib",
306       "//ui/base:test_support",
307       "//ui/resources:ui_test_pak",
308       "//ui/web_dialogs:test_support",
309     ]
311     # TODO(rockot) bug 505926: The chrome_extensions_interactive_uitests target
312     # should be deleted and this line removed. See the
313     # chrome_extensions_interactive_uitests target for more.
314     deps += [ "//extensions:chrome_extensions_interactive_uitests" ]
316     # Runtime dependencies
317     data_deps = [
318       "//ppapi:ppapi_tests",
319       "//third_party/mesa:osmesa",
320     ]
322     if (toolkit_views) {
323       sources += rebase_path(
324               chrome_tests_gypi_values.chrome_interactive_ui_test_views_sources,
325               ".",
326               "//chrome")
327       deps += [
328         "//ui/views",
329         "//ui/views:test_support",
330         "//ui/views/controls/webview:test_support",
331       ]
332       if (!is_mac) {
333         sources += rebase_path(
334                 chrome_tests_gypi_values.chrome_interactive_ui_test_views_non_mac_sources,
335                 ".",
336                 "//chrome")
337       }
338       if (is_linux) {
339         # TODO(gbillock): aura linux does not support the automation for
340         # SendMouseMoveNotifyWhenDone
341         sources -= [ "../browser/ui/views/toolbar/toolbar_button_test.cc" ]
342       }
343       if (is_chromeos || !use_x11) {
344         sources -= [
345           "../../ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc",
346           "../../ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc",
347         ]
348       }
349       if (use_aura) {
350         deps += [ "//ui/touch_selection" ]
351       }
352     }
354     if (is_linux && !is_chromeos) {
355       # Desktop linux.
356       sources -= [
357         # TODO(port): This times out. Attempts have been made to fix the
358         # individual failures, but each time I disable a test from these
359         # suites, it seems like one or another starts timing out too.
360         "../browser/ui/views/keyboard_access_browsertest.cc",
361       ]
362     } else {
363       # Everything but desktop Linux.
364       sources += rebase_path(
365               chrome_tests_gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources,
366               ".",
367               "//chrome")
368     }
370     if (is_chromeos) {
371       sources += rebase_path(
372               chrome_tests_gypi_values.chrome_interactive_ui_test_chromeos_sources,
373               ".",
374               "//chrome")
375       sources += [ "../browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc" ]
376       sources -= [
377         # Use only the _chromeos version on ChromeOS.
378         "base/view_event_test_platform_part_ash.cc",
379       ]
381       deps += [
382         "//ash/resources",
383         "//chromeos",
384       ]
386       if (enable_nacl) {
387         deps += [
388           "//native_client/src/trusted/service_runtime/linux:munge_nacl_helper_bootstrap",
389           "//components/nacl:nacl_helper",
391           # '../components/nacl_nonsfi.gyp:nacl_helper_nonsfi',  TODO(GYP)
392         ]
393       }
395       if (is_chrome_branded) {
396         sources -= [
397           # These tests are failing on official cros bots. crbug.com/431450.
398           "../browser/ui/views/bookmarks/bookmark_bar_view_test.cc",
399         ]
400       }
401     } else {
402       # ChromeOS doesn't use panels, everybody else does.
403       sources += rebase_path(
404               chrome_tests_gypi_values.chrome_interactive_ui_test_panels_sources,
405               ".",
406               "//chrome")
408       # TODO(tapted): Include on mac when views panels are ported.
409       if (toolkit_views && !is_mac) {
410         sources += rebase_path(
411                 chrome_tests_gypi_values.chrome_interactive_ui_test_panels_views_sources,
412                 ".",
413                 "//chrome")
414       }
415     }
417     if (!is_linux) {
418       # Non-Linux platforms (Linux includes ChromeOS here).
419       sources += rebase_path(
420               chrome_tests_gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources,
421               ".",
422               "//chrome")
423     }
425     if (is_win) {
426       sources += rebase_path(
427               chrome_tests_gypi_values.chrome_interactive_ui_test_win_sources,
428               ".",
429               "//chrome")
430       deps += [
431         "//chrome:other_version",
432         "//third_party/isimpledom",
433         "//third_party/wtl",
434         "//ui/resources",
435       ]
437       configs -= [ "//build/config/win:default_incremental_linking" ]
438       configs +=
439           [ "//build/config/win:default_large_module_incremental_linking" ]
441       libs = [ "oleacc.lib" ]
442     }
444     if (is_mac) {
445       data_deps += [ "//chrome" ]
447       # TODO(mark): We really want this for all non-static library targets, but
448       # when we tried to pull it up to the common.gypi level, it broke other
449       # things like the ui and startup tests. *shrug*
450       ldflags += [ "-Wl,-ObjC" ]
451     }
453     if (cld_version == 2) {
454       # Interactive tests should use whatever CLD2 data access mode that the
455       # application embedder is using.
456       deps += [ "//third_party/cld_2:cld2_platform_impl" ]
457     }
459     if (use_x11) {
460       configs += [ "//build/config/linux:xtst" ]
461       data_deps += [ "//tools/xdisplaycheck" ]
462     }
464     if (enable_app_list) {
465       sources += rebase_path(
466               chrome_tests_gypi_values.chrome_interactive_ui_test_app_list_sources,
467               ".",
468               "//chrome")
469     }
471     if (use_ash) {
472       sources += rebase_path(
473               chrome_tests_gypi_values.chrome_interactive_ui_test_ash_sources,
474               ".",
475               "//chrome")
476       deps += [ "//ash:interactive_ui_test_support" ]
477     }
479     if (enable_notifications) {
480       sources += rebase_path(
481               chrome_tests_gypi_values.chrome_interactive_ui_test_notifications_sources,
482               ".",
483               "//chrome")
485       # Non-ChromeOS notifications tests (ChromeOS does not use cross-platform
486       # panels).
487       if (!is_chromeos) {
488         sources += [
489           "../browser/notifications/notification_browsertest.cc",
490           "../browser/notifications/platform_notification_service_browsertest.cc",
491         ]
492       }
494       if (is_android) {
495         sources -= [
496           # Android does not use the message center-based Notification system.
497           "../browser/notifications/message_center_notifications_browsertest.cc",
499           # TODO(peter): Enable the Notification browser tests.
500           "../browser/notifications/notification_browsertest.cc",
501           "../browser/notifications/platform_notification_service_browsertest.cc",
502         ]
503       }
504     }  # enable_notifications
506     if (use_aura || is_chromeos) {
507       sources -=
508           [ "../../ui/views/corewm/desktop_capture_controller_unittest.cc" ]
509     }
510   }
512   source_set("sync_integration_test_support") {
513     testonly = true
514     sources = rebase_path(
515             chrome_tests_gypi_values.test_support_sync_integration_sources,
516             ".",
517             "//chrome")
518     public_deps = [
519       "//chrome/browser",
520     ]
521     deps = [
522       ":test_support",
523       "//base",
524       "//chrome",
525       "//components/invalidation/impl",
526       "//components/invalidation/impl:test_support",
527       "//net",
528       "//skia",
529       "//sync",
530       "//sync:test_support_sync_testserver",
531       "//sync:test_support_sync_fake_server",
532       "//ui/app_list:test_support",
533     ]
535     if (is_mac) {
536       sources -= [
537         "../browser/sync/test/integration/dictionary_helper.cc",
538         "../browser/sync/test/integration/dictionary_helper.h",
539         "../browser/sync/test/integration/dictionary_load_observer.cc",
540         "../browser/sync/test/integration/dictionary_load_observer.h",
541       ]
542     }
543     if (!enable_app_list) {
544       sources -= [
545         "../browser/sync/test/integration/sync_app_list_helper.cc",
546         "../browser/sync/test/integration/sync_app_list_helper.h",
547       ]
548     }
549     if (!is_chromeos) {
550       sources -= [
551         "../browser/sync/test/integration/wifi_credentials_helper.cc",
552         "../browser/sync/test/integration/wifi_credentials_helper.h",
553       ]
554     }
555   }
557   js2gtest("browser_tests_js_webui") {
558     test_type = "webui"
559     sources = rebase_path(
560             chrome_tests_gypi_values.chrome_browser_tests_webui_js_sources,
561             ".",
562             "//chrome")
563     if (is_chrome_branded) {
564       # crbug.com/230471
565       sources -= [ "data/webui/accessibility_audit_browsertest.js" ]
566     }
567     if (!is_chromeos) {
568       sources -= [ "data/webui/certificate_viewer_dialog_test.js" ]
569     }
570     if (!enable_app_list) {
571       sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ]
572     }
573     if (!enable_supervised_users) {
574       sources -=
575           [ "../browser/ui/webui/downloads_ui_supervised_browsertest.js" ]
576     }
577     if (!enable_print_preview) {
578       sources -= [ "data/webui/print_preview.js" ]
579     }
580     deps = [
581       "//chrome/browser/ui",
582       "//skia",
583     ]
584     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
585   }
587   # TODO(GYP): Delete this after we've converted everything to GN.
588   # The _run targets exist only for compatibility w/ GYP.
589   group("tab_capture_end2end_tests_run") {
590     testonly = true
591     deps = [
592       ":browser_tests",
593     ]
594   }
596   # TODO(GYP): Delete this after we've converted everything to GN.
597   # The _run targets exist only for compatibility w/ GYP.
598   group("browser_tests_run") {
599     testonly = true
600     deps = [
601       ":browser_tests",
602     ]
603   }
605   test("browser_tests") {
606     sources = [
607       "base/browser_tests_main.cc",
608     ]
609     sources +=
610         rebase_path(chrome_tests_gypi_values.chrome_browser_tests_sources,
611                     ".",
612                     "//chrome")
613     sources += rebase_path(
614             chrome_tests_gypi_values.chrome_browser_extensions_test_support_sources,
615             ".",
616             "//chrome")
618     configs += [ "//build/config:precompiled_headers" ]
620     data = [
621       "data/",
622       "//chrome/browser/policy/test/asn1der.py",
623       "//chrome/browser/policy/test/policy_testserver.py",
624       "//chrome/common/extensions/docs/examples/apps/calculator/",
625       "//chrome/third_party/mock4js/",
626       "//content/test/data/",
627       "//google_apis/test/",
628       "//media/test/data/",
629       "//net/data/",
630       "//net/tools/testserver/",
631       "//ppapi/tests/test_case.html",
632       "//ppapi/tests/test_case.html.mock-http-headers",
633       "//ppapi/tests/test_page.css",
634       "//ppapi/tests/test_page.css.mock-http-headers",
635       "//testing/test_env.py",
636       "//third_party/accessibility-audit/axs_testing.js",
637       "//third_party/mocha/mocha.js",
638       "//third_party/pyftpdlib/",
639       "//third_party/pywebsocket/",
640       "//third_party/safe_browsing/",
641       "//third_party/simplejson/",
642       "//third_party/tlslite/",
643       "//ui/webui/resources/js/",
644       "$root_out_dir/pyproto/",
645       "$root_out_dir/browser_tests.pak",
646       "$root_out_dir/chrome_100_percent.pak",
647       "$root_out_dir/locales/",
648       "$root_out_dir/remoting/unittests/",
649       "$root_out_dir/resources.pak",
650       "$root_out_dir/resources/extension/",
651       "$root_out_dir/test_case.html",
652       "$root_out_dir/test_case.html.mock-http-headers",
653       "$root_out_dir/test_data/",
654       "$root_out_dir/test_page.css",
655       "$root_out_dir/test_page.css.mock-http-headers",
656       "$root_out_dir/test_url_loader_data/",
657     ]
659     deps = [
660       ":browser_tests_js_webui",
661       ":sync_integration_test_support",
662       ":test_support",
663       "//base",
664       "//base:i18n",
665       "//base/allocator",
666       "//base/test:test_support",
667       "//chrome:browser_tests_pak",
668       "//chrome:packed_extra_resources",
669       "//chrome:packed_resources",
670       "//chrome:resources",
671       "//chrome:strings",
672       "//chrome/browser",
673       "//chrome/browser/resources:extension_resource_demo",
674       "//chrome/common/extensions/api",
675       "//chrome/renderer",
676       "//components/autofill/content/browser:risk_proto",
677       "//components/autofill/content/browser/wallet:test_support",
678       "//components/autofill/content/renderer:test_support",
679       "//components/captive_portal:test_support",
680       "//components/dom_distiller/content:content_browser",
681       "//components/dom_distiller/core:test_support",
682       "//components/guest_view/browser:test_support",
683       "//components/resources",
684       "//components/strings",
685       "//components/translate/core/common",
686       "//components/user_manager:test_support",
687       "//crypto:platform",
688       "//crypto:test_support",
689       "//device/bluetooth:mocks",
690       "//device/serial:test_support",
691       "//extensions/common/api",
692       "//google_apis:test_support",
693       "//media",
694       "//media/base:test_support",
695       "//media/cast:test_support",
696       "//net",
697       "//net:test_support",
698       "//sdch",
699       "//skia",
700       "//sync",
701       "//sync:test_support_sync_api",
702       "//testing/gmock",
703       "//testing/gtest",
704       "//testing/perf",
705       "//third_party/cacheinvalidation",
706       "//third_party/icu",
707       "//third_party/leveldatabase",
708       "//third_party/libaddressinput",
709       "//third_party/libjingle",
710       "//third_party/safe_browsing:test_support",
711       "//third_party/webrtc/modules/desktop_capture",
712       "//third_party/widevine/cdm:version_h",
713       "//ui/accessibility:test_support",
714       "//ui/base:test_support",
715       "//ui/compositor:test_support",
716       "//ui/resources",
717       "//ui/web_dialogs:test_support",
718       "//v8",
719     ]
721     # TODO(rockot) bug 505926: The chrome_extensions_browsertests target should
722     # be deleted and this line removed. See the chrome_extensions_browsertests
723     # target for more.
724     deps += [ "//extensions:chrome_extensions_browsertests" ]
726     # Runtime dependencies
727     data_deps = [
728       "//ppapi:ppapi_tests",
729       "//ppapi:power_saver_test_plugin",
730       "//remoting/webapp:browser_test_resources",
731       "//remoting/webapp:unit_tests",
732       "//third_party/mesa:osmesa",
733       "//third_party/widevine/cdm:widevine_test_license_server",
734     ]
736     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
738     if (!enable_nacl_browsertests) {
739       defines += [ "DISABLE_NACL_BROWSERTESTS" ]
740     }
742     # TODO(GYP) if (is_win) {
743     #       ['incremental_chrome_dll==1', {
744     #         'UseLibraryDependencyInputs': "true",
745     # }
747     if (cld_version == 2) {
748       # Because the browser_tests use translate, they need CLD data.
749       deps += [ "//third_party/cld_2:cld2_platform_impl" ]
750     }
752     if (!enable_one_click_signin) {
753       sources -= [ "../browser/ui/sync/one_click_signin_bubble_links_delegate_browsertest.cc" ]
754     }
755     if (!enable_nacl_browsertests) {
756       sources -= [ "../browser/extensions/api/hotword_private/hotword_private_apitest.cc" ]
757     } else if (enable_nacl) {
758       sources += [
759         "../browser/extensions/extension_nacl_browsertest.cc",
760         "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc",
761       ]
762       deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
764       if (enable_nacl_untrusted) {
765         sources += [
766           "nacl/nacl_browsertest.cc",
767           "nacl/nacl_browsertest_uma.cc",
768           "nacl/nacl_browsertest_util.cc",
769           "nacl/nacl_browsertest_util.h",
770           "nacl/pnacl_header_test.cc",
771           "nacl/pnacl_header_test.h",
772         ]
774         # TODO(GYP): Make NaCl work in other configs and update the irt
775         # dependency as appropriate. We should probably push this
776         # dependency into ppapi/native_client so that clients don't need
777         # to know all of the different toolchain options.
778         assert(current_cpu == "x64")
779         data_deps += [
780           # "test/data/nacl:shared_test_files",  # TODO(GYP) bug 512902
781           "//ppapi/native_client:nacl_irt(//native_client/build/toolchain/nacl:irt_x64)",
782           # "../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests",  # TODO(GYP) bug 512901
783           # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive",  # TODO(GYP) bug 512900
784           # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries",  # TODO(GYP) bug 512900
785           # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app",  # TODO(GYP) bug 512900
786         ]
787         if (is_chromeos) {
788           sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ]
789           deps += [
790             "//chrome/browser/chromeos",
791             #'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data',  TODO(GYP) bug 512906
792           ]
793         }
794       }
795       if (is_win || is_linux) {
796         sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ]
797         deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ]
798       }
799       if (is_win) {
800         # TODO(halyavin) NaCl on Windows can't open debug stub socket in
801         # browser process as needed by this test. See http://crbug.com/157312.
802         sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ]
803         deps += [
804           #'chrome.gyp:chrome_nacl_win64',  TODO(GYP) bug 512869
805         ]
806         configs -= [ "//build/config/win:default_incremental_linking" ]
807         configs +=
808             [ "//build/config/win:default_large_module_incremental_linking" ]
809       }
810       if (is_linux) {
811         deps += [
812           "//native_client/src/trusted/service_runtime/linux:munge_nacl_helper_bootstrap",
813           "//components/nacl:nacl_helper",
815           # "//components/nacl_nonsfi.gyp:nacl_helper_nonsfi",  # TODO(GYP) bug 512912.
816         ]
817       }
818     }
819     if (debug_devtools) {
820       defines += [ "DEBUG_DEVTOOLS=1" ]
821     }
822     if (use_ash) {
823       deps += [ "//ash:test_support" ]
824     }
825     if (use_aura || toolkit_views) {
826       deps += [ "//ui/events:test_support" ]
827     }
828     if (toolkit_views) {
829       sources += rebase_path(
830               chrome_tests_gypi_values.chrome_browser_tests_views_sources,
831               ".",
832               "//chrome")
833       deps += [ "//ui/views" ]
834       if (!is_mac) {
835         sources += rebase_path(
836                 chrome_tests_gypi_values.chrome_browser_tests_views_non_mac_sources,
837                 ".",
838                 "//chrome")
839       }
840     }
841     if (is_chromeos) {
842       sources += rebase_path(
843               chrome_tests_gypi_values.chrome_browser_tests_chromeos_sources,
844               ".",
845               "//chrome")
846       sources -= [
847         "../../apps/load_and_launch_browsertest.cc",
848         "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
849         "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
851         # chromeos does not support profile list avatar menu
852         "../browser/profiles/profile_list_desktop_browsertest.cc",
853         "../browser/service_process/service_process_control_browsertest.cc",
855         # chromeos does not use cross-platform panels
856         "../browser/ui/panels/panel_extension_browsertest.cc",
858         # chromeos does not use the desktop user manager
859         "../browser/ui/webui/signin/user_manager_ui_browsertest.cc",
860       ]
861       deps += [
862         "//dbus",
863         "//dbus:test_support",
864         "//ui/login:resources",
865       ]
866     } else {
867       sources -= [
868         "../browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc",
869         "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
870         "../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc",
871         "../browser/extensions/api/terminal/terminal_private_apitest.cc",
872         "../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
873         "../browser/net/nss_context_chromeos_browsertest.cc",
874         "../browser/ui/ash/keyboard_controller_browsertest.cc",
875         "data/webui/certificate_viewer_ui_test-inl.h",
876       ]
877       if (toolkit_views) {
878         sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ]
879       }
880     }
881     if (enable_configuration_policy) {
882       sources += rebase_path(
883               chrome_tests_gypi_values.chrome_browser_tests_policy_sources,
884               ".",
885               "//chrome")
886     }
887     if (enable_web_speech) {
888       sources += rebase_path(
889               chrome_tests_gypi_values.chrome_browser_tests_speech_sources,
890               ".",
891               "//chrome")
892     }
893     if (safe_browsing_mode == 1) {
894       sources += rebase_path(
895               chrome_tests_gypi_values.chrome_browser_tests_full_safe_browsing_sources,
896               ".",
897               "//chrome")
898     }
899     if (enable_captive_portal_detection) {
900       sources += [ "../browser/captive_portal/captive_portal_browsertest.cc" ]
901     }
902     if (!enable_webrtc) {
903       sources -= [
904         "../browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc",
905         "../browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc",
906         "../browser/media/chrome_webrtc_browsertest.cc",
907         "../browser/media/chrome_webrtc_disable_encryption_flag_browsertest.cc",
908         "../browser/media/chrome_webrtc_getmediadevices_browsertest.cc",
909       ]
910     }
911     if (enable_media_router) {
912       sources += rebase_path(
913               chrome_tests_gypi_values.chrome_browser_tests_media_router_sources,
914               ".",
915               "//chrome")
916       deps += [ "//chrome/browser/media/router:test_support" ]
917     }
918     if (is_win) {
919       deps += [
920         "//chrome:other_version",
921         "//third_party/wtl",
922         "//ui/resources",
923       ]
924     } else {
925       sources -= [
926         "../app/chrome_command_ids.h",
927         "../app/chrome_dll_resource.h",
928         "../app/chrome_version.rc.version",
929         "../browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc",
930       ]
931     }
932     if (!is_chromeos && use_aura) {
933       sources -= [
934         # On Windows and Linux, we currently don't support enough of the
935         # ash environment to run these unit tests.
936         #
937         # TODO: enable these on windows and linux.
938         "../browser/ui/ash/accelerator_commands_browsertest.cc",
939         "../browser/ui/ash/accelerator_controller_browsertest.cc",
940         "../browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc",
941         "../browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc",
942         "../browser/ui/ash/shelf_browsertest.cc",
943         "../browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc",
944       ]
945     }
946     if (is_mac) {
947       # TODO(mark): We really want this for all non-static library
948       # targets, but when we tried to pull it up to the common.gypi
949       # level, it broke other things like the ui and startup tests. *shrug*
950       ldflags = [ "-Wl,-ObjC" ]
952       # Other platforms only need
953       # chrome_resources.gyp:{packed_extra_resources,packed_resources},
954       # and can build this target standalone much faster.
955       deps += [
956         #'app_mode_app_support',  TODO(GYP)
957         "//chrome",
959         #'../components/components.gyp:breakpad_stubs',  TODO(GYP)
960         "//third_party/ocmock",
961       ]
962       sources += [
963         "../browser/media_galleries/fileapi/iphoto_data_provider_browsertest.cc",
964         "../browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm",
965         "../browser/spellchecker/spellcheck_message_filter_platform_mac_browsertest.cc",
966       ]
967       sources -= [
968         # TODO(groby): This test depends on hunspell and we cannot run it on
969         # Mac, which does not use hunspell by default.
970         "../browser/spellchecker/spellcheck_service_browsertest.cc",
972         # TODO(rouslan): This test depends on the custom dictionary UI,
973         # which is disabled on Mac.
974         # TODO(GYP): This should be added somewhere first ...
975         # "../browser/ui/webui/options/edit_dictionary_browsertest.js",
977         # TODO(rouslan): This test depends on hunspell and we cannot run it
978         # on Mac, which does use hunspell by default.
979         # TODO(GYP): This should be added somewhere first ...
980         # "../browser/ui/webui/options/language_options_dictionary_download_browsertest.js",
982         # ProcessSingletonMac doesn"t do anything.
983         "../browser/process_singleton_browsertest.cc",
985         # This test depends on GetCommandLineForRelaunch, which is not
986         # available on Mac.
987         "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
989         # single-process mode hangs on Mac sometimes because of multiple UI
990         # message loops. See 306348
991         "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
992         "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
993         "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
994       ]
995     }
996     if (is_mac || is_win) {
997       sources += [
998         "../browser/extensions/api/networking_private/networking_private_apitest.cc",
999         "../browser/extensions/api/networking_private/networking_private_service_client_apitest.cc",
1000         "../browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc",
1001         "../browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc",
1002       ]
1003       deps += [ "//components/wifi:test_support" ]
1004     }
1005     if (!is_posix || is_chromeos) {
1006       sources -= [ "../common/time_format_browsertest.cc" ]
1007     }
1008     if (is_android) {
1009       sources -= [
1010         "../browser/policy/cloud/component_cloud_policy_browsertest.cc",
1011         "../browser/prefs/pref_hash_browsertest.cc",
1012         "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
1013         "../renderer/spellchecker/spellcheck_unittest.cc",
1014       ]
1015     }
1016     if (is_chromeos) {
1017       sources += [
1018         "../browser/extensions/api/networking_private/networking_private_apitest.cc",
1019         "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
1020       ]
1021     }
1022     if (!is_android && !is_ios && enable_nacl_browsertests) {
1023       sources +=
1024           [ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ]
1025       deps += [ "//components/copresence" ]
1026     }
1027     if (enable_app_list) {
1028       sources += rebase_path(
1029               chrome_tests_gypi_values.chrome_browser_tests_app_list_sources,
1030               ".",
1031               "//chrome")
1032     }
1033     if (enable_supervised_users) {
1034       sources += rebase_path(
1035               chrome_tests_gypi_values.chrome_browser_tests_supervised_user_sources,
1036               ".",
1037               "//chrome")
1038     }
1039     if (enable_pepper_cdms) {
1040       # Runtime dependencies.
1041       data_deps += [
1042         "//media/cdm/ppapi:clearkeycdmadapter",
1043         "//third_party/widevine/cdm:widevinecdmadapter",
1044       ]
1045     }
1046     if (!enable_print_preview) {
1047       sources -= [
1048         "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc",
1049         "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
1050         "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
1051         "../browser/printing/print_preview_dialog_controller_browsertest.cc",
1052         "../browser/printing/print_preview_pdf_generated_browsertest.cc",
1053         "../browser/service_process/service_process_control_browsertest.cc",
1054         "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc",
1055         "data/webui/print_preview.cc",
1056         "data/webui/print_preview.h",
1057       ]
1058     }
1059     if (enable_mdns) {
1060       sources += [ "../browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc" ]
1061     }
1062     if (use_brlapi) {
1063       deps += [ "//build/config/linux:libbrlapi" ]
1064     } else {
1065       sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ]
1066     }
1067     if (is_chrome_branded) {
1068       sources -= [
1069         # These tests depend on single process mode, which is disabled in
1070         # official builds.
1071         "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
1072         "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
1073         "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
1074       ]
1075     }
1076     if (!enable_autofill_dialog || is_android || is_ios) {
1077       deps -= [ "//third_party/libaddressinput" ]
1078     }
1079     if (enable_remoting) {
1080       sources += rebase_path(
1081               chrome_tests_gypi_values.chrome_browser_tests_remoting_sources,
1082               ".",
1083               "//chrome")
1084       #deps += [ "//remoting:remoting_webapp" ]  TODO(GYP)
1085     }
1086     if (use_x11) {
1087       deps += [ "//tools/xdisplaycheck" ]
1088     }
1089   }
1091   # TODO(GYP): Delete this after we've converted everything to GN.
1092   # The _run targets exist only for compatibility w/ GYP.
1093   group("sync_integration_tests_run") {
1094     testonly = true
1095     deps = [
1096       ":sync_integration_tests",
1097     ]
1098   }
1100   test("sync_integration_tests") {
1101     sources =
1102         rebase_path(chrome_tests_gypi_values.sync_integration_tests_sources,
1103                     ".",
1104                     "//chrome")
1106     data = [
1107       "//chrome/test/data/sync/",
1108       "//net/tools/testserver/",
1109       "//sync/tools/testserver/",
1110       "//third_party/pyftpdlib/",
1111       "//third_party/pywebsocket/",
1112       "//third_party/tlslite/",
1113       "$root_out_dir/pyproto/",
1114       "$root_out_dir/resources.pak",
1115     ]
1117     if (is_linux || is_win) {
1118       data += [
1119         "$root_out_dir/chrome_100_percent.pak",
1120         "$root_out_dir/locales/en-US.pak",
1121       ]
1122     }
1124     # TODO(phajdan.jr): Only temporary, to make transition easier.
1125     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1127     deps = [
1128       ":sync_integration_test_support",
1129       ":test_support",
1130       "//base/allocator",
1131       "//chrome:packed_extra_resources",
1132       "//chrome:packed_resources",
1133       "//chrome:resources",
1134       "//chrome:strings",
1135       "//chrome/common",
1136       "//chrome/renderer",
1137       "//crypto:platform",
1138       "//sync",
1139       "//testing/gmock",
1140       "//testing/gtest",
1141       "//third_party/icu",
1142       "//third_party/leveldatabase",
1143       "//third_party/WebKit/public:blink",
1144     ]
1146     data_deps = [ "//third_party/mesa:osmesa" ]
1148     if (cld_version == 2) {
1149       # Language detection is irrelevant to sync, so it can depend on any
1150       # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1151       deps += [ "//third_party/cld_2:cld2_dynamic" ]
1152     }
1153     if (is_mac) {
1154       # Dictionary sync is disabled on Mac.
1155       sources -= [
1156         "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc",
1157         "../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
1158         "../browser/sync/test/integration/two_client_dictionary_sync_test.cc",
1159       ]
1161       # The sync_integration_tests do not run on mac without this flag.
1162       # Search for comments about "xcode_settings" elsewhere in this file.
1163       ldflags = [ "-Wl,-ObjC" ]
1164     }
1165     if (is_win) {
1166       deps += [
1167         "//chrome:other_version",
1168         "//third_party/wtl",
1169         "//ui/resources",
1170       ]
1172       configs -= [ "//build/config/win:default_incremental_linking" ]
1173       configs +=
1174           [ "//build/config/win:default_large_module_incremental_linking" ]
1175     } else {
1176       sources -= [ "../app/chrome_version.rc.version" ]
1177     }
1178     if (!is_chromeos) {
1179       sources -= [
1180         "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc",
1181         "../browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc",
1182       ]
1183     }
1185     if (toolkit_views) {
1186       deps += [ "//ui/views" ]
1187     }
1188     if (enable_basic_printing || enable_print_preview) {
1189       deps += [ "//printing" ]
1190     }
1191     if (!enable_app_list) {
1192       sources -= [
1193         "../browser/sync/test/integration/single_client_app_list_sync_test.cc",
1194         "../browser/sync/test/integration/two_client_app_list_sync_test.cc",
1195       ]
1196     }
1197     if (!enable_supervised_users) {
1198       sources -= [ "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc" ]
1199     }
1200   }
1202   test("sync_performance_tests") {
1203     sources =
1204         rebase_path(chrome_tests_gypi_values.sync_performance_tests_sources,
1205                     ".",
1206                     "//chrome")
1208     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1210     deps = [
1211       ":sync_integration_test_support",
1212       "//base/allocator",
1213       "//crypto:platform",
1214       "//sync",
1215       "//testing/gmock",
1216       "//testing/gtest",
1217     ]
1219     if (cld_version == 2) {
1220       # Language detection is irrelevant to sync, so it can depend on any
1221       # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1222       deps += [ "//third_party/cld_2:cld2_dynamic" ]
1223     }
1225     if (is_mac) {
1226       # Dictionary sync is disabled on Mac.
1227       sources -= [ "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc" ]
1229       # The sync_performance_tests do not run on mac without this flag.
1230       # Search for comments about "xcode_settings" elsewhere in this file.
1231       ldflags = [ "-Wl,-ObjC" ]
1232     }
1233     if (is_win) {
1234       deps += [
1235         "//chrome:other_version",
1236         "//chrome/installer/util:strings",
1237         "//third_party/wtl",
1238         "//ui/resources",
1239       ]
1240       configs -= [ "//build/config/win:default_incremental_linking" ]
1241       configs +=
1242           [ "//build/config/win:default_large_module_incremental_linking" ]
1243     } else {
1244       sources -= [ "../app/chrome_version.rc.version" ]
1245     }
1247     if (toolkit_views) {
1248       deps += [ "//ui/views" ]
1249     }
1250   }
1252   # Executable to measure time to load libraries.
1253   test("load_library_perf_tests") {
1254     sources = [
1255       "../browser/load_library_perf_test.cc",
1256     ]
1258     deps = [
1259       "//base/test:test_support_perf",
1260       "//testing/gtest",
1261       "//testing/perf",
1262       "//third_party/widevine/cdm:version_h",
1263     ]
1265     if (enable_pepper_cdms) {
1266       data_deps = [
1267         "//media/cdm/ppapi:clearkeycdmadapter",
1268         "//third_party/widevine/cdm:widevinecdmadapter",
1269       ]
1270     }
1271   }
1273   js2gtest("unit_tests_js") {
1274     test_type = "unit"
1275     sources = rebase_path(
1276             chrome_tests_unit_gypi_values.chrome_unit_tests_gtestjs_sources,
1277             ".",
1278             "//chrome")
1279     extra_js_files =
1280         rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_js_sources,
1281                     ".",
1282                     "//chrome")
1283     if (is_chromeos) {
1284       sources += rebase_path(
1285               chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_gtestjs_sources,
1286               ".",
1287               "//chrome")
1288       extra_js_files += rebase_path(
1289               chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_js_sources,
1290               ".",
1291               "//chrome")
1292     }
1293   }
1295   # TODO(GYP): Delete this after we've converted everything to GN.
1296   # The _run targets exist only for compatibility w/ GYP.
1297   group("unit_tests_run") {
1298     testonly = true
1299     deps = [
1300       ":unit_tests",
1301     ]
1302   }
1304   test("unit_tests") {
1305     sources =
1306         rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_sources,
1307                     ".",
1308                     "//chrome")
1310     configs += [ "//build/config:precompiled_headers" ]
1312     data = [
1313       "data/",
1314       "//base/test/data/",
1315       "//chrome/third_party/mock4js/",
1316       "//components/test/data/",
1317       "//extensions/test/data/",
1318       "//google_apis/test/data/",
1319       "//net/data/",
1320       "//net/tools/testserver/",
1321       "//third_party/accessibility-audit/axs_testing.js",
1322       "//third_party/hunspell_dictionaries/",
1323       "//third_party/pyftpdlib/",
1324       "//third_party/pywebsocket/",
1325       "//third_party/tlslite/",
1326       "//third_party/zlib/google/test/data/",
1327       "//tools/metrics/histograms/histograms.xml",
1328       "$root_out_dir/pyproto/google/",
1329       "$root_out_dir/test_data/chrome/browser/resources/google_now/",
1330       "$root_out_dir/test_data/chrome/browser/resources/print_preview/",
1331       "$root_out_dir/test_data/chrome/renderer/resources/extensions/",
1332       "$root_out_dir/test_data/ui/webui/",
1333       "$root_out_dir/resources.pak",
1334     ]
1335     if (is_android || is_linux || is_win) {
1336       data += [
1337         "$root_out_dir/chrome_100_percent.pak",
1338         "$root_out_dir/locales/en-US.pak",
1339       ]
1340     }
1342     defines = []
1344     deps = [
1345       # NOTE: New depndencies should generally be added in the OS!="ios"
1346       # dependencies block below, rather than here.
1347       # Unit tests should only depend on:
1348       # 1) everything that the chrome binaries depend on:
1349       "//chrome:browser_dependencies",
1350       "//chrome:child_dependencies",
1352       # 2) test-specific support libraries:
1353       ":test_support_unit",
1354       "//base/test:test_support",
1355       "//chrome/test:test_support",
1356       "//components/resources",
1357       "//components/content_settings/core/test:test_support",
1358       "//content/test:test_support",
1359       "//content/public/app:both",
1360       "//crypto:platform",
1361       "//crypto:test_support",
1362       "//net",
1363       "//net:test_support",
1364       "//sync:test_support_sync_api",
1365       "//sync:test_support_sync_core",
1366       "//sync:test_support_sync_internal_api",
1367       "//testing/gmock",
1368       "//testing/gtest",
1370       # 3) anything tests directly depend on
1371       "//base/allocator",
1372       "//chrome:resources",
1373       "//chrome:strings",
1374       "//courgette:courgette_lib",
1375       "//google_apis",
1376       "//skia",
1377       "//third_party/cacheinvalidation",
1378       "//third_party/icu",
1379       "//third_party/libxml",
1380       "//ui/base:test_support",
1381       "//ui/gfx:test_support",
1382       "//ui/resources",
1383     ]
1384     data_deps = []
1386     # TODO(GYP) Windows stuff
1387     # ['incremental_chrome_dll==1', {
1388     #   'UseLibraryDependencyInputs': "true",
1390     if (!is_ios) {
1391       deps += [
1392         ":unit_tests_js",
1393         "//components/audio_modem:test_support",
1394         "//components/autofill/content/browser/wallet:test_support",
1395         "//components/autofill/content/renderer:test_support",
1396         "//components/metrics/proto",
1397         "//components/data_reduction_proxy/core/browser:test_support",
1398         "//components/safe_json:test_support",
1399         "//components/webdata_services:test_support",
1400         "//components/strings",
1401         "//device/bluetooth:mocks",
1402         "//content/app/resources",
1403         "//gpu:test_support",
1404         "//media:test_support",
1406         #'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared',  TODO(GYP)
1407         "//third_party/leveldatabase",
1408         "//third_party/libaddressinput",
1409         "//third_party/libjingle",
1410         "//third_party/libphonenumber",
1411         "//third_party/webrtc/modules/desktop_capture",
1412         "//tools/json_schema_compiler/test",
1413         "//ui/gl",
1414         "//v8",
1415       ]
1416     }
1418     if (is_android) {
1419       deps -= [ "//third_party/libaddressinput" ]
1421       # Some android targets still depend on --gc-sections to link.
1422       # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
1423       ldflags = [ "-Wl,--gc-sections" ]
1424       deps += [ "//testing/android/native_test:native_test_native_code" ]
1425       isolate_file = "../unit_tests.isolate"
1426     } else {
1427       sources += rebase_path(
1428               chrome_tests_unit_gypi_values.chrome_unit_tests_non_android_sources,
1429               ".",
1430               "//chrome")
1431     }
1432     if (is_ios || is_chromeos) {
1433       sources -=
1434           [ "../browser/metrics/signin_status_metrics_provider_unittest.cc" ]
1435     }
1436     if (enable_background) {
1437       sources += rebase_path(
1438               chrome_tests_unit_gypi_values.chrome_unit_tests_background_sources,
1439               ".",
1440               "//chrome")
1441     }
1442     if (enable_spellcheck) {
1443       sources += rebase_path(
1444               chrome_tests_unit_gypi_values.chrome_unit_tests_spellchecker_sources,
1445               ".",
1446               "//chrome")
1447       if (is_mac && !is_ios) {
1448         deps += [ "//third_party/hunspell" ]
1449       }
1450     }
1452     if (enable_one_click_signin) {
1453       sources += [
1454         "../browser/ui/sync/one_click_signin_sync_observer_unittest.cc",
1455         "../browser/ui/sync/one_click_signin_sync_starter_unittest.cc",
1456       ]
1457     }
1459     if (enable_extensions) {
1460       sources += rebase_path(
1461               chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_sources,
1462               ".",
1463               "//chrome")
1464       deps += [
1465         "//chrome/common/extensions/api",
1466         "//device/usb:mocks",
1467         "//extensions:extensions_resources",
1468         "//extensions/strings",
1469       ]
1470       if (enable_configuration_policy) {
1471         sources += rebase_path(
1472                 chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_policy_sources,
1473                 ".",
1474                 "//chrome")
1475       }
1476       if (!is_chromeos) {
1477         sources += rebase_path(
1478                 chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources,
1479                 ".",
1480                 "//chrome")
1481       }
1482     }
1483     if (toolkit_views) {
1484       deps += [
1485         "//components/web_modal:test_support",
1486         "//ui/views",
1487         "//ui/views:test_support",
1488       ]
1489       sources += rebase_path(
1490               chrome_tests_unit_gypi_values.chrome_unit_tests_views_sources,
1491               ".",
1492               "//chrome")
1493       if (!is_mac) {
1494         sources += rebase_path(
1495                 chrome_tests_unit_gypi_values.chrome_unit_tests_views_non_mac_sources,
1496                 ".",
1497                 "//chrome")
1498       }
1499     }
1500     if (use_ash) {
1501       sources += rebase_path(
1502               chrome_tests_unit_gypi_values.chrome_unit_tests_ash_sources,
1503               ".",
1504               "//chrome")
1505       deps += [
1506         "//ash:test_support",
1507         "//ash/resources",
1508         "//ash/strings",
1509       ]
1511       # We eventually want to compile both in Win Aura builds, see
1512       # http://crbug.com/155545.
1513       if (!is_win) {
1514         sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ]
1515       }
1516     }
1517     if (use_aura) {
1518       sources += [ "//ui/views/controls/webview/webview_unittest.cc" ]
1519       deps += [
1520         "//ui/wm",
1521         "//ui/aura:test_support",
1522         "//ui/views:test_support",
1523       ]
1524     }
1525     if (!is_chromeos && is_linux) {
1526       sources += rebase_path(
1527               chrome_tests_unit_gypi_values.chrome_unit_tests_desktop_linux_sources,
1528               ".",
1529               "//chrome")
1530     }
1531     if (!is_chromeos && !use_ozone && is_linux) {
1532       deps += [
1533         "//chrome/browser/ui/libgtk2ui",
1534         "//build/config/linux:gio",
1535       ]
1536     }
1538     if (enable_task_manager) {
1539       sources += rebase_path(
1540               chrome_tests_unit_gypi_values.chrome_unit_tests_task_manager_sources,
1541               ".",
1542               "//chrome")
1543     }
1544     if (enable_mdns) {
1545       sources += rebase_path(
1546               chrome_tests_unit_gypi_values.chrome_unit_tests_mdns_sources,
1547               ".",
1548               "//chrome")
1549     }
1550     if (enable_service_discovery) {
1551       sources += rebase_path(
1552               chrome_tests_unit_gypi_values.chrome_unit_tests_service_discovery_sources,
1553               ".",
1554               "//chrome")
1555     }
1556     if (enable_configuration_policy) {
1557       sources += rebase_path(
1558               chrome_tests_unit_gypi_values.chrome_unit_tests_configuration_policy_sources,
1559               ".",
1560               "//chrome")
1561       if (is_chromeos) {
1562         sources -=
1563             [ "../browser/policy/cloud/user_policy_signin_service_unittest.cc" ]
1564       } else if (is_android) {
1565         sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ]
1566       }
1567       if (!is_android && !is_ios && !is_chromeos) {
1568         sources +=
1569             [ "../browser/net/disk_cache_dir_policy_handler_unittest.cc" ]
1570       }
1571       if (!is_android && !is_ios) {
1572         sources +=
1573             [ "../browser/download/download_dir_policy_handler_unittest.cc" ]
1574       }
1575     }
1576     if (enable_web_speech) {
1577       sources += rebase_path(
1578               chrome_tests_unit_gypi_values.chrome_unit_tests_speech_sources,
1579               ".",
1580               "//chrome")
1581     }
1582     if (enable_notifications) {
1583       sources += rebase_path(
1584               chrome_tests_unit_gypi_values.chrome_unit_tests_notifications_sources,
1585               ".",
1586               "//chrome")
1587       if (is_android) {
1588         sources -= [
1589           # Android does not use the Message Center notification system.
1590           "../browser/notifications/message_center_notifications_unittest.cc",
1591           "../browser/notifications/message_center_settings_controller_unittest.cc",
1592         ]
1593       }
1594     }
1595     if (safe_browsing_mode == 1) {
1596       # TODO(sgurun): enable tests for safe_browsing==2.
1597       sources += rebase_path(
1598               chrome_tests_unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources,
1599               ".",
1600               "//chrome")
1601       deps += [ ":test_proto" ]
1602       if (is_android) {
1603         deps -= [ ":test_proto" ]
1604         sources -= [
1605           # Android doesn't support download feedbacks.
1606           "../browser/safe_browsing/download_feedback_service_unittest.cc",
1607           "../browser/safe_browsing/download_feedback_unittest.cc",
1608           "../browser/safe_browsing/download_protection_service_unittest.cc",
1609           "../browser/safe_browsing/two_phase_uploader_unittest.cc",
1610           "../common/safe_browsing/ipc_protobuf_message_test_messages.h",
1611           "../common/safe_browsing/ipc_protobuf_message_unittest.cc",
1612         ]
1613       }
1614     }
1615     if (enable_autofill_dialog && !is_android) {
1616       sources += rebase_path(
1617               chrome_tests_unit_gypi_values.chrome_unit_tests_autofill_dialog_sources,
1618               ".",
1619               "//chrome")
1620     }
1621     if (enable_plugins) {
1622       sources += rebase_path(
1623               chrome_tests_unit_gypi_values.chrome_unit_tests_plugins_sources,
1624               ".",
1625               "//chrome")
1626     }
1627     if (enable_print_preview) {
1628       sources += rebase_path(
1629               chrome_tests_unit_gypi_values.chrome_unit_tests_print_preview_sources,
1630               ".",
1631               "//chrome")
1632     }
1633     if (enable_captive_portal_detection) {
1634       sources += rebase_path(
1635               chrome_tests_unit_gypi_values.chrome_unit_tests_captive_portal_sources,
1636               ".",
1637               "//chrome")
1638     }
1639     if (enable_session_service) {
1640       sources += rebase_path(
1641               chrome_tests_unit_gypi_values.chrome_unit_tests_session_service_sources,
1642               ".",
1643               "//chrome")
1644     }
1645     if (enable_media_router) {
1646       sources += rebase_path(
1647               chrome_tests_unit_gypi_values.chrome_unit_tests_media_router_sources,
1648               ".",
1649               "//chrome")
1650       deps += [ "//chrome/browser/media/router:test_support" ]
1651       if (!is_android) {
1652         sources += rebase_path(
1653                 chrome_tests_unit_gypi_values.chrome_unit_tests_media_router_non_android_sources,
1654                 ".",
1655                 "//chrome")
1656       }
1657       if (!toolkit_views) {
1658         sources -= [ "../browser/ui/views/media_router/media_router_ui_browsertest.cc" ]
1659       }
1660     }
1661     if (enable_webrtc) {
1662       sources += rebase_path(
1663               chrome_tests_unit_gypi_values.chrome_unit_tests_webrtc_sources,
1664               ".",
1665               "//chrome")
1666     }
1667     if (is_chromeos) {
1668       deps += [ "//chrome/browser/chromeos:unit_tests" ]
1669       sources -= [
1670         "../browser/signin/signin_global_error_unittest.cc",
1671         "../browser/signin/signin_manager_unittest.cc",
1672         "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc",
1673         "../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
1674         "../browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc",
1675       ]
1676     }
1677     if (use_x11) {
1678       deps += [ "//ui/events/devices" ]
1679       data_deps += [ "//tools/xdisplaycheck" ]
1680     } else {
1681       sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ]
1682     }
1683     if (cld_version == 2) {
1684       # Unit tests should be independent of the CLD2 access mechanism, just use
1685       # static for simplicity.
1686       deps += [ "//third_party/cld_2:cld2_static" ]
1687     }
1688     if (is_desktop_linux && current_cpu == "x64") {
1689       # Only add this test for 64 bit builds because otherwise we need the 32
1690       # bit library on 64 bit systems when running this test.
1691       sources +=
1692           [ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ]
1693       configs += [
1694         "//chrome/browser:gnome_keyring",
1695         "//chrome/browser:gnome_keyring_direct",
1696       ]
1697     }
1698     if (is_linux && !is_chromeos) {
1699       sources +=
1700           [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ]
1701     }
1702     if (is_linux && use_aura) {
1703       deps += [
1704         "//dbus",
1705         "//dbus:test_support",
1706         "//ui/aura:test_support",
1707       ]
1708     }
1709     if (is_linux && is_chrome_branded && current_cpu == "x86") {
1710       ldflags = [ "-Wl,--strip-debug" ]
1711     }
1712     if (is_mac) {
1713       sources += rebase_path(
1714               chrome_tests_unit_gypi_values.chrome_unit_tests_mac_sources,
1715               ".",
1716               "//chrome")
1717       sources -= [
1718         "../browser/ui/tests/ui_gfx_image_unittest.cc",
1719         "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
1720         "../tools/convert_dict/convert_dict_unittest.cc",
1721       ]
1723       # The test fetches resources which means Mac need the app bundle to exist
1724       # on disk so it can pull from it.
1725       deps += [
1726         "//third_party/google_toolbox_for_mac",
1727         "//third_party/ocmock",
1728       ]
1730       # TODO(mark): We really want this for all non-static library targets,
1731       # but when we tried to pull it up to the common.gypi level, it broke
1732       # other things like the ui and startup tests. *shrug*
1733       ldflags = [ "-Wl,-ObjC" ]
1734     }
1735     if (!is_mac && !is_ios) {
1736       deps += [
1737         "//chrome/tools/convert_dict:lib",
1738         "//chrome:packed_extra_resources",
1739         "//chrome:packed_resources",
1740         "//third_party/hunspell",
1741       ]
1742     }
1743     if (is_win || is_mac) {
1744       sources += rebase_path(
1745               chrome_tests_unit_gypi_values.chrome_unit_tests_win_mac_sources,
1746               ".",
1747               "//chrome")
1748     }
1749     if (is_win || is_mac || is_chromeos) {
1750       sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ]
1751     }
1752     if (enable_rlz_support) {
1753       sources += [ "../browser/rlz/chrome_rlz_tracker_delegate_unittest.cc" ]
1754       deps += [
1755         "//chrome/browser:rlz",
1756         "//components/rlz",
1757         "//rlz:test_support",
1758       ]
1759     }
1760     if (is_win) {
1761       # The PDB gets too large for incremental linking.
1762       configs -= [ "//build/config/win:default_incremental_linking" ]
1763       configs += [ "//build/config/win:no_incremental_linking" ]
1765       sources += rebase_path(
1766               chrome_tests_unit_gypi_values.chrome_unit_tests_win_sources,
1767               ".",
1768               "//chrome")
1769       deps += [
1770         #'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_1',  TODO(GYP) bug 512919
1771         #'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_2',  TODO(GYP) bug 512919
1772         "//chrome:other_version",
1773         "//chrome_elf:blacklist_test_dll_1",
1774         "//chrome/installer/util:strings",
1775         "//third_party/iaccessible2",
1776         "//third_party/isimpledom",
1777         "//third_party/wtl",
1778         "//ui/resources",
1779       ]
1781       libs = [
1782         "comsupp.lib",
1783         "oleacc.lib",
1784         "rpcrt4.lib",
1785         "urlmon.lib",
1786         "winmm.lib",
1787       ]
1788       if (!is_chrome_branded) {
1789         sources -= [ "../browser/google/google_update_win_unittest.cc" ]
1790       }
1791     }
1792     if (is_android || is_ios) {
1793       sources -= [
1794         "../browser/devtools/device/webrtc/devtools_bridge_instances_request_unittest.cc",
1795         "../browser/ui/sync/sync_promo_ui_unittest.cc",
1796       ]
1797     } else {
1798       sources -= [
1799         "../browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc",
1800         "../browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc",
1801       ]
1802       deps += [ "//chrome/tools/profile_reset:jtl_compiler_lib" ]
1803     }
1804     if (!is_android && !is_chromeos) {
1805       sources += rebase_path(
1806               chrome_tests_unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources,
1807               ".",
1808               "//chrome")
1809     }
1810     if (enable_themes) {
1811       sources += rebase_path(
1812               chrome_tests_unit_gypi_values.chrome_unit_tests_themes_sources,
1813               ".",
1814               "//chrome")
1815     }
1816     if (!is_android && (use_nss_certs || use_openssl_certs)) {
1817       sources += [ "../common/net/x509_certificate_model_unittest.cc" ]
1818     }
1819     if (enable_supervised_users) {
1820       sources += rebase_path(
1821               chrome_tests_unit_gypi_values.chrome_unit_tests_supervised_user_sources,
1822               ".",
1823               "//chrome")
1824     }
1825     if (enable_supervised_users && !is_android && !is_ios) {
1826       sources += rebase_path(
1827               chrome_tests_unit_gypi_values.chrome_unit_tests_supervised_user_legacy_sources,
1828               ".",
1829               "//chrome")
1830     }
1831     if (safe_browsing_mode == 1 && enable_extensions) {
1832       sources += [ "../browser/extensions/blacklist_unittest.cc" ]
1833     }
1834     if (cld_version == 1) {
1835       sources += [ "//third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc" ]
1836       defines += [ "CLD_WINDOWS" ]
1837       deps += [ "//third_party/cld" ]
1838     }
1839     if (enable_app_list) {
1840       sources += rebase_path(
1841               chrome_tests_unit_gypi_values.chrome_unit_tests_app_list_sources,
1842               ".",
1843               "//chrome")
1844       deps += [ "//ui/app_list:test_support" ]
1845     }
1846     if (enable_app_list && is_chromeos) {
1847       sources += rebase_path(
1848               chrome_tests_unit_gypi_values.chrome_unit_tests_app_list_chromeos_sources,
1849               ".",
1850               "//chrome")
1851     }
1852     if (enable_plugins && !enable_plugin_installation) {
1853       sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]
1854     }
1855   }
1857   if (is_win || (is_linux && !is_chromeos)) {
1858     # TODO(GYP): Figure out which of these work and are needed on other
1859     # platforms.
1860     test("chrome_app_unittests") {
1861       sources = [
1862         "../app/chrome_watcher_client_unittest_win.cc",
1863         "../app/chrome_watcher_client_win.cc",
1864         "../app/chrome_watcher_command_line_unittest_win.cc",
1865         "../app/chrome_watcher_command_line_win.cc",
1866         "../app/delay_load_hook_unittest_win.cc",
1867         "../app/delay_load_hook_win.cc",
1868         "../app/delay_load_hook_win.h",
1869         "../app/signature_validator_win.cc",
1870         "../app/signature_validator_win.h",
1871         "../app/signature_validator_win_unittest.cc",
1872         "../common/crash_keys.cc",
1873         "../common/crash_keys.h",
1874       ]
1876       deps = [
1877         ":test_support",
1878         "//breakpad:client",
1879         "//chrome/browser",
1880         "//chrome/child",
1881         "//base/test:run_all_unittests",
1882         "//base/test:test_support",
1883       ]
1884       if (cld_version == 2) {
1885         # Use whatever CLD2 data access mode that the
1886         # application embedder is using.
1887         deps += [ "//third_party/cld_2:cld2_platform_impl" ]
1888       }
1889     }
1891     test("performance_browser_tests") {
1892       sources = rebase_path(
1893               chrome_tests_gypi_values.performance_browser_tests_sources,
1894               ".",
1895               "//chrome")
1897       defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1899       deps = [
1900         ":test_support",
1901         "//base",
1902         "//base:i18n",
1903         "//base/test:test_support",
1904         "//chrome/browser",
1905         "//chrome/renderer",
1906         "//components/autofill/content/browser/wallet:test_support",
1907         "//components/autofill/content/renderer:test_support",
1908         "//media/cast:test_support",
1909         "//testing/gmock",
1910         "//testing/gtest",
1911         "//testing/perf",
1912       ]
1914       if (is_win) {
1915         configs -= [ "//build/config/win:default_incremental_linking" ]
1916         configs +=
1917             [ "//build/config/win:default_large_module_incremental_linking" ]
1918       } else {
1919         sources -= [
1920           "../app/chrome_command_ids.h",
1922           #"../app/chrome_dll.rc",
1923           #"../app/chrome_dll_resource.h",
1924           "../app/chrome_version.rc.version",
1925         ]
1926       }
1927       if (!is_mac) {
1928         sources -= [ "perf/mach_ports_performancetest.cc" ]
1929       }
1931       if (cld_version == 2) {
1932         # Use whatever CLD2 data access mode that the
1933         # application embedder is using.
1934         deps += [ "//third_party/cld_2:cld2_platform_impl" ]
1935       }
1936     }
1937   }
1940 source_set("test_support_unit") {
1941   testonly = true
1942   sources = [
1943     "../browser/sync/glue/session_sync_test_helper.cc",
1944     "../browser/sync/glue/session_sync_test_helper.h",
1945     "base/run_all_unittests.cc",
1946   ]
1948   deps = [
1949     ":test_support",
1950     "//base",
1951     "//chrome:resources",
1952     "//chrome:strings",
1953     "//chrome/browser",
1954     "//chrome/common",
1955     "//mojo/environment:chromium",
1956     "//third_party/mojo/src/mojo/edk/system",
1957   ]
1959   if (!is_android && use_ash) {
1960     sources += rebase_path(
1961             chrome_tests_unit_gypi_values.chrome_test_support_unit_ash_sources,
1962             ".",
1963             "//chrome")
1964   }