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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//build/module_args/v8.gni")
9 import("//testing/test.gni")
11 # This target exists to reference other test executables to bring these files
20 # GYP version: chrome/chrome_tests_unit.gypi:test_support_common
21 source_set("test_support") {
26 "base/chrome_process_util.cc",
27 "base/chrome_process_util.h",
28 "base/chrome_process_util_mac.cc",
29 "base/chrome_render_view_host_test_harness.cc",
30 "base/chrome_render_view_host_test_harness.h",
31 "base/chrome_test_launcher.cc",
32 "base/chrome_test_launcher.h",
33 "base/chrome_test_suite.cc",
34 "base/chrome_test_suite.h",
35 "base/chrome_unit_test_suite.cc",
36 "base/chrome_unit_test_suite.h",
37 "base/find_in_page_observer.cc",
38 "base/find_in_page_observer.h",
39 "base/history_index_restore_observer.cc",
40 "base/history_index_restore_observer.h",
41 "base/in_process_browser_test.cc",
42 "base/in_process_browser_test.h",
43 "base/profile_mock.cc",
44 "base/profile_mock.h",
45 "base/scoped_browser_locale.cc",
46 "base/scoped_browser_locale.h",
47 "base/scoped_testing_local_state.cc",
48 "base/scoped_testing_local_state.h",
49 "base/test_browser_window.cc",
50 "base/test_browser_window.h",
51 "base/test_launcher_utils.cc",
52 "base/test_launcher_utils.h",
53 "base/test_switches.cc",
54 "base/test_switches.h",
55 "base/testing_browser_process.cc",
56 "base/testing_browser_process.h",
57 "base/testing_browser_process_platform_part.h",
58 "base/testing_browser_process_platform_part.cc",
59 "base/testing_io_thread_state.cc",
60 "base/testing_io_thread_state.h",
61 "base/testing_pref_service_syncable.cc",
62 "base/testing_pref_service_syncable.h",
63 "base/testing_profile.cc",
64 "base/testing_profile.h",
65 "base/testing_profile_manager.cc",
66 "base/testing_profile_manager.h",
69 "base/ui_test_utils.cc",
70 "base/ui_test_utils.h",
71 "logging/win/file_logger.cc",
72 "logging/win/file_logger.h",
73 "logging/win/log_file_printer.cc",
74 "logging/win/log_file_printer.h",
75 "logging/win/log_file_reader.cc",
76 "logging/win/log_file_reader.h",
77 "logging/win/mof_data_parser.cc",
78 "logging/win/mof_data_parser.h",
79 "logging/win/test_log_collector.cc",
80 "logging/win/test_log_collector.h",
83 # New deps should go in the non-iOS section below.
85 "//content/test:test_support",
88 "//base:prefs_test_support",
89 "//base/test:test_support",
92 "//chrome/app:test_support",
94 #"//chrome/app/theme:theme_resources",
95 "//chrome/browser:test_support",
96 "//chrome/common:test_support",
97 "//chrome/renderer:test_support",
98 "//components/bookmarks/test",
99 "//components/gcm_driver:test_support",
100 "//components/history/core/test:test",
101 "//components/metrics:test_support",
102 "//components/omnibox:test_support",
103 "//components/ownership",
104 "//components/password_manager/core/browser:test_support",
105 "//components/pref_registry:test_support",
106 "//components/rappor:test_support",
107 "//components/search_engines:test_support",
108 "//components/signin/core/browser:test_support",
109 "//components/sync_driver:test_support",
110 "//components/update_client:test_support",
111 "//content/public/app:both",
112 "//ui/gfx:test_support",
114 "//net:test_support",
117 "//sql:test_support",
121 "//third_party/zlib",
122 "//ui/message_center:test_support",
130 "//content/public/child",
131 "//content/public/common",
132 "//content/public/plugin",
133 "//content/public/renderer",
134 "//content/public/utility",
135 "//components/autofill/core/browser:test_support",
136 "//components/captive_portal:test_support",
137 "//components/infobars/core",
138 "//components/sessions:test_support",
139 "//components/web_resource:test_support",
140 "//google_apis:test_support",
141 "//ipc:test_support",
142 "//media:test_support",
143 "//ppapi:ppapi_shared",
144 "//sql:test_support",
145 "//third_party/leveldatabase",
147 "//ui/events:events_base",
152 if (enable_extensions) {
154 "//chrome/common/extensions/api",
155 "//extensions:test_support",
160 deps += [ "//crypto:platform" ]
163 deps += [ "//third_party/wtl" ]
166 "//win8:test_registrar_constants",
167 "//win8:test_support_win8",
172 if (enable_plugins) {
174 "ppapi/ppapi_test.cc",
175 "ppapi/ppapi_test.h",
180 deps += [ "//ash:test_support" ]
183 deps += [ "//ui/views:test_support" ]
186 if (enable_background) {
187 defines += [ "ENABLE_BACKGROUND=1" ]
190 if (enable_extensions) {
192 "//chrome/common/extensions/api",
193 "//extensions:test_support",
198 source_set("test_support_unit") {
201 "../browser/sync/glue/session_sync_test_helper.cc",
202 "../browser/sync/glue/session_sync_test_helper.h",
203 "base/run_all_unittests.cc",
209 "//chrome:resources",
213 "//mojo/environment:chromium",
214 "//third_party/mojo/src/mojo/edk/system",
218 if (!is_android && (!is_win || link_chrome_on_windows)) {
219 gypi_values = exec_script("//build/gypi_to_gn.py",
220 [ rebase_path("../chrome_tests.gypi") ],
222 [ "../chrome_tests.gypi" ])
224 test("interactive_ui_tests") {
225 sources = rebase_path(gypi_values.chrome_interactive_ui_test_sources,
229 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
235 "//chrome/browser/devtools",
237 "//chrome/test:test_support",
238 "//chrome:resources",
240 "//chrome:packed_extra_resources",
241 "//chrome:packed_resources",
242 "//content/app/resources",
244 "//google_apis:test_support",
246 "//net:net_resources",
247 "//net:test_support",
250 #"//ppapi:ppapi_tests", # TODO(GYP) this doesn't exist yet.
255 "//third_party/hunspell",
257 "//third_party/libpng",
258 "//third_party/npapi",
259 "//third_party/zlib",
260 "//ui/base:test_support",
261 "//ui/web_dialogs:test_support",
264 # Runtime dependencies
266 "//third_party/mesa:osmesa",
271 rebase_path(gypi_values.chrome_interactive_ui_test_views_sources,
276 "//ui/views:test_support",
277 "//ui/views/controls/webview:test_support",
280 sources += rebase_path(
281 gypi_values.chrome_interactive_ui_test_views_non_mac_sources,
286 # TODO(gbillock): aura linux does not support the automation for
287 # SendMouseMoveNotifyWhenDone
288 sources -= [ "../browser/ui/views/toolbar/toolbar_button_test.cc" ]
290 if (is_chromeos || !use_x11) {
292 "../../ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc",
293 "../../ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc",
298 if (is_linux && !is_chromeos) {
301 # TODO(port): This times out. Attempts have been made to fix the
302 # individual failures, but each time I disable a test from these
303 # suites, it seems like one or another starts timing out too.
304 "../browser/ui/views/keyboard_access_browsertest.cc",
307 # Everything but desktop Linux.
308 sources += rebase_path(
309 gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources,
316 rebase_path(gypi_values.chrome_interactive_ui_test_chromeos_sources,
319 sources += [ "../browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc" ]
321 # Use only the _chromeos version on ChromeOS.
322 "base/view_event_test_platform_part_ash.cc",
331 # TODO(GYP) this is also under a disable_nacl_untrusted==0 condition.
333 # '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap', TODO(GYP)
334 # '../components/nacl.gyp:nacl_helper', TODO(GYP)
335 # '../components/nacl_nonsfi.gyp:nacl_helper_nonsfi', TODO(GYP)
339 if (is_chrome_branded) {
341 # These tests are failing on official cros bots. crbug.com/431450.
342 "../browser/ui/views/bookmarks/bookmark_bar_view_test.cc",
346 # ChromeOS doesn't use panels, everybody else does.
348 rebase_path(gypi_values.chrome_interactive_ui_test_panels_sources,
352 # TODO(tapted): Include on mac when views panels are ported.
353 if (toolkit_views && !is_mac) {
354 sources += rebase_path(
355 gypi_values.chrome_interactive_ui_test_panels_views_sources,
362 # Non-Linux platforms (Linux includes ChromeOS here).
363 sources += rebase_path(
364 gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources,
370 sources += rebase_path(gypi_values.chrome_interactive_ui_test_win_sources,
373 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
375 "//chrome:chrome_version_resources",
376 "//third_party/isimpledom",
387 # TODO(mark): We really want this for all non-static library targets, but
388 # when we tried to pull it up to the common.gypi level, it broke other
389 # things like the ui and startup tests. *shrug*
390 ldflags += [ "-Wl,-ObjC" ]
393 if (cld_version == 0 || cld_version == 2) {
394 # Interactive tests should use whatever CLD2 data access mode that the
395 # application embedder is using.
396 deps += [ "//third_party/cld_2:cld2_platform_impl" ]
400 configs += [ "//build/config/linux:xtst" ]
401 datadeps += [ "//tools/xdisplaycheck" ]
404 if (enable_app_list) {
406 rebase_path(gypi_values.chrome_interactive_ui_test_app_list_sources,
412 sources += rebase_path(gypi_values.chrome_interactive_ui_test_ash_sources,
415 deps += [ "//ash:test_support" ]
418 if (enable_notifications) {
419 sources += rebase_path(
420 gypi_values.chrome_interactive_ui_test_notifications_sources,
424 # Non-ChromeOS notifications tests (ChromeOS does not use cross-platform
428 "../browser/notifications/notification_browsertest.cc",
429 "../browser/notifications/platform_notification_service_browsertest.cc",
435 # Android does not use the message center-based Notification system.
436 "../browser/notifications/message_center_notifications_browsertest.cc",
438 # TODO(peter): Enable the Notification browser tests.
439 "../browser/notifications/notification_browsertest.cc",
440 "../browser/notifications/platform_notification_service_browsertest.cc",
443 } # enable_notifications
445 if (use_aura || is_chromeos) {
447 [ "../../ui/views/corewm/desktop_capture_controller_unittest.cc" ]
451 source_set("sync_integration_test_support") {
453 sources = rebase_path(gypi_values.test_support_sync_integration_sources,
463 "//components/invalidation",
464 "//components/invalidation:test_support",
468 "//sync:test_support_sync_testserver",
469 "//sync:test_support_sync_fake_server",
470 "//ui/app_list:test_support",
475 "../browser/sync/test/integration/dictionary_helper.cc",
476 "../browser/sync/test/integration/dictionary_helper.h",
477 "../browser/sync/test/integration/dictionary_load_observer.cc",
478 "../browser/sync/test/integration/dictionary_load_observer.h",
481 if (!enable_app_list) {
483 "../browser/sync/test/integration/sync_app_list_helper.cc",
484 "../browser/sync/test/integration/sync_app_list_helper.h",
489 "../browser/sync/test/integration/wifi_credentials_helper.cc",
490 "../browser/sync/test/integration/wifi_credentials_helper.h",
495 # TODO(GYP) when v8's GN build supports "//v8:d8" then enable the code
496 # controlled by this flag (and the flg itself can be deleted).
497 has_d8_definition = false
499 if (has_d8_definition) {
500 template("js2webui") {
501 action_name = target_name + "_action"
502 source_set_name = target_name
504 action_foreach(action_name) {
506 visibility = [ ":$source_set_name" ]
507 script = "//tools/gypv8sh.py"
509 sources = invoker.sources
512 get_label_info("//v8:d8($host_toolchain)", "root_out_dir") + "/d8"
518 "//chrome/third_party/mock4js/mock4js.js",
519 "//chrome/test/data/webui/test_api.js",
520 "//chrome/test/base/js2gtest.js",
522 inputs = [ d8_path ] + input_js
525 "$target_gen_dir/{{source_name_part}}-gen.cc",
526 "$root_out_dir/test_data/chrome/{{source_root_relative_dir}}/{{source_file_part}}",
530 # Need "./" for script to find binary (cur dir is not on path).
531 "./" + rebase_path(d8_path, root_build_dir),
533 args += rebase_path(input_js, root_build_dir) + [ "webui" ]
534 if (v8_use_external_startup_data) {
535 args += [ "--external=y" ]
537 args += [ "--external=n" ]
541 "{{source_root_relative_dir}}/{{source_file_part}}",
543 args += rebase_path(outputs, root_build_dir)
546 "//v8:d8($host_toolchain)",
550 source_set(source_set_name) {
552 if (defined(invoker.visibility)) {
553 visibility = invoker.visibility
555 sources = get_target_outputs(":$action_name")
556 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
560 # The generator implicitly makes includes from these targets.
565 if (defined(invoker.deps)) {
571 js2webui("browser_tests_js_webui") {
572 sources = rebase_path(gypi_values.chrome_browser_tests_webui_js_sources,
575 if (is_chrome_branded) {
577 sources -= [ "data/webui/accessibility_audit_browsertest.js" ]
580 sources -= [ "data/webui/certificate_viewer_dialog_test.js" ]
582 if (!enable_app_list) {
583 sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ]
585 if (!enable_supervised_users) {
587 [ "../browser/ui/webui/downloads_ui_supervised_browsertest.js" ]
595 test("browser_tests") {
597 "base/browser_tests_main.cc",
600 rebase_path(gypi_values.chrome_browser_tests_sources, ".", "//chrome")
602 rebase_path(gypi_values.chrome_browser_extensions_test_support_sources,
607 ":sync_integration_test_support",
612 "//base/test:test_support",
613 "//chrome:browser_tests_pak",
614 "//chrome:packed_extra_resources",
615 "//chrome:packed_resources",
616 "//chrome:resources",
619 "//chrome/common/extensions/api",
621 "//chrome/test/perf",
622 "//components/autofill/content/browser:risk_proto",
623 "//components/autofill/content/browser:test_support",
624 "//components/captive_portal:test_support",
625 "//components/dom_distiller/content",
626 "//components/dom_distiller/core:test_support",
627 "//components/resources",
628 "//components/strings",
629 "//components/translate/core/common",
631 "//crypto:test_support",
632 "//device/bluetooth:mocks",
633 "//device/serial:test_support",
634 "//extensions/common/api",
635 "//google_apis:test_support",
637 "//media/base:test_support",
638 "//media/cast:test_support",
640 "//net:test_support",
644 "//sync:test_support_sync_api",
648 "//third_party/cacheinvalidation",
650 "//third_party/leveldatabase",
651 "//third_party/libaddressinput",
652 "//third_party/libjingle",
653 "//third_party/safe_browsing:test_support",
654 "//third_party/widevine/cdm:version_h",
655 "//ui/accessibility:test_support",
656 "//ui/compositor:test_support",
658 "//ui/web_dialogs:test_support",
661 if (has_d8_definition) {
662 deps += [ ":browser_tests_js_webui" ]
665 # Runtime dependencies
667 #"//ppapi:ppapi_tests", # TODO(GYP) this doesn't exist yet.
668 #'../remoting/remoting.gyp:remoting_browser_test_resources', TODO(GYP)
669 #'../remoting/remoting.gyp:remoting_webapp_unittest', TODO(GYP)
670 "//third_party/mesa:osmesa",
671 "//third_party/widevine/cdm:widevine_test_license_server",
674 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
676 # TODO(GYP) if (is_win) {
677 # ['incremental_chrome_dll==1', {
678 # 'UseLibraryDependencyInputs': "true",
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" ]
686 if (!enable_one_click_signin) {
687 sources -= [ "../browser/ui/sync/one_click_signin_bubble_links_delegate_browsertest.cc" ]
691 "../browser/extensions/extension_nacl_browsertest.cc",
692 "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc",
694 deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
696 if (enable_nacl_untrusted) {
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",
706 #'test/data/nacl/nacl_test_data.gyp:*', # TODO(GYP)
707 #'../ppapi/native_client/native_client.gyp:nacl_irt', # TODO(GYP)
708 #'../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests', # TODO(GYP)
709 #'../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive', # TODO(GYP)
710 #'../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries', # TODO(GYP)
711 #'../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app', # TODO(GYP) #'../ppapi/ppapi_tests_mojo.gyp:ppapi_tests_mojo', # TODO(GYP)
712 #'../ppapi/ppapi_tests_mojo.gyp:ppapi_tests_mojo', # TODO(GYP)
715 sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ]
718 #'browser_chromeos', TODO(GYP)
719 #'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data', TODO(GYP)
722 if (is_win || is_linux) {
723 sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ]
725 #'browser/nacl_host/test/mock_nacl_gdb.gyp:mock_nacl_gdb', TODO(GYP)
729 # TODO(halyavin) NaCl on Windows can't open debug stub socket in
730 # browser process as needed by this test. See http://crbug.com/157312.
731 sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ]
733 #'chrome.gyp:chrome_nacl_win64', TODO(GYP)
738 #'../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap', TODO(GYP)
739 #'../components/nacl.gyp:nacl_helper', TODO(GYP)
740 #'../components/nacl_nonsfi.gyp:nacl_helper_nonsfi', TODO(GYP)
744 sources -= [ "test/data/chromeos/oobe_webui_browsertest.js" ]
747 if (debug_devtools) {
748 defines += [ "DEBUG_DEVTOOLS=1" ]
751 deps += [ "//ash:test_support" ]
753 if (use_aura || toolkit_views) {
754 deps += [ "//ui/events:test_support" ]
757 sources += rebase_path(gypi_values.chrome_browser_tests_views_sources,
760 deps += [ "//ui/views" ]
763 rebase_path(gypi_values.chrome_browser_tests_views_non_mac_sources,
769 sources += rebase_path(gypi_values.chrome_browser_tests_chromeos_sources,
773 "../../apps/load_and_launch_browsertest.cc",
774 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
775 "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
777 # chromeos does not support profile list avatar menu
778 "../browser/profiles/profile_list_desktop_browsertest.cc",
779 "../browser/service_process/service_process_control_browsertest.cc",
780 "../browser/signin/signin_browsertest.cc",
782 # chromeos does not use cross-platform panels
783 "../browser/ui/panels/panel_extension_browsertest.cc",
785 # chromeos does not use the desktop user manager
786 "../browser/ui/webui/signin/user_manager_ui_browsertest.cc",
790 "//dbus:test_support",
792 #"//ui/login:resources", TODO(GYP)
796 "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
797 "../browser/extensions/api/terminal/terminal_private_apitest.cc",
798 "../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
799 "../browser/net/nss_context_chromeos_browsertest.cc",
800 "../browser/ui/ash/keyboard_controller_browsertest.cc",
801 "data/webui/certificate_viewer_ui_test-inl.h",
804 sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ]
807 if (enable_configuration_policy) {
808 sources += rebase_path(gypi_values.chrome_browser_tests_policy_sources,
812 if (enable_web_speech) {
813 sources += rebase_path(gypi_values.chrome_browser_tests_speech_sources,
817 if (safe_browsing_mode == 1) {
818 sources += rebase_path(
819 gypi_values.chrome_browser_tests_full_safe_browsing_sources,
822 defines += [ "FULL_SAFE_BROWSING" ]
824 if (enable_captive_portal_detection) {
825 sources += [ "../browser/captive_portal/captive_portal_browsertest.cc" ]
827 if (!enable_webrtc) {
829 "../browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc",
830 "../browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc",
831 "../browser/media/chrome_webrtc_browsertest.cc",
832 "../browser/media/chrome_webrtc_disable_encryption_flag_browsertest.cc",
833 "../browser/media/chrome_webrtc_getmediadevices_browsertest.cc",
837 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
839 "//chrome:chrome_version_resources",
845 "../app/chrome_command_ids.h",
846 "../app/chrome_dll_resource.h",
847 "../app/chrome_version.rc.version",
848 "../browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc",
851 if (!is_chromeos && use_aura) {
853 # On Windows and Linux, we currently don't support enough of the
854 # ash environment to run these unit tests.
856 # TODO: enable these on windows and linux.
857 "../browser/ui/ash/accelerator_commands_browsertest.cc",
858 "../browser/ui/ash/accelerator_controller_browsertest.cc",
859 "../browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc",
860 "../browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc",
861 "../browser/ui/ash/shelf_browsertest.cc",
862 "../browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc",
866 # TODO(mark): We really want this for all non-static library
867 # targets, but when we tried to pull it up to the common.gypi
868 # level, it broke other things like the ui and startup tests. *shrug*
869 ldflags = [ "-Wl,-ObjC" ]
871 # Other platforms only need
872 # chrome_resources.gyp:{packed_extra_resources,packed_resources},
873 # and can build this target standalone much faster.
875 #'app_mode_app_support', TODO(GYP)
877 #'../components/components.gyp:breakpad_stubs', TODO(GYP)
878 #'../third_party/ocmock/ocmock.gyp:ocmock', TODO(GYP)
881 "../browser/media_galleries/fileapi/iphoto_data_provider_browsertest.cc",
882 "../browser/renderer_host/chrome_render_widget_host_view_mac_delegate_browsertest.cc",
883 "../browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm",
884 "../browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc",
887 # TODO(groby): This test depends on hunspell and we cannot run it on
888 # Mac, which does not use hunspell by default.
889 "../browser/spellchecker/spellcheck_service_browsertest.cc",
891 # TODO(rouslan): This test depends on the custom dictionary UI,
892 # which is disabled on Mac.
893 "../browser/ui/webui/options/edit_dictionary_browsertest.js",
895 # TODO(rouslan): This test depends on hunspell and we cannot run it
896 # on Mac, which does use hunspell by default.
897 "../browser/ui/webui/options/language_options_dictionary_download_browsertest.js",
899 # ProcessSingletonMac doesn"t do anything.
900 "../browser/process_singleton_browsertest.cc",
902 # This test depends on GetCommandLineForRelaunch, which is not
904 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
906 # single-process mode hangs on Mac sometimes because of multiple UI
907 # message loops. See 306348
908 "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
909 "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
910 "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
913 if (is_mac || is_win) {
915 "../browser/extensions/api/networking_private/networking_private_apitest.cc",
916 "../browser/extensions/api/networking_private/networking_private_service_client_apitest.cc",
917 "../browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc",
918 "../browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc",
920 deps += [ "//components/wifi:test_support" ]
922 if (!is_posix || is_chromeos) {
923 sources -= [ "../common/time_format_browsertest.cc" ]
927 "../browser/policy/cloud/component_cloud_policy_browsertest.cc",
928 "../browser/prefs/pref_hash_browsertest.cc",
933 "../browser/extensions/api/networking_private/networking_private_apitest.cc",
934 "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
937 if (!is_android && !is_ios) {
939 [ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ]
940 deps += [ "//components/copresence" ]
942 if (!is_android && !is_ios && !is_linux) {
943 # NPAPI test plugin only works on some platforms.
945 #'../content/content_shell_and_tests.gyp:copy_npapi_test_plugin', TODO(GYP)
948 if (enable_app_list) {
949 sources += rebase_path(gypi_values.chrome_browser_tests_app_list_sources,
953 if (enable_supervised_users) {
955 rebase_path(gypi_values.chrome_browser_tests_supervised_user_sources,
959 if (enable_pepper_cdms) {
960 # Runtime dependencies.
962 "//media/cdm/ppapi:clearkeycdmadapter",
963 #'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter', TODO(GYP)
966 if (!enable_print_preview) {
968 "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc",
969 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
970 "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
971 "../browser/printing/print_preview_dialog_controller_browsertest.cc",
972 "../browser/printing/print_preview_pdf_generated_browsertest.cc",
973 "../browser/service_process/service_process_control_browsertest.cc",
974 "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc",
975 "data/webui/print_preview.cc",
976 "data/webui/print_preview.h",
977 "data/webui/print_preview.js",
980 if (!enable_basic_printing && !enable_print_preview) {
981 sources -= [ "../renderer/printing/print_web_view_helper_browsertest.cc" ]
984 sources += [ "../browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc" ]
987 deps += [ "//build/config/linux:libbrlapi" ]
989 sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ]
991 if (is_chrome_branded) {
993 # These tests depend on single process mode, which is disabled in
995 "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
996 "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
997 "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
1000 if (!enable_autofill_dialog || is_android || is_ios) {
1001 deps -= [ "//third_party/libaddressinput" ]
1006 "../browser/chromeos/input_method/input_method_engine_browsertests.cc",
1007 "../browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc",
1010 if (enable_remoting) {
1011 sources += rebase_path(gypi_values.chrome_browser_tests_remoting_sources,
1014 #deps += [ "//remoting:remoting_webapp" ] TODO(GYP)
1017 deps += [ "//tools/xdisplaycheck" ]
1021 test("sync_integration_tests") {
1023 rebase_path(gypi_values.sync_integration_tests_sources, ".", "//chrome")
1025 # TODO(phajdan.jr): Only temporary, to make transition easier.
1026 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1029 ":sync_integration_test_support",
1032 "//chrome:packed_extra_resources",
1033 "//chrome:packed_resources",
1034 "//chrome:resources",
1037 "//chrome/renderer",
1038 "//crypto:platform",
1042 "//third_party/icu",
1043 "//third_party/leveldatabase",
1044 "//third_party/npapi",
1045 "//third_party/WebKit/public:blink",
1048 if (cld_version == 0 || cld_version == 2) {
1049 # Language detection is irrelevant to sync, so it can depend on any
1050 # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1051 deps += [ "//third_party/cld_2:cld2_dynamic" ]
1054 # Dictionary sync is disabled on Mac.
1056 "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc",
1057 "../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
1058 "../browser/sync/test/integration/two_client_dictionary_sync_test.cc",
1061 # The sync_integration_tests do not run on mac without this flag.
1062 # Search for comments about "xcode_settings" elsewhere in this file.
1063 ldflags = [ "-Wl,-ObjC" ]
1066 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
1068 "//chrome:chrome_version_resources",
1069 "//third_party/wtl",
1073 sources -= [ "../app/chrome_version.rc.version" ]
1077 "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc",
1078 "../browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc",
1082 if (toolkit_views) {
1083 deps += [ "//ui/views" ]
1085 if (enable_basic_printing || enable_print_preview) {
1086 deps += [ "//printing" ]
1088 if (!enable_app_list) {
1090 "../browser/sync/test/integration/single_client_app_list_sync_test.cc",
1091 "../browser/sync/test/integration/two_client_app_list_sync_test.cc",
1094 if (!enable_supervised_users) {
1095 sources -= [ "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc" ]
1099 test("sync_performance_tests") {
1101 rebase_path(gypi_values.sync_performance_tests_sources, ".", "//chrome")
1103 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1106 ":sync_integration_test_support",
1108 "//crypto:platform",
1114 if (cld_version == 0 || cld_version == 2) {
1115 # Language detection is irrelevant to sync, so it can depend on any
1116 # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1117 deps += [ "//third_party/cld_2:cld2_dynamic" ]
1121 # Dictionary sync is disabled on Mac.
1122 sources -= [ "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc" ]
1124 # The sync_performance_tests do not run on mac without this flag.
1125 # Search for comments about "xcode_settings" elsewhere in this file.
1126 ldflags = [ "-Wl,-ObjC" ]
1129 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
1131 "//chrome:chrome_version_resources",
1132 "//third_party/wtl",
1136 sources -= [ "../app/chrome_version.rc.version" ]
1139 if (toolkit_views) {
1140 deps += [ "//ui/views" ]
1144 # Executable to measure time to load libraries.
1145 test("load_library_perf_tests") {
1147 "../browser/load_library_perf_test.cc",
1151 "//base/test:test_support_perf",
1154 "//third_party/widevine/cdm:version_h",
1157 # TODO(GYP) CDM adapter stuff.
1158 #if (enable_pepper_cdms) {
1160 # "//media/cdm/ppapi:clearkeycdmadapter",
1161 # "//ppapi:ppapi_cpp",
1162 # "//third_party/widevine/cdm:adapter",
1167 unit_gypi_values = exec_script("//build/gypi_to_gn.py",
1168 [ rebase_path("../chrome_tests_unit.gypi") ],
1170 [ "../chrome_tests_unit.gypi" ])
1172 test("unit_tests") {
1174 rebase_path(unit_gypi_values.chrome_unit_tests_sources, ".", "//chrome")
1179 # NOTE: New depndencies should generally be added in the OS!="ios"
1180 # dependencies block below, rather than here.
1181 # Unit tests should only depend on:
1182 # 1) everything that the chrome binaries depend on:
1183 "//chrome:browser_dependencies",
1184 "//chrome:child_dependencies",
1186 # 2) test-specific support libraries:
1187 ":test_support_unit",
1188 "//base/test:test_support",
1189 "//chrome/test:test_support",
1190 "//components/resources",
1191 "//components/content_settings/core/test:test_support",
1192 "//content/test:test_support",
1193 "//content/public/app:both",
1194 "//crypto:platform",
1195 "//crypto:test_support",
1197 "//net:test_support",
1198 "//sync:test_support_sync_api",
1199 "//sync:test_support_sync_core",
1200 "//sync:test_support_sync_internal_api",
1204 # 3) anything tests directly depend on
1206 "//chrome:resources",
1208 "//courgette:courgette_lib",
1211 "//third_party/cacheinvalidation",
1212 "//third_party/icu",
1213 "//third_party/libxml",
1214 "//ui/accelerometer",
1215 "//ui/base:test_support",
1216 "//ui/gfx:test_support",
1221 # TODO(GYP) Windows stuff
1222 # ['incremental_chrome_dll==1', {
1223 # 'UseLibraryDependencyInputs': "true",
1227 "//components/autofill/content/browser:test_support",
1228 "//components/metrics/proto",
1229 "//components/data_reduction_proxy/core/browser:test_support",
1230 "//components/webdata_services:test_support",
1231 "//components/strings",
1232 "//content/app/resources",
1233 "//gpu:test_support",
1234 "//media:test_support",
1236 #'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared', TODO(GYP)
1237 "//third_party/leveldatabase",
1238 "//third_party/libaddressinput",
1239 "//third_party/libjingle",
1240 "//third_party/libphonenumber",
1241 "//tools/json_schema_compiler/test",
1248 deps -= [ "//third_party/libaddressinput" ]
1250 # Some android targets still depend on --gc-sections to link.
1251 # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
1252 ldflags = [ "-Wl,--gc-sections" ]
1253 deps += [ "//testing/android:native_test_native_code" ]
1256 rebase_path(unit_gypi_values.chrome_unit_tests_non_android_sources,
1261 if (is_ios || is_chromeos) {
1263 [ "../browser/metrics/signin_status_metrics_provider_unittest.cc" ]
1265 if (enable_background) {
1267 rebase_path(unit_gypi_values.chrome_unit_tests_background_sources,
1271 if (enable_spellcheck) {
1273 rebase_path(unit_gypi_values.chrome_unit_tests_spellchecker_sources,
1276 if (is_mac && !is_ios) {
1277 deps += [ "//third_party/hunspell" ]
1281 if (enable_one_click_signin) {
1282 sources += rebase_path(
1283 unit_gypi_values.chrome_unit_tests_one_click_signin_sources,
1288 "../browser/ui/sync/one_click_signin_helper_unittest.cc",
1289 "../browser/ui/sync/one_click_signin_sync_starter_unittest.cc",
1292 if (!toolkit_views) {
1293 sources -= [ "../browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc" ]
1297 sources += rebase_path(unit_gypi_values.chrome_unit_tests_nacl_sources,
1301 if (enable_extensions) {
1303 rebase_path(unit_gypi_values.chrome_unit_tests_extensions_sources,
1307 "//chrome/common/extensions/api",
1308 "//extensions:extensions_resources",
1309 "//extensions/strings",
1311 if (enable_configuration_policy) {
1312 sources += rebase_path(
1313 unit_gypi_values.chrome_unit_tests_extensions_policy_sources,
1318 sources += rebase_path(
1319 unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources,
1324 if (toolkit_views) {
1326 "//components/web_modal:test_support",
1328 "//ui/views:test_support",
1331 # TODO(tapted): Enable toolkit-views unit_tests on Mac when their
1332 # respective implementations are linked in. http://crbug.com/412234.
1333 sources += rebase_path(unit_gypi_values.chrome_unit_tests_views_sources,
1339 sources += rebase_path(unit_gypi_values.chrome_unit_tests_ash_sources,
1343 "//ash:test_support",
1348 # We eventually want to compile both in Win Aura builds, see
1349 # http://crbug.com/155545.
1351 sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ]
1355 sources += [ "//ui/views/controls/webview/webview_unittest.cc" ]
1358 "//ui/aura:test_support",
1359 "//ui/views:test_support",
1362 if (!is_chromeos && is_linux) {
1364 rebase_path(unit_gypi_values.chrome_unit_tests_desktop_linux_sources,
1368 if (!is_chromeos && !use_ozone && is_linux) {
1370 "//chrome/browser/ui/libgtk2ui",
1371 "//build/config/linux:gio",
1373 if (!is_component_build) {
1374 # TODO(erg): This file does not compile in shared library mode because
1375 # it is reaching into the internals of libgtk2ui, which shouldn't be
1376 # linked with the rest of chrome. This should either be fixed by
1377 # creating a separate unit test target, or by deleting the test.
1378 sources += [ "../browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2_unittest.cc" ]
1382 if (enable_task_manager) {
1384 rebase_path(unit_gypi_values.chrome_unit_tests_task_manager_sources,
1389 sources += rebase_path(unit_gypi_values.chrome_unit_tests_mdns_sources,
1393 if (enable_service_discovery) {
1394 sources += rebase_path(
1395 unit_gypi_values.chrome_unit_tests_service_discovery_sources,
1399 if (enable_configuration_policy) {
1400 sources += rebase_path(
1401 unit_gypi_values.chrome_unit_tests_configuration_policy_sources,
1406 [ "../browser/policy/cloud/user_policy_signin_service_unittest.cc" ]
1407 } else if (is_android) {
1408 sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ]
1410 if (!is_android && !is_ios && !is_chromeos) {
1412 [ "../browser/net/disk_cache_dir_policy_handler_unittest.cc" ]
1414 if (!is_android && !is_ios) {
1416 [ "../browser/download/download_dir_policy_handler_unittest.cc" ]
1419 if (enable_web_speech) {
1420 sources += rebase_path(unit_gypi_values.chrome_unit_tests_speech_sources,
1424 if (enable_notifications) {
1426 rebase_path(unit_gypi_values.chrome_unit_tests_notifications_sources,
1431 # Android does not use the Message Center notification system.
1432 "../browser/notifications/message_center_notifications_unittest.cc",
1433 "../browser/notifications/message_center_settings_controller_unittest.cc",
1437 if (safe_browsing_mode == 1) {
1438 # TODO(sgurun): enable tests for safe_browsing==2.
1439 sources += rebase_path(
1440 unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources,
1443 defines += [ "FULL_SAFE_BROWSING" ]
1445 sources -= [ "../browser/safe_browsing/download_protection_service_unittest.cc" ]
1446 } else if (is_android) {
1448 # Android doesn't support download feedbacks.
1449 "../browser/safe_browsing/download_feedback_unittest.cc",
1450 "../browser/safe_browsing/download_feedback_service_unittest.cc",
1451 "../browser/safe_browsing/download_protection_service_unittest.cc",
1452 "../browser/safe_browsing/two_phase_uploader_unittest.cc",
1456 if (enable_autofill_dialog && !is_android) {
1457 sources += rebase_path(
1458 unit_gypi_values.chrome_unit_tests_autofill_dialog_sources,
1462 if (enable_plugins) {
1463 sources += rebase_path(unit_gypi_values.chrome_unit_tests_plugins_sources,
1467 if (enable_print_preview) {
1469 rebase_path(unit_gypi_values.chrome_unit_tests_print_preview_sources,
1473 if (enable_captive_portal_detection) {
1475 rebase_path(unit_gypi_values.chrome_unit_tests_captive_portal_sources,
1479 if (enable_session_service) {
1480 sources += rebase_path(
1481 unit_gypi_values.chrome_unit_tests_session_service_sources,
1485 if (enable_webrtc) {
1486 sources += rebase_path(unit_gypi_values.chrome_unit_tests_webrtc_sources,
1492 rebase_path(unit_gypi_values.chrome_unit_tests_chromeos_sources,
1497 "//ui/chromeos/resources",
1500 "../browser/signin/signin_global_error_unittest.cc",
1501 "../browser/signin/signin_manager_unittest.cc",
1502 "../browser/signin/signin_names_io_thread_unittest.cc",
1503 "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc",
1504 "../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
1508 deps += [ "//ui/events/devices" ]
1509 data_deps += [ "//tools/xdisplaycheck" ]
1511 sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ]
1513 if (cld_version == 0 || cld_version == 2) {
1514 # Unit tests should be independent of the CLD2 access mechanism, just use
1515 # static for simplicity.
1516 deps += [ "//third_party/cld_2:cld2_static" ]
1518 if (is_desktop_linux && cpu_arch == "x64") {
1519 # Only add this test for 64 bit builds because otherwise we need the 32
1520 # bit library on 64 bit systems when running this test.
1522 [ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ]
1524 "//chrome/browser:gnome_keyring",
1525 "//chrome/browser:gnome_keyring_direct",
1528 if (is_linux && !is_chromeos) {
1530 [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ]
1532 if (is_linux && use_aura) {
1535 "//dbus:test_support",
1536 "//ui/aura:test_support",
1539 if (is_linux && is_chrome_branded && cpu_arch == "x86") {
1540 ldflags = [ "-Wl,--strip-debug" ]
1543 sources += rebase_path(unit_gypi_values.chrome_unit_tests_mac_sources,
1547 "../browser/ui/tests/ui_gfx_image_unittest.cc",
1548 "../tools/convert_dict/convert_dict_unittest.cc",
1549 "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
1552 # The test fetches resources which means Mac need the app bundle to exist
1553 # on disk so it can pull from it.
1555 "//third_party/google_toolbox_for_mac",
1556 "//third_party/ocmock",
1559 # TODO(mark): We really want this for all non-static library targets,
1560 # but when we tried to pull it up to the common.gypi level, it broke
1561 # other things like the ui and startup tests. *shrug*
1562 ldflags = [ "-Wl,-ObjC" ]
1564 if (!is_mac && !is_ios) {
1566 "//third_party/hunspell",
1567 "//chrome:packed_extra_resources",
1568 "//chrome:packed_resources",
1569 "//chrome/tools/convert_dict:lib",
1572 if (is_win || is_mac) {
1573 sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_mac_sources,
1577 if (is_win || is_mac || is_chromeos) {
1578 sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ]
1581 deps += [ "//rlz:test_support" ]
1583 sources -= [ "../browser/rlz/rlz_unittest.cc" ]
1586 if (!is_component_build) {
1587 # Unit_tests pdb files can get too big when incremental linking is
1588 # on, disabling for this target.
1589 #'LinkIncremental': '<(msvs_debug_link_nonincremental)', TODO(GYP)
1592 sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_sources,
1596 # TODO: It would be nice to have these pulled in
1597 # automatically from direct_dependent_settings in
1598 # their various targets (net.gyp:net_resources, etc.),
1599 # but that causes errors in other targets when
1600 # resulting .res files get referenced multiple times.
1601 #'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
1602 #'<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc', TODO(GYP)
1603 #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc', TODO(GYP)
1607 #'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_1', TODO(GYP)
1608 #'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_2', TODO(GYP)
1609 #'chrome_version_resources', TODO(GYP)
1610 "//chrome_elf:blacklist_test_dll_1",
1611 "//third_party/iaccessible2",
1612 "//third_party/isimpledom",
1613 "//third_party/wtl",
1624 if (is_android || is_ios) {
1626 "../browser/devtools/device/webrtc/devtools_bridge_instances_request_unittest.cc",
1627 "../browser/ui/sync/sync_promo_ui_unittest.cc",
1631 "../browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc",
1632 "../browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc",
1634 deps += [ "//chrome/tools/profile_reset:jtl_compiler_lib" ]
1636 if (!is_android && !is_chromeos) {
1637 sources += rebase_path(
1638 unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources,
1642 if (enable_themes) {
1643 sources += rebase_path(unit_gypi_values.chrome_unit_tests_themes_sources,
1647 if (!is_android && (use_nss_certs || use_openssl_certs)) {
1648 sources += [ "../common/net/x509_certificate_model_unittest.cc" ]
1650 if (enable_supervised_users) {
1651 sources += rebase_path(
1652 unit_gypi_values.chrome_unit_tests_supervised_user_sources,
1656 if (safe_browsing_mode == 1 && enable_extensions) {
1657 sources += [ "../browser/extensions/blacklist_unittest.cc" ]
1659 if (cld_version == 1) {
1660 sources += [ "//third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc" ]
1661 defines += [ "CLD_WINDOWS" ]
1662 deps += [ "//third_party/cld" ]
1664 if (enable_app_list) {
1666 rebase_path(unit_gypi_values.chrome_unit_tests_app_list_sources,
1669 deps += [ "//ui/app_list:test_support" ]
1673 sources -= [ "browser/chromeos/events/event_rewriter_unittest.cc" ]
1675 if (!enable_plugin_installation) {
1676 sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]