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