Add ICU message format support
[chromium-blink-merge.git] / chrome / test / BUILD.gn
blobe6e4089cb3b1cd1a2bc9097a7f62f58fe9843665
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       "//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: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   test("browser_tests") {
588     sources = [
589       "base/browser_tests_main.cc",
590     ]
591     sources +=
592         rebase_path(chrome_tests_gypi_values.chrome_browser_tests_sources,
593                     ".",
594                     "//chrome")
595     sources += rebase_path(
596             chrome_tests_gypi_values.chrome_browser_extensions_test_support_sources,
597             ".",
598             "//chrome")
600     configs += [ "//build/config:precompiled_headers" ]
602     deps = [
603       ":browser_tests_js_webui",
604       ":sync_integration_test_support",
605       ":test_support",
606       "//base",
607       "//base:i18n",
608       "//base/allocator",
609       "//base/test:test_support",
610       "//chrome:browser_tests_pak",
611       "//chrome:packed_extra_resources",
612       "//chrome:packed_resources",
613       "//chrome:resources",
614       "//chrome:strings",
615       "//chrome/browser",
616       "//chrome/browser/resources:extension_resource_demo",
617       "//chrome/common/extensions/api",
618       "//chrome/renderer",
619       "//components/autofill/content/browser:risk_proto",
620       "//components/autofill/content/browser/wallet:test_support",
621       "//components/autofill/content/renderer:test_support",
622       "//components/captive_portal:test_support",
623       "//components/dom_distiller/content:content_browser",
624       "//components/dom_distiller/core:test_support",
625       "//components/guest_view/browser:test_support",
626       "//components/resources",
627       "//components/strings",
628       "//components/translate/core/common",
629       "//components/user_manager:test_support",
630       "//crypto:platform",
631       "//crypto:test_support",
632       "//device/bluetooth:mocks",
633       "//device/serial:test_support",
634       "//extensions/common/api",
635       "//google_apis:test_support",
636       "//media",
637       "//media/base:test_support",
638       "//media/cast:test_support",
639       "//net",
640       "//net:test_support",
641       "//sdch",
642       "//skia",
643       "//sync",
644       "//sync:test_support_sync_api",
645       "//testing/gmock",
646       "//testing/gtest",
647       "//testing/perf",
648       "//third_party/cacheinvalidation",
649       "//third_party/icu",
650       "//third_party/leveldatabase",
651       "//third_party/libaddressinput",
652       "//third_party/libjingle",
653       "//third_party/safe_browsing:test_support",
654       "//third_party/webrtc/modules/desktop_capture",
655       "//third_party/widevine/cdm:version_h",
656       "//ui/accessibility:test_support",
657       "//ui/base:test_support",
658       "//ui/compositor:test_support",
659       "//ui/resources",
660       "//ui/web_dialogs:test_support",
661       "//v8",
662     ]
664     # TODO(rockot) bug 505926: The chrome_extensions_browsertests target should
665     # be deleted and this line removed. See the chrome_extensions_browsertests
666     # target for more.
667     deps += [ "//extensions:chrome_extensions_browsertests" ]
669     # Runtime dependencies
670     data_deps = [
671       "//ppapi:ppapi_tests",
672       "//ppapi:power_saver_test_plugin",
673       "//remoting/webapp:browser_test_resources",
674       "//remoting/webapp:unit_tests",
675       "//third_party/mesa:osmesa",
676       "//third_party/widevine/cdm:widevine_test_license_server",
677     ]
679     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
681     # TODO(GYP) if (is_win) {
682     #       ['incremental_chrome_dll==1', {
683     #         'UseLibraryDependencyInputs': "true",
684     # }
686     if (cld_version == 2) {
687       # Because the browser_tests use translate, they need CLD data.
688       deps += [ "//third_party/cld_2:cld2_platform_impl" ]
689     }
691     if (!enable_one_click_signin) {
692       sources -= [ "../browser/ui/sync/one_click_signin_bubble_links_delegate_browsertest.cc" ]
693     }
694     if (enable_nacl) {
695       sources += [
696         "../browser/extensions/extension_nacl_browsertest.cc",
697         "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc",
698       ]
699       deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
701       if (enable_nacl_untrusted) {
702         sources += [
703           "nacl/nacl_browsertest.cc",
704           "nacl/nacl_browsertest_uma.cc",
705           "nacl/nacl_browsertest_util.cc",
706           "nacl/nacl_browsertest_util.h",
707           "nacl/pnacl_header_test.cc",
708           "nacl/pnacl_header_test.h",
709         ]
711         # TODO(GYP): Make NaCl work in other configs and update the irt
712         # dependency as appropriate. We should probably push this
713         # dependency into ppapi/native_client so that clients don't need
714         # to know all of the different toolchain options.
715         assert(current_cpu == "x64")
716         data_deps += [
717           # "test/data/nacl:shared_test_files",  # TODO(GYP) bug 512902
718           "//ppapi/native_client:nacl_irt(//native_client/build/toolchain/nacl:irt_x64)",
719           # "../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests",  # TODO(GYP) bug 512901
720           # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive",  # TODO(GYP) bug 512900
721           # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries",  # TODO(GYP) bug 512900
722           # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app",  # TODO(GYP) bug 512900
723         ]
724         if (is_chromeos) {
725           sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ]
726           deps += [
727             "//chrome/browser/chromeos",
728             #'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data',  TODO(GYP) bug 512906
729           ]
730         }
731       }
732       if (is_win || is_linux) {
733         sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ]
734         deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ]
735       }
736       if (is_win) {
737         # TODO(halyavin) NaCl on Windows can't open debug stub socket in
738         # browser process as needed by this test. See http://crbug.com/157312.
739         sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ]
740         deps += [
741           #'chrome.gyp:chrome_nacl_win64',  TODO(GYP) bug 512869
742         ]
743         configs -= [ "//build/config/win:default_incremental_linking" ]
744         configs +=
745             [ "//build/config/win:default_large_module_incremental_linking" ]
746       }
747       if (is_linux) {
748         deps += [
749           "//native_client/src/trusted/service_runtime/linux:munge_nacl_helper_bootstrap",
750           "//components/nacl:nacl_helper",
752           # "//components/nacl_nonsfi.gyp:nacl_helper_nonsfi",  # TODO(GYP) bug 512912.
753         ]
754       }
755     }
756     if (debug_devtools) {
757       defines += [ "DEBUG_DEVTOOLS=1" ]
758     }
759     if (use_ash) {
760       deps += [ "//ash:test_support" ]
761     }
762     if (use_aura || toolkit_views) {
763       deps += [ "//ui/events:test_support" ]
764     }
765     if (toolkit_views) {
766       sources += rebase_path(
767               chrome_tests_gypi_values.chrome_browser_tests_views_sources,
768               ".",
769               "//chrome")
770       deps += [ "//ui/views" ]
771       if (!is_mac) {
772         sources += rebase_path(
773                 chrome_tests_gypi_values.chrome_browser_tests_views_non_mac_sources,
774                 ".",
775                 "//chrome")
776       }
777     }
778     if (is_chromeos) {
779       sources += rebase_path(
780               chrome_tests_gypi_values.chrome_browser_tests_chromeos_sources,
781               ".",
782               "//chrome")
783       sources -= [
784         "../../apps/load_and_launch_browsertest.cc",
785         "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
786         "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
788         # chromeos does not support profile list avatar menu
789         "../browser/profiles/profile_list_desktop_browsertest.cc",
790         "../browser/service_process/service_process_control_browsertest.cc",
792         # chromeos does not use cross-platform panels
793         "../browser/ui/panels/panel_extension_browsertest.cc",
795         # chromeos does not use the desktop user manager
796         "../browser/ui/webui/signin/user_manager_ui_browsertest.cc",
797       ]
798       deps += [
799         "//dbus",
800         "//dbus:test_support",
801         "//ui/login:resources",
802       ]
803     } else {
804       sources -= [
805         "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
806         "../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc",
807         "../browser/extensions/api/terminal/terminal_private_apitest.cc",
808         "../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
809         "../browser/net/nss_context_chromeos_browsertest.cc",
810         "../browser/ui/ash/keyboard_controller_browsertest.cc",
811         "data/webui/certificate_viewer_ui_test-inl.h",
812       ]
813       if (toolkit_views) {
814         sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ]
815       }
816     }
817     if (enable_configuration_policy) {
818       sources += rebase_path(
819               chrome_tests_gypi_values.chrome_browser_tests_policy_sources,
820               ".",
821               "//chrome")
822     }
823     if (enable_web_speech) {
824       sources += rebase_path(
825               chrome_tests_gypi_values.chrome_browser_tests_speech_sources,
826               ".",
827               "//chrome")
828     }
829     if (safe_browsing_mode == 1) {
830       sources += rebase_path(
831               chrome_tests_gypi_values.chrome_browser_tests_full_safe_browsing_sources,
832               ".",
833               "//chrome")
834     }
835     if (enable_captive_portal_detection) {
836       sources += [ "../browser/captive_portal/captive_portal_browsertest.cc" ]
837     }
838     if (!enable_webrtc) {
839       sources -= [
840         "../browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc",
841         "../browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc",
842         "../browser/media/chrome_webrtc_browsertest.cc",
843         "../browser/media/chrome_webrtc_disable_encryption_flag_browsertest.cc",
844         "../browser/media/chrome_webrtc_getmediadevices_browsertest.cc",
845       ]
846     }
847     if (enable_media_router) {
848       sources += rebase_path(
849               chrome_tests_gypi_values.chrome_browser_tests_media_router_sources,
850               ".",
851               "//chrome")
852       deps += [ "//chrome/browser/media/router:test_support" ]
853     }
854     if (is_win) {
855       deps += [
856         "//chrome:other_version",
857         "//third_party/wtl",
858         "//ui/resources",
859       ]
860     } else {
861       sources -= [
862         "../app/chrome_command_ids.h",
863         "../app/chrome_dll_resource.h",
864         "../app/chrome_version.rc.version",
865         "../browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc",
866       ]
867     }
868     if (!is_chromeos && use_aura) {
869       sources -= [
870         # On Windows and Linux, we currently don't support enough of the
871         # ash environment to run these unit tests.
872         #
873         # TODO: enable these on windows and linux.
874         "../browser/ui/ash/accelerator_commands_browsertest.cc",
875         "../browser/ui/ash/accelerator_controller_browsertest.cc",
876         "../browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc",
877         "../browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc",
878         "../browser/ui/ash/shelf_browsertest.cc",
879         "../browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc",
880       ]
881     }
882     if (is_mac) {
883       # TODO(mark): We really want this for all non-static library
884       # targets, but when we tried to pull it up to the common.gypi
885       # level, it broke other things like the ui and startup tests. *shrug*
886       ldflags = [ "-Wl,-ObjC" ]
888       # Other platforms only need
889       # chrome_resources.gyp:{packed_extra_resources,packed_resources},
890       # and can build this target standalone much faster.
891       deps += [
892         #'app_mode_app_support',  TODO(GYP)
893         "//chrome",
895         #'../components/components.gyp:breakpad_stubs',  TODO(GYP)
896         "//third_party/ocmock",
897       ]
898       sources += [
899         "../browser/media_galleries/fileapi/iphoto_data_provider_browsertest.cc",
900         "../browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm",
901         "../browser/spellchecker/spellcheck_message_filter_platform_mac_browsertest.cc",
902       ]
903       sources -= [
904         # TODO(groby): This test depends on hunspell and we cannot run it on
905         # Mac, which does not use hunspell by default.
906         "../browser/spellchecker/spellcheck_service_browsertest.cc",
908         # TODO(rouslan): This test depends on the custom dictionary UI,
909         # which is disabled on Mac.
910         # TODO(GYP): This should be added somewhere first ...
911         # "../browser/ui/webui/options/edit_dictionary_browsertest.js",
913         # TODO(rouslan): This test depends on hunspell and we cannot run it
914         # on Mac, which does use hunspell by default.
915         # TODO(GYP): This should be added somewhere first ...
916         # "../browser/ui/webui/options/language_options_dictionary_download_browsertest.js",
918         # ProcessSingletonMac doesn"t do anything.
919         "../browser/process_singleton_browsertest.cc",
921         # This test depends on GetCommandLineForRelaunch, which is not
922         # available on Mac.
923         "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
925         # single-process mode hangs on Mac sometimes because of multiple UI
926         # message loops. See 306348
927         "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
928         "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
929         "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
930       ]
931     }
932     if (is_mac || is_win) {
933       sources += [
934         "../browser/extensions/api/networking_private/networking_private_apitest.cc",
935         "../browser/extensions/api/networking_private/networking_private_service_client_apitest.cc",
936         "../browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc",
937         "../browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc",
938       ]
939       deps += [ "//components/wifi:test_support" ]
940     }
941     if (!is_posix || is_chromeos) {
942       sources -= [ "../common/time_format_browsertest.cc" ]
943     }
944     if (is_android) {
945       sources -= [
946         "../browser/policy/cloud/component_cloud_policy_browsertest.cc",
947         "../browser/prefs/pref_hash_browsertest.cc",
948         "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
949         "../renderer/spellchecker/spellcheck_unittest.cc",
950       ]
951     }
952     if (is_chromeos) {
953       sources += [
954         "../browser/extensions/api/networking_private/networking_private_apitest.cc",
955         "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
956       ]
957     }
958     if (!is_android && !is_ios) {
959       sources +=
960           [ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ]
961       deps += [ "//components/copresence" ]
962     }
963     if (enable_app_list) {
964       sources += rebase_path(
965               chrome_tests_gypi_values.chrome_browser_tests_app_list_sources,
966               ".",
967               "//chrome")
968     }
969     if (enable_supervised_users) {
970       sources += rebase_path(
971               chrome_tests_gypi_values.chrome_browser_tests_supervised_user_sources,
972               ".",
973               "//chrome")
974     }
975     if (enable_pepper_cdms) {
976       # Runtime dependencies.
977       data_deps += [
978         "//media/cdm/ppapi:clearkeycdmadapter",
979         "//third_party/widevine/cdm:widevinecdmadapter",
980       ]
981     }
982     if (!enable_print_preview) {
983       sources -= [
984         "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc",
985         "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
986         "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
987         "../browser/printing/print_preview_dialog_controller_browsertest.cc",
988         "../browser/printing/print_preview_pdf_generated_browsertest.cc",
989         "../browser/service_process/service_process_control_browsertest.cc",
990         "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc",
991         "data/webui/print_preview.cc",
992         "data/webui/print_preview.h",
993       ]
994     }
995     if (enable_mdns) {
996       sources += [ "../browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc" ]
997     }
998     if (use_brlapi) {
999       deps += [ "//build/config/linux:libbrlapi" ]
1000     } else {
1001       sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ]
1002     }
1003     if (is_chrome_branded) {
1004       sources -= [
1005         # These tests depend on single process mode, which is disabled in
1006         # official builds.
1007         "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
1008         "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
1009         "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
1010       ]
1011     }
1012     if (!enable_autofill_dialog || is_android || is_ios) {
1013       deps -= [ "//third_party/libaddressinput" ]
1014     }
1015     if (enable_remoting) {
1016       sources += rebase_path(
1017               chrome_tests_gypi_values.chrome_browser_tests_remoting_sources,
1018               ".",
1019               "//chrome")
1020       #deps += [ "//remoting:remoting_webapp" ]  TODO(GYP)
1021     }
1022     if (use_x11) {
1023       deps += [ "//tools/xdisplaycheck" ]
1024     }
1025   }
1027   # TODO(GYP): Delete this after we've converted everything to GN.
1028   # The _run targets exist only for compatibility w/ GYP.
1029   group("sync_integration_tests_run") {
1030     testonly = true
1031     deps = [
1032       ":sync_integration_tests",
1033     ]
1034   }
1036   test("sync_integration_tests") {
1037     sources =
1038         rebase_path(chrome_tests_gypi_values.sync_integration_tests_sources,
1039                     ".",
1040                     "//chrome")
1042     data = [
1043       "//chrome/test/data/sync/",
1044       "//net/tools/testserver/",
1045       "//sync/tools/testserver/",
1046       "//third_party/pyftpdlib/",
1047       "//third_party/pywebsocket/",
1048       "//third_party/tlslite/",
1049       "$root_out_dir/pyproto/",
1050       "$root_out_dir/resources.pak",
1051     ]
1053     if (is_linux || is_win) {
1054       data += [
1055         "$root_out_dir/chrome_100_percent.pak",
1056         "$root_out_dir/locales/en-US.pak",
1057       ]
1058     }
1060     # TODO(phajdan.jr): Only temporary, to make transition easier.
1061     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1063     deps = [
1064       ":sync_integration_test_support",
1065       ":test_support",
1066       "//base/allocator",
1067       "//chrome:packed_extra_resources",
1068       "//chrome:packed_resources",
1069       "//chrome:resources",
1070       "//chrome:strings",
1071       "//chrome/common",
1072       "//chrome/renderer",
1073       "//crypto:platform",
1074       "//sync",
1075       "//testing/gmock",
1076       "//testing/gtest",
1077       "//third_party/icu",
1078       "//third_party/leveldatabase",
1079       "//third_party/WebKit/public:blink",
1080     ]
1082     data_deps = [ "//third_party/mesa:osmesa" ]
1084     if (cld_version == 2) {
1085       # Language detection is irrelevant to sync, so it can depend on any
1086       # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1087       deps += [ "//third_party/cld_2:cld2_dynamic" ]
1088     }
1089     if (is_mac) {
1090       # Dictionary sync is disabled on Mac.
1091       sources -= [
1092         "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc",
1093         "../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
1094         "../browser/sync/test/integration/two_client_dictionary_sync_test.cc",
1095       ]
1097       # The sync_integration_tests do not run on mac without this flag.
1098       # Search for comments about "xcode_settings" elsewhere in this file.
1099       ldflags = [ "-Wl,-ObjC" ]
1100     }
1101     if (is_win) {
1102       deps += [
1103         "//chrome:other_version",
1104         "//third_party/wtl",
1105         "//ui/resources",
1106       ]
1108       configs -= [ "//build/config/win:default_incremental_linking" ]
1109       configs +=
1110           [ "//build/config/win:default_large_module_incremental_linking" ]
1111     } else {
1112       sources -= [ "../app/chrome_version.rc.version" ]
1113     }
1114     if (!is_chromeos) {
1115       sources -= [
1116         "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc",
1117         "../browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc",
1118       ]
1119     }
1121     if (toolkit_views) {
1122       deps += [ "//ui/views" ]
1123     }
1124     if (enable_basic_printing || enable_print_preview) {
1125       deps += [ "//printing" ]
1126     }
1127     if (!enable_app_list) {
1128       sources -= [
1129         "../browser/sync/test/integration/single_client_app_list_sync_test.cc",
1130         "../browser/sync/test/integration/two_client_app_list_sync_test.cc",
1131       ]
1132     }
1133     if (!enable_supervised_users) {
1134       sources -= [ "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc" ]
1135     }
1136   }
1138   test("sync_performance_tests") {
1139     sources =
1140         rebase_path(chrome_tests_gypi_values.sync_performance_tests_sources,
1141                     ".",
1142                     "//chrome")
1144     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1146     deps = [
1147       ":sync_integration_test_support",
1148       "//base/allocator",
1149       "//crypto:platform",
1150       "//sync",
1151       "//testing/gmock",
1152       "//testing/gtest",
1153     ]
1155     if (cld_version == 2) {
1156       # Language detection is irrelevant to sync, so it can depend on any
1157       # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1158       deps += [ "//third_party/cld_2:cld2_dynamic" ]
1159     }
1161     if (is_mac) {
1162       # Dictionary sync is disabled on Mac.
1163       sources -= [ "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc" ]
1165       # The sync_performance_tests do not run on mac without this flag.
1166       # Search for comments about "xcode_settings" elsewhere in this file.
1167       ldflags = [ "-Wl,-ObjC" ]
1168     }
1169     if (is_win) {
1170       deps += [
1171         "//chrome:other_version",
1172         "//chrome/installer/util:strings",
1173         "//third_party/wtl",
1174         "//ui/resources",
1175       ]
1176       configs -= [ "//build/config/win:default_incremental_linking" ]
1177       configs +=
1178           [ "//build/config/win:default_large_module_incremental_linking" ]
1179     } else {
1180       sources -= [ "../app/chrome_version.rc.version" ]
1181     }
1183     if (toolkit_views) {
1184       deps += [ "//ui/views" ]
1185     }
1186   }
1188   # Executable to measure time to load libraries.
1189   test("load_library_perf_tests") {
1190     sources = [
1191       "../browser/load_library_perf_test.cc",
1192     ]
1194     deps = [
1195       "//base/test:test_support_perf",
1196       "//testing/gtest",
1197       "//testing/perf",
1198       "//third_party/widevine/cdm:version_h",
1199     ]
1201     if (enable_pepper_cdms) {
1202       data_deps = [
1203         "//media/cdm/ppapi:clearkeycdmadapter",
1204         "//third_party/widevine/cdm:widevinecdmadapter",
1205       ]
1206     }
1207   }
1209   js2gtest("unit_tests_js") {
1210     test_type = "unit"
1211     sources = rebase_path(
1212             chrome_tests_unit_gypi_values.chrome_unit_tests_gtestjs_sources,
1213             ".",
1214             "//chrome")
1215     extra_js_files =
1216         rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_js_sources,
1217                     ".",
1218                     "//chrome")
1219     if (is_chromeos) {
1220       sources += rebase_path(
1221               chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_gtestjs_sources,
1222               ".",
1223               "//chrome")
1224       extra_js_files += rebase_path(
1225               chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_js_sources,
1226               ".",
1227               "//chrome")
1228     }
1229   }
1231   # TODO(GYP): Delete this after we've converted everything to GN.
1232   # The _run targets exist only for compatibility w/ GYP.
1233   group("unit_tests_run") {
1234     testonly = true
1235     deps = [
1236       ":unit_tests",
1237     ]
1238   }
1240   test("unit_tests") {
1241     sources =
1242         rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_sources,
1243                     ".",
1244                     "//chrome")
1246     configs += [ "//build/config:precompiled_headers" ]
1248     data = [
1249       "data/",
1250       "//base/test/data/",
1251       "//chrome/third_party/mock4js/",
1252       "//components/test/data/",
1253       "//extensions/test/data/",
1254       "//google_apis/test/data/",
1255       "//net/data/",
1256       "//net/tools/testserver/",
1257       "//third_party/accessibility-audit/axs_testing.js",
1258       "//third_party/hunspell_dictionaries/",
1259       "//third_party/pyftpdlib/",
1260       "//third_party/pywebsocket/",
1261       "//third_party/tlslite/",
1262       "//third_party/zlib/google/test/data/",
1263       "//tools/metrics/histograms/histograms.xml",
1264       "$root_out_dir/pyproto/google/",
1265       "$root_out_dir/test_data/chrome/browser/resources/google_now/",
1266       "$root_out_dir/test_data/chrome/browser/resources/print_preview/",
1267       "$root_out_dir/test_data/chrome/renderer/resources/extensions/",
1268       "$root_out_dir/test_data/ui/webui/",
1269       "$root_out_dir/resources.pak",
1270     ]
1271     if (is_android || is_linux || is_win) {
1272       data += [
1273         "$root_out_dir/chrome_100_percent.pak",
1274         "$root_out_dir/locales/en-US.pak",
1275       ]
1276     }
1278     defines = []
1280     deps = [
1281       # NOTE: New depndencies should generally be added in the OS!="ios"
1282       # dependencies block below, rather than here.
1283       # Unit tests should only depend on:
1284       # 1) everything that the chrome binaries depend on:
1285       "//chrome:browser_dependencies",
1286       "//chrome:child_dependencies",
1288       # 2) test-specific support libraries:
1289       ":test_support_unit",
1290       "//base/test:test_support",
1291       "//chrome/test:test_support",
1292       "//components/resources",
1293       "//components/content_settings/core/test:test_support",
1294       "//content/test:test_support",
1295       "//content/public/app:both",
1296       "//crypto:platform",
1297       "//crypto:test_support",
1298       "//net",
1299       "//net:test_support",
1300       "//sync:test_support_sync_api",
1301       "//sync:test_support_sync_core",
1302       "//sync:test_support_sync_internal_api",
1303       "//testing/gmock",
1304       "//testing/gtest",
1306       # 3) anything tests directly depend on
1307       "//base/allocator",
1308       "//chrome:resources",
1309       "//chrome:strings",
1310       "//courgette:courgette_lib",
1311       "//google_apis",
1312       "//skia",
1313       "//third_party/cacheinvalidation",
1314       "//third_party/icu",
1315       "//third_party/libxml",
1316       "//ui/base:test_support",
1317       "//ui/gfx:test_support",
1318       "//ui/resources",
1319     ]
1320     data_deps = []
1322     # TODO(GYP) Windows stuff
1323     # ['incremental_chrome_dll==1', {
1324     #   'UseLibraryDependencyInputs': "true",
1326     if (!is_ios) {
1327       deps += [
1328         ":unit_tests_js",
1329         "//components/audio_modem:test_support",
1330         "//components/autofill/content/browser/wallet:test_support",
1331         "//components/autofill/content/renderer:test_support",
1332         "//components/metrics/proto",
1333         "//components/data_reduction_proxy/core/browser:test_support",
1334         "//components/safe_json:test_support",
1335         "//components/webdata_services:test_support",
1336         "//components/strings",
1337         "//device/bluetooth:mocks",
1338         "//content/app/resources",
1339         "//gpu:test_support",
1340         "//media:test_support",
1342         #'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared',  TODO(GYP)
1343         "//third_party/leveldatabase",
1344         "//third_party/libaddressinput",
1345         "//third_party/libjingle",
1346         "//third_party/libphonenumber",
1347         "//third_party/webrtc/modules/desktop_capture",
1348         "//tools/json_schema_compiler/test",
1349         "//ui/gl",
1350         "//v8",
1351       ]
1352     }
1354     if (is_android) {
1355       deps -= [ "//third_party/libaddressinput" ]
1357       # Some android targets still depend on --gc-sections to link.
1358       # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
1359       ldflags = [ "-Wl,--gc-sections" ]
1360       deps += [ "//testing/android/native_test:native_test_native_code" ]
1361       isolate_file = "../unit_tests.isolate"
1362     } else {
1363       sources += rebase_path(
1364               chrome_tests_unit_gypi_values.chrome_unit_tests_non_android_sources,
1365               ".",
1366               "//chrome")
1367     }
1368     if (is_ios || is_chromeos) {
1369       sources -=
1370           [ "../browser/metrics/signin_status_metrics_provider_unittest.cc" ]
1371     }
1372     if (enable_background) {
1373       sources += rebase_path(
1374               chrome_tests_unit_gypi_values.chrome_unit_tests_background_sources,
1375               ".",
1376               "//chrome")
1377     }
1378     if (enable_spellcheck) {
1379       sources += rebase_path(
1380               chrome_tests_unit_gypi_values.chrome_unit_tests_spellchecker_sources,
1381               ".",
1382               "//chrome")
1383       if (is_mac && !is_ios) {
1384         deps += [ "//third_party/hunspell" ]
1385       }
1386     }
1388     if (enable_one_click_signin) {
1389       sources += [
1390         "../browser/ui/sync/one_click_signin_sync_observer_unittest.cc",
1391         "../browser/ui/sync/one_click_signin_sync_starter_unittest.cc",
1392       ]
1393     }
1395     if (enable_extensions) {
1396       sources += rebase_path(
1397               chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_sources,
1398               ".",
1399               "//chrome")
1400       deps += [
1401         "//chrome/common/extensions/api",
1402         "//device/usb:mocks",
1403         "//extensions:extensions_resources",
1404         "//extensions/strings",
1405       ]
1406       if (enable_configuration_policy) {
1407         sources += rebase_path(
1408                 chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_policy_sources,
1409                 ".",
1410                 "//chrome")
1411       }
1412       if (!is_chromeos) {
1413         sources += rebase_path(
1414                 chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources,
1415                 ".",
1416                 "//chrome")
1417       }
1418     }
1419     if (toolkit_views) {
1420       deps += [
1421         "//components/web_modal:test_support",
1422         "//ui/views",
1423         "//ui/views:test_support",
1424       ]
1425       sources += rebase_path(
1426               chrome_tests_unit_gypi_values.chrome_unit_tests_views_sources,
1427               ".",
1428               "//chrome")
1429       if (!is_mac) {
1430         sources += rebase_path(
1431                 chrome_tests_unit_gypi_values.chrome_unit_tests_views_non_mac_sources,
1432                 ".",
1433                 "//chrome")
1434       }
1435     }
1436     if (use_ash) {
1437       sources += rebase_path(
1438               chrome_tests_unit_gypi_values.chrome_unit_tests_ash_sources,
1439               ".",
1440               "//chrome")
1441       deps += [
1442         "//ash:test_support",
1443         "//ash/resources",
1444         "//ash/strings",
1445       ]
1447       # We eventually want to compile both in Win Aura builds, see
1448       # http://crbug.com/155545.
1449       if (!is_win) {
1450         sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ]
1451       }
1452     }
1453     if (use_aura) {
1454       sources += [ "//ui/views/controls/webview/webview_unittest.cc" ]
1455       deps += [
1456         "//ui/wm",
1457         "//ui/aura:test_support",
1458         "//ui/views:test_support",
1459       ]
1460     }
1461     if (!is_chromeos && is_linux) {
1462       sources += rebase_path(
1463               chrome_tests_unit_gypi_values.chrome_unit_tests_desktop_linux_sources,
1464               ".",
1465               "//chrome")
1466     }
1467     if (!is_chromeos && !use_ozone && is_linux) {
1468       deps += [
1469         "//chrome/browser/ui/libgtk2ui",
1470         "//build/config/linux:gio",
1471       ]
1472     }
1474     if (enable_task_manager) {
1475       sources += rebase_path(
1476               chrome_tests_unit_gypi_values.chrome_unit_tests_task_manager_sources,
1477               ".",
1478               "//chrome")
1479     }
1480     if (enable_mdns) {
1481       sources += rebase_path(
1482               chrome_tests_unit_gypi_values.chrome_unit_tests_mdns_sources,
1483               ".",
1484               "//chrome")
1485     }
1486     if (enable_service_discovery) {
1487       sources += rebase_path(
1488               chrome_tests_unit_gypi_values.chrome_unit_tests_service_discovery_sources,
1489               ".",
1490               "//chrome")
1491     }
1492     if (enable_configuration_policy) {
1493       sources += rebase_path(
1494               chrome_tests_unit_gypi_values.chrome_unit_tests_configuration_policy_sources,
1495               ".",
1496               "//chrome")
1497       if (is_chromeos) {
1498         sources -=
1499             [ "../browser/policy/cloud/user_policy_signin_service_unittest.cc" ]
1500       } else if (is_android) {
1501         sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ]
1502       }
1503       if (!is_android && !is_ios && !is_chromeos) {
1504         sources +=
1505             [ "../browser/net/disk_cache_dir_policy_handler_unittest.cc" ]
1506       }
1507       if (!is_android && !is_ios) {
1508         sources +=
1509             [ "../browser/download/download_dir_policy_handler_unittest.cc" ]
1510       }
1511     }
1512     if (enable_web_speech) {
1513       sources += rebase_path(
1514               chrome_tests_unit_gypi_values.chrome_unit_tests_speech_sources,
1515               ".",
1516               "//chrome")
1517     }
1518     if (enable_notifications) {
1519       sources += rebase_path(
1520               chrome_tests_unit_gypi_values.chrome_unit_tests_notifications_sources,
1521               ".",
1522               "//chrome")
1523       if (is_android) {
1524         sources -= [
1525           # Android does not use the Message Center notification system.
1526           "../browser/notifications/message_center_notifications_unittest.cc",
1527           "../browser/notifications/message_center_settings_controller_unittest.cc",
1528         ]
1529       }
1530     }
1531     if (safe_browsing_mode == 1) {
1532       # TODO(sgurun): enable tests for safe_browsing==2.
1533       sources += rebase_path(
1534               chrome_tests_unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources,
1535               ".",
1536               "//chrome")
1537       deps += [ ":test_proto" ]
1538       if (is_android) {
1539         deps -= [ ":test_proto" ]
1540         sources -= [
1541           # Android doesn't support download feedbacks.
1542           "../browser/safe_browsing/download_feedback_service_unittest.cc",
1543           "../browser/safe_browsing/download_feedback_unittest.cc",
1544           "../browser/safe_browsing/download_protection_service_unittest.cc",
1545           "../browser/safe_browsing/two_phase_uploader_unittest.cc",
1546           "../common/safe_browsing/ipc_protobuf_message_test_messages.h",
1547           "../common/safe_browsing/ipc_protobuf_message_unittest.cc",
1548         ]
1549       }
1550     }
1551     if (enable_autofill_dialog && !is_android) {
1552       sources += rebase_path(
1553               chrome_tests_unit_gypi_values.chrome_unit_tests_autofill_dialog_sources,
1554               ".",
1555               "//chrome")
1556     }
1557     if (enable_plugins) {
1558       sources += rebase_path(
1559               chrome_tests_unit_gypi_values.chrome_unit_tests_plugins_sources,
1560               ".",
1561               "//chrome")
1562     }
1563     if (enable_print_preview) {
1564       sources += rebase_path(
1565               chrome_tests_unit_gypi_values.chrome_unit_tests_print_preview_sources,
1566               ".",
1567               "//chrome")
1568     }
1569     if (enable_captive_portal_detection) {
1570       sources += rebase_path(
1571               chrome_tests_unit_gypi_values.chrome_unit_tests_captive_portal_sources,
1572               ".",
1573               "//chrome")
1574     }
1575     if (enable_session_service) {
1576       sources += rebase_path(
1577               chrome_tests_unit_gypi_values.chrome_unit_tests_session_service_sources,
1578               ".",
1579               "//chrome")
1580     }
1581     if (enable_media_router) {
1582       sources += rebase_path(
1583               chrome_tests_unit_gypi_values.chrome_unit_tests_media_router_sources,
1584               ".",
1585               "//chrome")
1586       deps += [ "//chrome/browser/media/router:test_support" ]
1587       if (!is_android) {
1588         sources += rebase_path(
1589                 chrome_tests_unit_gypi_values.chrome_unit_tests_media_router_non_android_sources,
1590                 ".",
1591                 "//chrome")
1592       }
1593       if (!toolkit_views) {
1594         sources -= [ "../browser/ui/views/media_router/media_router_ui_browsertest.cc" ]
1595       }
1596     }
1597     if (enable_webrtc) {
1598       sources += rebase_path(
1599               chrome_tests_unit_gypi_values.chrome_unit_tests_webrtc_sources,
1600               ".",
1601               "//chrome")
1602     }
1603     if (is_chromeos) {
1604       deps += [ "//chrome/browser/chromeos:unit_tests" ]
1605       sources -= [
1606         "../browser/signin/signin_global_error_unittest.cc",
1607         "../browser/signin/signin_manager_unittest.cc",
1608         "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc",
1609         "../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
1610         "../browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc",
1611       ]
1612     }
1613     if (use_x11) {
1614       deps += [ "//ui/events/devices" ]
1615       data_deps += [ "//tools/xdisplaycheck" ]
1616     } else {
1617       sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ]
1618     }
1619     if (cld_version == 2) {
1620       # Unit tests should be independent of the CLD2 access mechanism, just use
1621       # static for simplicity.
1622       deps += [ "//third_party/cld_2:cld2_static" ]
1623     }
1624     if (is_desktop_linux && current_cpu == "x64") {
1625       # Only add this test for 64 bit builds because otherwise we need the 32
1626       # bit library on 64 bit systems when running this test.
1627       sources +=
1628           [ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ]
1629       configs += [
1630         "//chrome/browser:gnome_keyring",
1631         "//chrome/browser:gnome_keyring_direct",
1632       ]
1633     }
1634     if (is_linux && !is_chromeos) {
1635       sources +=
1636           [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ]
1637     }
1638     if (is_linux && use_aura) {
1639       deps += [
1640         "//dbus",
1641         "//dbus:test_support",
1642         "//ui/aura:test_support",
1643       ]
1644     }
1645     if (is_linux && is_chrome_branded && current_cpu == "x86") {
1646       ldflags = [ "-Wl,--strip-debug" ]
1647     }
1648     if (is_mac) {
1649       sources += rebase_path(
1650               chrome_tests_unit_gypi_values.chrome_unit_tests_mac_sources,
1651               ".",
1652               "//chrome")
1653       sources -= [
1654         "../browser/ui/tests/ui_gfx_image_unittest.cc",
1655         "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
1656         "../tools/convert_dict/convert_dict_unittest.cc",
1657       ]
1659       # The test fetches resources which means Mac need the app bundle to exist
1660       # on disk so it can pull from it.
1661       deps += [
1662         "//third_party/google_toolbox_for_mac",
1663         "//third_party/ocmock",
1664       ]
1666       # TODO(mark): We really want this for all non-static library targets,
1667       # but when we tried to pull it up to the common.gypi level, it broke
1668       # other things like the ui and startup tests. *shrug*
1669       ldflags = [ "-Wl,-ObjC" ]
1670     }
1671     if (!is_mac && !is_ios) {
1672       deps += [
1673         "//chrome/tools/convert_dict:lib",
1674         "//chrome:packed_extra_resources",
1675         "//chrome:packed_resources",
1676         "//third_party/hunspell",
1677       ]
1678     }
1679     if (is_win || is_mac) {
1680       sources += rebase_path(
1681               chrome_tests_unit_gypi_values.chrome_unit_tests_win_mac_sources,
1682               ".",
1683               "//chrome")
1684     }
1685     if (is_win || is_mac || is_chromeos) {
1686       sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ]
1687     }
1688     if (enable_rlz_support) {
1689       sources += [ "../browser/rlz/chrome_rlz_tracker_delegate_unittest.cc" ]
1690       deps += [
1691         "//chrome/browser:rlz",
1692         "//components/rlz",
1693         "//rlz:test_support",
1694       ]
1695     }
1696     if (is_win) {
1697       # The PDB gets too large for incremental linking.
1698       configs -= [ "//build/config/win:default_incremental_linking" ]
1699       configs += [ "//build/config/win:no_incremental_linking" ]
1701       sources += rebase_path(
1702               chrome_tests_unit_gypi_values.chrome_unit_tests_win_sources,
1703               ".",
1704               "//chrome")
1705       deps += [
1706         #'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_1',  TODO(GYP) bug 512919
1707         #'browser/safe_browsing/incident_reporting/verifier_test/verifier_unittest.gyp:verifier_test_dll_2',  TODO(GYP) bug 512919
1708         "//chrome:other_version",
1709         "//chrome_elf:blacklist_test_dll_1",
1710         "//chrome/installer/util:strings",
1711         "//third_party/iaccessible2",
1712         "//third_party/isimpledom",
1713         "//third_party/wtl",
1714         "//ui/resources",
1715       ]
1717       libs = [
1718         "comsupp.lib",
1719         "oleacc.lib",
1720         "rpcrt4.lib",
1721         "urlmon.lib",
1722         "winmm.lib",
1723       ]
1724       if (!is_chrome_branded) {
1725         sources -= [ "../browser/google/google_update_win_unittest.cc" ]
1726       }
1727     }
1728     if (is_android || is_ios) {
1729       sources -= [
1730         "../browser/devtools/device/webrtc/devtools_bridge_instances_request_unittest.cc",
1731         "../browser/ui/sync/sync_promo_ui_unittest.cc",
1732       ]
1733     } else {
1734       sources -= [
1735         "../browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc",
1736         "../browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc",
1737       ]
1738       deps += [ "//chrome/tools/profile_reset:jtl_compiler_lib" ]
1739     }
1740     if (!is_android && !is_chromeos) {
1741       sources += rebase_path(
1742               chrome_tests_unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources,
1743               ".",
1744               "//chrome")
1745     }
1746     if (enable_themes) {
1747       sources += rebase_path(
1748               chrome_tests_unit_gypi_values.chrome_unit_tests_themes_sources,
1749               ".",
1750               "//chrome")
1751     }
1752     if (!is_android && (use_nss_certs || use_openssl_certs)) {
1753       sources += [ "../common/net/x509_certificate_model_unittest.cc" ]
1754     }
1755     if (enable_supervised_users) {
1756       sources += rebase_path(
1757               chrome_tests_unit_gypi_values.chrome_unit_tests_supervised_user_sources,
1758               ".",
1759               "//chrome")
1760     }
1761     if (enable_supervised_users && !is_android && !is_ios) {
1762       sources += rebase_path(
1763               chrome_tests_unit_gypi_values.chrome_unit_tests_supervised_user_legacy_sources,
1764               ".",
1765               "//chrome")
1766     }
1767     if (safe_browsing_mode == 1 && enable_extensions) {
1768       sources += [ "../browser/extensions/blacklist_unittest.cc" ]
1769     }
1770     if (cld_version == 1) {
1771       sources += [ "//third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc" ]
1772       defines += [ "CLD_WINDOWS" ]
1773       deps += [ "//third_party/cld" ]
1774     }
1775     if (enable_app_list) {
1776       sources += rebase_path(
1777               chrome_tests_unit_gypi_values.chrome_unit_tests_app_list_sources,
1778               ".",
1779               "//chrome")
1780       deps += [ "//ui/app_list:test_support" ]
1781     }
1782     if (enable_app_list && is_chromeos) {
1783       sources += rebase_path(
1784               chrome_tests_unit_gypi_values.chrome_unit_tests_app_list_chromeos_sources,
1785               ".",
1786               "//chrome")
1787     }
1788     if (enable_plugins && !enable_plugin_installation) {
1789       sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]
1790     }
1791   }
1793   if (is_win || (is_linux && !is_chromeos)) {
1794     # TODO(GYP): Figure out which of these work and are needed on other
1795     # platforms.
1796     test("chrome_app_unittests") {
1797       sources = [
1798         "../app/chrome_watcher_client_unittest_win.cc",
1799         "../app/chrome_watcher_client_win.cc",
1800         "../app/chrome_watcher_command_line_unittest_win.cc",
1801         "../app/chrome_watcher_command_line_win.cc",
1802         "../app/delay_load_hook_unittest_win.cc",
1803         "../app/delay_load_hook_win.cc",
1804         "../app/delay_load_hook_win.h",
1805         "../app/signature_validator_win.cc",
1806         "../app/signature_validator_win.h",
1807         "../app/signature_validator_win_unittest.cc",
1808         "../common/crash_keys.cc",
1809         "../common/crash_keys.h",
1810       ]
1812       deps = [
1813         ":test_support",
1814         "//breakpad:client",
1815         "//chrome/browser",
1816         "//chrome/child",
1817         "//base/test:run_all_unittests",
1818         "//base/test:test_support",
1819       ]
1820       if (cld_version == 2) {
1821         # Use whatever CLD2 data access mode that the
1822         # application embedder is using.
1823         deps += [ "//third_party/cld_2:cld2_platform_impl" ]
1824       }
1825     }
1827     test("performance_browser_tests") {
1828       sources = rebase_path(
1829               chrome_tests_gypi_values.performance_browser_tests_sources,
1830               ".",
1831               "//chrome")
1833       defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1835       deps = [
1836         ":test_support",
1837         "//base",
1838         "//base:i18n",
1839         "//base/test:test_support",
1840         "//chrome/browser",
1841         "//chrome/renderer",
1842         "//components/autofill/content/browser/wallet:test_support",
1843         "//components/autofill/content/renderer:test_support",
1844         "//media/cast:test_support",
1845         "//testing/gmock",
1846         "//testing/gtest",
1847         "//testing/perf",
1848       ]
1850       if (is_win) {
1851         configs -= [ "//build/config/win:default_incremental_linking" ]
1852         configs +=
1853             [ "//build/config/win:default_large_module_incremental_linking" ]
1854       } else {
1855         sources -= [
1856           "../app/chrome_command_ids.h",
1858           #"../app/chrome_dll.rc",
1859           #"../app/chrome_dll_resource.h",
1860           "../app/chrome_version.rc.version",
1861         ]
1862       }
1863       if (!is_mac) {
1864         sources -= [ "perf/mach_ports_performancetest.cc" ]
1865       }
1867       if (cld_version == 2) {
1868         # Use whatever CLD2 data access mode that the
1869         # application embedder is using.
1870         deps += [ "//third_party/cld_2:cld2_platform_impl" ]
1871       }
1872     }
1873   }
1876 source_set("test_support_unit") {
1877   testonly = true
1878   sources = [
1879     "../browser/sync/glue/session_sync_test_helper.cc",
1880     "../browser/sync/glue/session_sync_test_helper.h",
1881     "base/run_all_unittests.cc",
1882   ]
1884   deps = [
1885     ":test_support",
1886     "//base",
1887     "//chrome:resources",
1888     "//chrome:strings",
1889     "//chrome/browser",
1890     "//chrome/common",
1891     "//mojo/environment:chromium",
1892     "//third_party/mojo/src/mojo/edk/system",
1893   ]
1895   if (!is_android && use_ash) {
1896     sources += rebase_path(
1897             chrome_tests_unit_gypi_values.chrome_test_support_unit_ash_sources,
1898             ".",
1899             "//chrome")
1900   }