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",
131 "//content/public/child",
132 "//content/public/common",
133 "//content/public/plugin",
134 "//content/public/renderer",
135 "//content/public/utility",
136 "//components/autofill/core/browser:test_support",
137 "//components/captive_portal:test_support",
138 "//components/infobars/core",
139 "//components/sessions:test_support",
140 "//components/user_manager:test_support",
141 "//components/web_resource:test_support",
142 "//google_apis:test_support",
143 "//ipc:test_support",
144 "//media:test_support",
145 "//ppapi:ppapi_shared",
146 "//sql:test_support",
147 "//third_party/leveldatabase",
149 "//ui/events:events_base",
154 if (enable_extensions) {
156 "//chrome/common/extensions/api",
157 "//extensions:test_support",
162 deps += [ "//crypto:platform" ]
165 deps += [ "//third_party/wtl" ]
168 "//win8:test_registrar_constants",
169 "//win8:test_support_win8",
174 if (enable_plugins) {
176 "ppapi/ppapi_test.cc",
177 "ppapi/ppapi_test.h",
183 deps += [ "//ash:test_support" ]
186 deps += [ "//ui/views:test_support" ]
189 if (enable_background) {
190 defines += [ "ENABLE_BACKGROUND=1" ]
193 if (enable_extensions) {
195 "//chrome/common/extensions/api",
196 "//extensions:test_support",
201 source_set("test_support_unit") {
204 "../browser/sync/glue/session_sync_test_helper.cc",
205 "../browser/sync/glue/session_sync_test_helper.h",
206 "base/run_all_unittests.cc",
212 "//chrome:resources",
216 "//mojo/environment:chromium",
217 "//third_party/mojo/src/mojo/edk/system",
221 if (!is_android && (!is_win || link_chrome_on_windows)) {
222 gypi_values = exec_script("//build/gypi_to_gn.py",
223 [ rebase_path("../chrome_tests.gypi") ],
225 [ "../chrome_tests.gypi" ])
227 test("interactive_ui_tests") {
228 sources = rebase_path(gypi_values.chrome_interactive_ui_test_sources,
232 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
238 "//chrome/browser/devtools",
240 "//chrome/test:test_support",
241 "//chrome:resources",
243 "//chrome:packed_extra_resources",
244 "//chrome:packed_resources",
245 "//content/app/resources",
247 "//google_apis:test_support",
249 "//net:net_resources",
250 "//net:test_support",
252 #"//ppapi:ppapi_tests", # TODO(GYP) this doesn't exist yet.
257 "//third_party/hunspell",
259 "//third_party/libpng",
260 "//third_party/npapi",
261 "//third_party/zlib",
262 "//ui/base:test_support",
263 "//ui/web_dialogs:test_support",
266 # Runtime dependencies
268 "//third_party/mesa:osmesa",
273 rebase_path(gypi_values.chrome_interactive_ui_test_views_sources,
278 "//ui/views:test_support",
279 "//ui/views/controls/webview:test_support",
282 sources += rebase_path(
283 gypi_values.chrome_interactive_ui_test_views_non_mac_sources,
288 # TODO(gbillock): aura linux does not support the automation for
289 # SendMouseMoveNotifyWhenDone
290 sources -= [ "../browser/ui/views/toolbar/toolbar_button_test.cc" ]
292 if (is_chromeos || !use_x11) {
294 "../../ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc",
295 "../../ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc",
300 if (is_linux && !is_chromeos) {
303 # TODO(port): This times out. Attempts have been made to fix the
304 # individual failures, but each time I disable a test from these
305 # suites, it seems like one or another starts timing out too.
306 "../browser/ui/views/keyboard_access_browsertest.cc",
309 # Everything but desktop Linux.
310 sources += rebase_path(
311 gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources,
318 rebase_path(gypi_values.chrome_interactive_ui_test_chromeos_sources,
321 sources += [ "../browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc" ]
323 # Use only the _chromeos version on ChromeOS.
324 "base/view_event_test_platform_part_ash.cc",
333 # TODO(GYP) this is also under a disable_nacl_untrusted==0 condition.
335 # '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap', TODO(GYP)
336 # '../components/nacl.gyp:nacl_helper', TODO(GYP)
337 # '../components/nacl_nonsfi.gyp:nacl_helper_nonsfi', TODO(GYP)
341 if (is_chrome_branded) {
343 # These tests are failing on official cros bots. crbug.com/431450.
344 "../browser/ui/views/bookmarks/bookmark_bar_view_test.cc",
348 # ChromeOS doesn't use panels, everybody else does.
350 rebase_path(gypi_values.chrome_interactive_ui_test_panels_sources,
354 # TODO(tapted): Include on mac when views panels are ported.
355 if (toolkit_views && !is_mac) {
356 sources += rebase_path(
357 gypi_values.chrome_interactive_ui_test_panels_views_sources,
364 # Non-Linux platforms (Linux includes ChromeOS here).
365 sources += rebase_path(
366 gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources,
372 sources += rebase_path(gypi_values.chrome_interactive_ui_test_win_sources,
375 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
377 "//chrome:chrome_version_resources",
378 "//third_party/isimpledom",
389 # TODO(mark): We really want this for all non-static library targets, but
390 # when we tried to pull it up to the common.gypi level, it broke other
391 # things like the ui and startup tests. *shrug*
392 ldflags += [ "-Wl,-ObjC" ]
395 if (cld_version == 0 || cld_version == 2) {
396 # Interactive tests should use whatever CLD2 data access mode that the
397 # application embedder is using.
398 deps += [ "//third_party/cld_2:cld2_platform_impl" ]
402 configs += [ "//build/config/linux:xtst" ]
403 datadeps += [ "//tools/xdisplaycheck" ]
406 if (enable_app_list) {
408 rebase_path(gypi_values.chrome_interactive_ui_test_app_list_sources,
414 sources += rebase_path(gypi_values.chrome_interactive_ui_test_ash_sources,
417 deps += [ "//ash:test_support" ]
420 if (enable_notifications) {
421 sources += rebase_path(
422 gypi_values.chrome_interactive_ui_test_notifications_sources,
426 # Non-ChromeOS notifications tests (ChromeOS does not use cross-platform
430 "../browser/notifications/notification_browsertest.cc",
431 "../browser/notifications/platform_notification_service_browsertest.cc",
437 # Android does not use the message center-based Notification system.
438 "../browser/notifications/message_center_notifications_browsertest.cc",
440 # TODO(peter): Enable the Notification browser tests.
441 "../browser/notifications/notification_browsertest.cc",
442 "../browser/notifications/platform_notification_service_browsertest.cc",
445 } # enable_notifications
447 if (use_aura || is_chromeos) {
449 [ "../../ui/views/corewm/desktop_capture_controller_unittest.cc" ]
453 source_set("sync_integration_test_support") {
455 sources = rebase_path(gypi_values.test_support_sync_integration_sources,
465 "//components/invalidation",
466 "//components/invalidation:test_support",
470 "//sync:test_support_sync_testserver",
471 "//sync:test_support_sync_fake_server",
472 "//ui/app_list:test_support",
477 "../browser/sync/test/integration/dictionary_helper.cc",
478 "../browser/sync/test/integration/dictionary_helper.h",
479 "../browser/sync/test/integration/dictionary_load_observer.cc",
480 "../browser/sync/test/integration/dictionary_load_observer.h",
483 if (!enable_app_list) {
485 "../browser/sync/test/integration/sync_app_list_helper.cc",
486 "../browser/sync/test/integration/sync_app_list_helper.h",
491 "../browser/sync/test/integration/wifi_credentials_helper.cc",
492 "../browser/sync/test/integration/wifi_credentials_helper.h",
497 # TODO(GYP) when v8's GN build supports "//v8:d8" then enable the code
498 # controlled by this flag (and the flg itself can be deleted).
499 has_d8_definition = false
501 if (has_d8_definition) {
502 template("js2webui") {
503 action_name = target_name + "_action"
504 source_set_name = target_name
506 action_foreach(action_name) {
508 visibility = [ ":$source_set_name" ]
509 script = "//tools/gypv8sh.py"
511 sources = invoker.sources
514 get_label_info("//v8:d8($host_toolchain)", "root_out_dir") + "/d8"
520 "//chrome/third_party/mock4js/mock4js.js",
521 "//chrome/test/data/webui/test_api.js",
522 "//chrome/test/base/js2gtest.js",
524 inputs = [ d8_path ] + input_js
527 "$target_gen_dir/{{source_name_part}}-gen.cc",
528 "$root_out_dir/test_data/chrome/{{source_root_relative_dir}}/{{source_file_part}}",
532 # Need "./" for script to find binary (cur dir is not on path).
533 "./" + rebase_path(d8_path, root_build_dir),
535 args += rebase_path(input_js, root_build_dir) + [ "webui" ]
536 if (v8_use_external_startup_data) {
537 args += [ "--external=y" ]
539 args += [ "--external=n" ]
543 "{{source_root_relative_dir}}/{{source_file_part}}",
545 args += rebase_path(outputs, root_build_dir)
548 "//v8:d8($host_toolchain)",
552 source_set(source_set_name) {
554 if (defined(invoker.visibility)) {
555 visibility = invoker.visibility
557 sources = get_target_outputs(":$action_name")
558 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
562 # The generator implicitly makes includes from these targets.
567 if (defined(invoker.deps)) {
573 js2webui("browser_tests_js_webui") {
574 sources = rebase_path(gypi_values.chrome_browser_tests_webui_js_sources,
577 if (is_chrome_branded) {
579 sources -= [ "data/webui/accessibility_audit_browsertest.js" ]
582 sources -= [ "data/webui/certificate_viewer_dialog_test.js" ]
584 if (!enable_app_list) {
585 sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ]
587 if (!enable_supervised_users) {
589 [ "../browser/ui/webui/downloads_ui_supervised_browsertest.js" ]
597 test("browser_tests") {
599 "base/browser_tests_main.cc",
602 rebase_path(gypi_values.chrome_browser_tests_sources, ".", "//chrome")
604 rebase_path(gypi_values.chrome_browser_extensions_test_support_sources,
609 ":sync_integration_test_support",
614 "//base/test:test_support",
615 "//chrome:browser_tests_pak",
616 "//chrome:packed_extra_resources",
617 "//chrome:packed_resources",
618 "//chrome:resources",
621 "//chrome/common/extensions/api",
623 "//chrome/test/perf",
624 "//components/autofill/content/browser:risk_proto",
625 "//components/autofill/content/browser:test_support",
626 "//components/captive_portal:test_support",
627 "//components/dom_distiller/content",
628 "//components/dom_distiller/core:test_support",
629 "//components/resources",
630 "//components/strings",
631 "//components/translate/core/common",
632 "//components/user_manager:test_support",
634 "//crypto:test_support",
635 "//device/bluetooth:mocks",
636 "//device/serial:test_support",
637 "//extensions/common/api",
638 "//google_apis:test_support",
640 "//media/base:test_support",
641 "//media/cast:test_support",
643 "//net:test_support",
647 "//sync:test_support_sync_api",
651 "//third_party/cacheinvalidation",
653 "//third_party/leveldatabase",
654 "//third_party/libaddressinput",
655 "//third_party/libjingle",
656 "//third_party/safe_browsing:test_support",
657 "//third_party/widevine/cdm:version_h",
658 "//ui/accessibility:test_support",
659 "//ui/compositor:test_support",
661 "//ui/web_dialogs:test_support",
664 if (has_d8_definition) {
665 deps += [ ":browser_tests_js_webui" ]
668 # Runtime dependencies
670 #"//ppapi:ppapi_tests", # TODO(GYP) this doesn't exist yet.
671 #'../remoting/remoting.gyp:remoting_browser_test_resources', TODO(GYP)
672 #'../remoting/remoting.gyp:remoting_webapp_unittest', TODO(GYP)
673 "//third_party/mesa:osmesa",
674 "//third_party/widevine/cdm:widevine_test_license_server",
677 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
679 # TODO(GYP) if (is_win) {
680 # ['incremental_chrome_dll==1', {
681 # 'UseLibraryDependencyInputs': "true",
684 if (cld_version == 0 || cld_version == 2) {
685 # Because the browser_tests use translate, they need CLD data.
686 deps += [ "//third_party/cld_2:cld2_platform_impl" ]
689 if (!enable_one_click_signin) {
690 sources -= [ "../browser/ui/sync/one_click_signin_bubble_links_delegate_browsertest.cc" ]
694 "../browser/extensions/extension_nacl_browsertest.cc",
695 "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc",
697 deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
699 if (enable_nacl_untrusted) {
701 "nacl/nacl_browsertest.cc",
702 "nacl/nacl_browsertest_uma.cc",
703 "nacl/nacl_browsertest_util.cc",
704 "nacl/nacl_browsertest_util.h",
705 "nacl/pnacl_header_test.cc",
706 "nacl/pnacl_header_test.h",
709 #'test/data/nacl/nacl_test_data.gyp:*', # TODO(GYP)
710 #'../ppapi/native_client/native_client.gyp:nacl_irt', # TODO(GYP)
711 #'../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests', # TODO(GYP)
712 #'../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive', # TODO(GYP)
713 #'../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries', # TODO(GYP)
714 #'../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app', # TODO(GYP) #'../ppapi/ppapi_tests_mojo.gyp:ppapi_tests_mojo', # TODO(GYP)
715 #'../ppapi/ppapi_tests_mojo.gyp:ppapi_tests_mojo', # TODO(GYP)
718 sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ]
721 #'browser_chromeos', TODO(GYP)
722 #'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data', TODO(GYP)
725 if (is_win || is_linux) {
726 sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ]
728 #'browser/nacl_host/test/mock_nacl_gdb.gyp:mock_nacl_gdb', TODO(GYP)
732 # TODO(halyavin) NaCl on Windows can't open debug stub socket in
733 # browser process as needed by this test. See http://crbug.com/157312.
734 sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ]
736 #'chrome.gyp:chrome_nacl_win64', TODO(GYP)
741 #'../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap', TODO(GYP)
742 #'../components/nacl.gyp:nacl_helper', TODO(GYP)
743 #'../components/nacl_nonsfi.gyp:nacl_helper_nonsfi', TODO(GYP)
747 sources -= [ "test/data/chromeos/oobe_webui_browsertest.js" ]
750 if (debug_devtools) {
751 defines += [ "DEBUG_DEVTOOLS=1" ]
754 deps += [ "//ash:test_support" ]
756 if (use_aura || toolkit_views) {
757 deps += [ "//ui/events:test_support" ]
760 sources += rebase_path(gypi_values.chrome_browser_tests_views_sources,
763 deps += [ "//ui/views" ]
766 rebase_path(gypi_values.chrome_browser_tests_views_non_mac_sources,
772 sources += rebase_path(gypi_values.chrome_browser_tests_chromeos_sources,
776 "../../apps/load_and_launch_browsertest.cc",
777 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
778 "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
780 # chromeos does not support profile list avatar menu
781 "../browser/profiles/profile_list_desktop_browsertest.cc",
782 "../browser/service_process/service_process_control_browsertest.cc",
783 "../browser/signin/signin_browsertest.cc",
785 # chromeos does not use cross-platform panels
786 "../browser/ui/panels/panel_extension_browsertest.cc",
788 # chromeos does not use the desktop user manager
789 "../browser/ui/webui/signin/user_manager_ui_browsertest.cc",
793 "//dbus:test_support",
795 #"//ui/login:resources", TODO(GYP)
799 "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
800 "../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc",
801 "../browser/extensions/api/terminal/terminal_private_apitest.cc",
802 "../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
803 "../browser/net/nss_context_chromeos_browsertest.cc",
804 "../browser/ui/ash/keyboard_controller_browsertest.cc",
805 "data/webui/certificate_viewer_ui_test-inl.h",
808 sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ]
811 if (enable_configuration_policy) {
812 sources += rebase_path(gypi_values.chrome_browser_tests_policy_sources,
816 if (enable_web_speech) {
817 sources += rebase_path(gypi_values.chrome_browser_tests_speech_sources,
821 if (safe_browsing_mode == 1) {
822 sources += rebase_path(
823 gypi_values.chrome_browser_tests_full_safe_browsing_sources,
826 defines += [ "FULL_SAFE_BROWSING" ]
828 if (enable_captive_portal_detection) {
829 sources += [ "../browser/captive_portal/captive_portal_browsertest.cc" ]
831 if (!enable_webrtc) {
833 "../browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc",
834 "../browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc",
835 "../browser/media/chrome_webrtc_browsertest.cc",
836 "../browser/media/chrome_webrtc_disable_encryption_flag_browsertest.cc",
837 "../browser/media/chrome_webrtc_getmediadevices_browsertest.cc",
841 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
843 "//chrome:chrome_version_resources",
849 "../app/chrome_command_ids.h",
850 "../app/chrome_dll_resource.h",
851 "../app/chrome_version.rc.version",
852 "../browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc",
855 if (!is_chromeos && use_aura) {
857 # On Windows and Linux, we currently don't support enough of the
858 # ash environment to run these unit tests.
860 # TODO: enable these on windows and linux.
861 "../browser/ui/ash/accelerator_commands_browsertest.cc",
862 "../browser/ui/ash/accelerator_controller_browsertest.cc",
863 "../browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc",
864 "../browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc",
865 "../browser/ui/ash/shelf_browsertest.cc",
866 "../browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc",
870 # TODO(mark): We really want this for all non-static library
871 # targets, but when we tried to pull it up to the common.gypi
872 # level, it broke other things like the ui and startup tests. *shrug*
873 ldflags = [ "-Wl,-ObjC" ]
875 # Other platforms only need
876 # chrome_resources.gyp:{packed_extra_resources,packed_resources},
877 # and can build this target standalone much faster.
879 #'app_mode_app_support', TODO(GYP)
881 #'../components/components.gyp:breakpad_stubs', TODO(GYP)
882 #'../third_party/ocmock/ocmock.gyp:ocmock', TODO(GYP)
885 "../browser/media_galleries/fileapi/iphoto_data_provider_browsertest.cc",
886 "../browser/renderer_host/chrome_render_widget_host_view_mac_delegate_browsertest.cc",
887 "../browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm",
888 "../browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc",
891 # TODO(groby): This test depends on hunspell and we cannot run it on
892 # Mac, which does not use hunspell by default.
893 "../browser/spellchecker/spellcheck_service_browsertest.cc",
895 # TODO(rouslan): This test depends on the custom dictionary UI,
896 # which is disabled on Mac.
897 "../browser/ui/webui/options/edit_dictionary_browsertest.js",
899 # TODO(rouslan): This test depends on hunspell and we cannot run it
900 # on Mac, which does use hunspell by default.
901 "../browser/ui/webui/options/language_options_dictionary_download_browsertest.js",
903 # ProcessSingletonMac doesn"t do anything.
904 "../browser/process_singleton_browsertest.cc",
906 # This test depends on GetCommandLineForRelaunch, which is not
908 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
910 # single-process mode hangs on Mac sometimes because of multiple UI
911 # message loops. See 306348
912 "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
913 "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
914 "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
917 if (is_mac || is_win) {
919 "../browser/extensions/api/networking_private/networking_private_apitest.cc",
920 "../browser/extensions/api/networking_private/networking_private_service_client_apitest.cc",
921 "../browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc",
922 "../browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc",
924 deps += [ "//components/wifi:test_support" ]
926 if (!is_posix || is_chromeos) {
927 sources -= [ "../common/time_format_browsertest.cc" ]
931 "../browser/policy/cloud/component_cloud_policy_browsertest.cc",
932 "../browser/prefs/pref_hash_browsertest.cc",
937 "../browser/extensions/api/networking_private/networking_private_apitest.cc",
938 "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
941 if (!is_android && !is_ios) {
943 [ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ]
944 deps += [ "//components/copresence" ]
946 if (!is_android && !is_ios && !is_linux) {
947 # NPAPI test plugin only works on some platforms.
949 #'../content/content_shell_and_tests.gyp:copy_npapi_test_plugin', TODO(GYP)
952 if (enable_app_list) {
953 sources += rebase_path(gypi_values.chrome_browser_tests_app_list_sources,
957 if (enable_supervised_users) {
959 rebase_path(gypi_values.chrome_browser_tests_supervised_user_sources,
963 if (enable_pepper_cdms) {
964 # Runtime dependencies.
966 "//media/cdm/ppapi:clearkeycdmadapter",
967 #'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter', TODO(GYP)
970 if (!enable_print_preview) {
972 "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc",
973 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
974 "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
975 "../browser/printing/print_preview_dialog_controller_browsertest.cc",
976 "../browser/printing/print_preview_pdf_generated_browsertest.cc",
977 "../browser/service_process/service_process_control_browsertest.cc",
978 "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc",
979 "data/webui/print_preview.cc",
980 "data/webui/print_preview.h",
981 "data/webui/print_preview.js",
985 sources += [ "../browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc" ]
988 deps += [ "//build/config/linux:libbrlapi" ]
990 sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ]
992 if (is_chrome_branded) {
994 # These tests depend on single process mode, which is disabled in
996 "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
997 "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
998 "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
1001 if (!enable_autofill_dialog || is_android || is_ios) {
1002 deps -= [ "//third_party/libaddressinput" ]
1007 "../browser/chromeos/input_method/input_method_engine_browsertests.cc",
1008 "../browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc",
1011 if (enable_remoting) {
1012 sources += rebase_path(gypi_values.chrome_browser_tests_remoting_sources,
1015 #deps += [ "//remoting:remoting_webapp" ] TODO(GYP)
1018 deps += [ "//tools/xdisplaycheck" ]
1022 test("sync_integration_tests") {
1024 rebase_path(gypi_values.sync_integration_tests_sources, ".", "//chrome")
1026 # TODO(phajdan.jr): Only temporary, to make transition easier.
1027 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1030 ":sync_integration_test_support",
1033 "//chrome:packed_extra_resources",
1034 "//chrome:packed_resources",
1035 "//chrome:resources",
1038 "//chrome/renderer",
1039 "//crypto:platform",
1043 "//third_party/icu",
1044 "//third_party/leveldatabase",
1045 "//third_party/npapi",
1046 "//third_party/WebKit/public:blink",
1049 if (cld_version == 0 || cld_version == 2) {
1050 # Language detection is irrelevant to sync, so it can depend on any
1051 # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1052 deps += [ "//third_party/cld_2:cld2_dynamic" ]
1055 # Dictionary sync is disabled on Mac.
1057 "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc",
1058 "../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
1059 "../browser/sync/test/integration/two_client_dictionary_sync_test.cc",
1062 # The sync_integration_tests do not run on mac without this flag.
1063 # Search for comments about "xcode_settings" elsewhere in this file.
1064 ldflags = [ "-Wl,-ObjC" ]
1067 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
1069 "//chrome:chrome_version_resources",
1070 "//third_party/wtl",
1074 sources -= [ "../app/chrome_version.rc.version" ]
1078 "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc",
1079 "../browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc",
1083 if (toolkit_views) {
1084 deps += [ "//ui/views" ]
1086 if (enable_basic_printing || enable_print_preview) {
1087 deps += [ "//printing" ]
1089 if (!enable_app_list) {
1091 "../browser/sync/test/integration/single_client_app_list_sync_test.cc",
1092 "../browser/sync/test/integration/two_client_app_list_sync_test.cc",
1095 if (!enable_supervised_users) {
1096 sources -= [ "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc" ]
1100 test("sync_performance_tests") {
1102 rebase_path(gypi_values.sync_performance_tests_sources, ".", "//chrome")
1104 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1107 ":sync_integration_test_support",
1109 "//crypto:platform",
1115 if (cld_version == 0 || cld_version == 2) {
1116 # Language detection is irrelevant to sync, so it can depend on any
1117 # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1118 deps += [ "//third_party/cld_2:cld2_dynamic" ]
1122 # Dictionary sync is disabled on Mac.
1123 sources -= [ "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc" ]
1125 # The sync_performance_tests do not run on mac without this flag.
1126 # Search for comments about "xcode_settings" elsewhere in this file.
1127 ldflags = [ "-Wl,-ObjC" ]
1130 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
1132 "//chrome:chrome_version_resources",
1133 "//third_party/wtl",
1137 sources -= [ "../app/chrome_version.rc.version" ]
1140 if (toolkit_views) {
1141 deps += [ "//ui/views" ]
1145 # Executable to measure time to load libraries.
1146 test("load_library_perf_tests") {
1148 "../browser/load_library_perf_test.cc",
1152 "//base/test:test_support_perf",
1155 "//third_party/widevine/cdm:version_h",
1158 # TODO(GYP) CDM adapter stuff.
1159 #if (enable_pepper_cdms) {
1161 # "//media/cdm/ppapi:clearkeycdmadapter",
1162 # "//ppapi:ppapi_cpp",
1163 # "//third_party/widevine/cdm:adapter",
1168 unit_gypi_values = exec_script("//build/gypi_to_gn.py",
1169 [ rebase_path("../chrome_tests_unit.gypi") ],
1171 [ "../chrome_tests_unit.gypi" ])
1173 test("unit_tests") {
1175 rebase_path(unit_gypi_values.chrome_unit_tests_sources, ".", "//chrome")
1180 # NOTE: New depndencies should generally be added in the OS!="ios"
1181 # dependencies block below, rather than here.
1182 # Unit tests should only depend on:
1183 # 1) everything that the chrome binaries depend on:
1184 "//chrome:browser_dependencies",
1185 "//chrome:child_dependencies",
1187 # 2) test-specific support libraries:
1188 ":test_support_unit",
1189 "//base/test:test_support",
1190 "//chrome/test:test_support",
1191 "//components/resources",
1192 "//components/content_settings/core/test:test_support",
1193 "//content/test:test_support",
1194 "//content/public/app:both",
1195 "//crypto:platform",
1196 "//crypto:test_support",
1198 "//net:test_support",
1199 "//sync:test_support_sync_api",
1200 "//sync:test_support_sync_core",
1201 "//sync:test_support_sync_internal_api",
1205 # 3) anything tests directly depend on
1207 "//chrome:resources",
1209 "//courgette:courgette_lib",
1212 "//third_party/cacheinvalidation",
1213 "//third_party/icu",
1214 "//third_party/libxml",
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 "//device/bluetooth:mocks",
1233 "//content/app/resources",
1234 "//gpu:test_support",
1235 "//media:test_support",
1237 #'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared', TODO(GYP)
1238 "//third_party/leveldatabase",
1239 "//third_party/libaddressinput",
1240 "//third_party/libjingle",
1241 "//third_party/libphonenumber",
1242 "//tools/json_schema_compiler/test",
1249 deps -= [ "//third_party/libaddressinput" ]
1251 # Some android targets still depend on --gc-sections to link.
1252 # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
1253 ldflags = [ "-Wl,--gc-sections" ]
1254 deps += [ "//testing/android:native_test_native_code" ]
1257 rebase_path(unit_gypi_values.chrome_unit_tests_non_android_sources,
1262 if (is_ios || is_chromeos) {
1264 [ "../browser/metrics/signin_status_metrics_provider_unittest.cc" ]
1266 if (enable_background) {
1268 rebase_path(unit_gypi_values.chrome_unit_tests_background_sources,
1272 if (enable_spellcheck) {
1274 rebase_path(unit_gypi_values.chrome_unit_tests_spellchecker_sources,
1277 if (is_mac && !is_ios) {
1278 deps += [ "//third_party/hunspell" ]
1282 if (enable_one_click_signin) {
1283 sources += rebase_path(
1284 unit_gypi_values.chrome_unit_tests_one_click_signin_sources,
1289 "../browser/ui/sync/one_click_signin_helper_unittest.cc",
1290 "../browser/ui/sync/one_click_signin_sync_starter_unittest.cc",
1293 if (!toolkit_views) {
1294 sources -= [ "../browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc" ]
1298 sources += rebase_path(unit_gypi_values.chrome_unit_tests_nacl_sources,
1302 if (enable_extensions) {
1304 rebase_path(unit_gypi_values.chrome_unit_tests_extensions_sources,
1308 "//chrome/common/extensions/api",
1309 "//extensions:extensions_resources",
1310 "//extensions/strings",
1312 if (enable_configuration_policy) {
1313 sources += rebase_path(
1314 unit_gypi_values.chrome_unit_tests_extensions_policy_sources,
1319 sources += rebase_path(
1320 unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources,
1325 if (toolkit_views) {
1327 "//components/web_modal:test_support",
1329 "//ui/views:test_support",
1332 # TODO(tapted): Enable toolkit-views unit_tests on Mac when their
1333 # respective implementations are linked in. http://crbug.com/412234.
1334 sources += rebase_path(unit_gypi_values.chrome_unit_tests_views_sources,
1340 sources += rebase_path(unit_gypi_values.chrome_unit_tests_ash_sources,
1344 "//ash:test_support",
1349 # We eventually want to compile both in Win Aura builds, see
1350 # http://crbug.com/155545.
1352 sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ]
1356 sources += [ "//ui/views/controls/webview/webview_unittest.cc" ]
1359 "//ui/aura:test_support",
1360 "//ui/views:test_support",
1363 if (!is_chromeos && is_linux) {
1365 rebase_path(unit_gypi_values.chrome_unit_tests_desktop_linux_sources,
1369 if (!is_chromeos && !use_ozone && is_linux) {
1371 "//chrome/browser/ui/libgtk2ui",
1372 "//build/config/linux:gio",
1374 if (!is_component_build) {
1375 # TODO(erg): This file does not compile in shared library mode because
1376 # it is reaching into the internals of libgtk2ui, which shouldn't be
1377 # linked with the rest of chrome. This should either be fixed by
1378 # creating a separate unit test target, or by deleting the test.
1379 sources += [ "../browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2_unittest.cc" ]
1383 if (enable_task_manager) {
1385 rebase_path(unit_gypi_values.chrome_unit_tests_task_manager_sources,
1390 sources += rebase_path(unit_gypi_values.chrome_unit_tests_mdns_sources,
1394 if (enable_service_discovery) {
1395 sources += rebase_path(
1396 unit_gypi_values.chrome_unit_tests_service_discovery_sources,
1400 if (enable_configuration_policy) {
1401 sources += rebase_path(
1402 unit_gypi_values.chrome_unit_tests_configuration_policy_sources,
1407 [ "../browser/policy/cloud/user_policy_signin_service_unittest.cc" ]
1408 } else if (is_android) {
1409 sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ]
1411 if (!is_android && !is_ios && !is_chromeos) {
1413 [ "../browser/net/disk_cache_dir_policy_handler_unittest.cc" ]
1415 if (!is_android && !is_ios) {
1417 [ "../browser/download/download_dir_policy_handler_unittest.cc" ]
1420 if (enable_web_speech) {
1421 sources += rebase_path(unit_gypi_values.chrome_unit_tests_speech_sources,
1425 if (enable_notifications) {
1427 rebase_path(unit_gypi_values.chrome_unit_tests_notifications_sources,
1432 # Android does not use the Message Center notification system.
1433 "../browser/notifications/message_center_notifications_unittest.cc",
1434 "../browser/notifications/message_center_settings_controller_unittest.cc",
1438 if (safe_browsing_mode == 1) {
1439 # TODO(sgurun): enable tests for safe_browsing==2.
1440 sources += rebase_path(
1441 unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources,
1444 defines += [ "FULL_SAFE_BROWSING" ]
1446 sources -= [ "../browser/safe_browsing/download_protection_service_unittest.cc" ]
1447 } else if (is_android) {
1449 # Android doesn't support download feedbacks.
1450 "../browser/safe_browsing/download_feedback_unittest.cc",
1451 "../browser/safe_browsing/download_feedback_service_unittest.cc",
1452 "../browser/safe_browsing/download_protection_service_unittest.cc",
1453 "../browser/safe_browsing/two_phase_uploader_unittest.cc",
1457 if (enable_autofill_dialog && !is_android) {
1458 sources += rebase_path(
1459 unit_gypi_values.chrome_unit_tests_autofill_dialog_sources,
1463 if (enable_plugins) {
1464 sources += rebase_path(unit_gypi_values.chrome_unit_tests_plugins_sources,
1468 if (enable_print_preview) {
1470 rebase_path(unit_gypi_values.chrome_unit_tests_print_preview_sources,
1474 if (enable_captive_portal_detection) {
1476 rebase_path(unit_gypi_values.chrome_unit_tests_captive_portal_sources,
1480 if (enable_session_service) {
1481 sources += rebase_path(
1482 unit_gypi_values.chrome_unit_tests_session_service_sources,
1486 if (enable_webrtc) {
1487 sources += rebase_path(unit_gypi_values.chrome_unit_tests_webrtc_sources,
1493 rebase_path(unit_gypi_values.chrome_unit_tests_chromeos_sources,
1498 "//ui/chromeos/resources",
1501 "../browser/signin/signin_global_error_unittest.cc",
1502 "../browser/signin/signin_manager_unittest.cc",
1503 "../browser/signin/signin_names_io_thread_unittest.cc",
1504 "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc",
1505 "../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
1509 deps += [ "//ui/events/devices" ]
1510 data_deps += [ "//tools/xdisplaycheck" ]
1512 sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ]
1514 if (cld_version == 0 || cld_version == 2) {
1515 # Unit tests should be independent of the CLD2 access mechanism, just use
1516 # static for simplicity.
1517 deps += [ "//third_party/cld_2:cld2_static" ]
1519 if (is_desktop_linux && cpu_arch == "x64") {
1520 # Only add this test for 64 bit builds because otherwise we need the 32
1521 # bit library on 64 bit systems when running this test.
1523 [ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ]
1525 "//chrome/browser:gnome_keyring",
1526 "//chrome/browser:gnome_keyring_direct",
1529 if (is_linux && !is_chromeos) {
1531 [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ]
1533 if (is_linux && use_aura) {
1536 "//dbus:test_support",
1537 "//ui/aura:test_support",
1540 if (is_linux && is_chrome_branded && cpu_arch == "x86") {
1541 ldflags = [ "-Wl,--strip-debug" ]
1544 sources += rebase_path(unit_gypi_values.chrome_unit_tests_mac_sources,
1548 "../browser/ui/tests/ui_gfx_image_unittest.cc",
1549 "../tools/convert_dict/convert_dict_unittest.cc",
1550 "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
1553 # The test fetches resources which means Mac need the app bundle to exist
1554 # on disk so it can pull from it.
1556 "//third_party/google_toolbox_for_mac",
1557 "//third_party/ocmock",
1560 # TODO(mark): We really want this for all non-static library targets,
1561 # but when we tried to pull it up to the common.gypi level, it broke
1562 # other things like the ui and startup tests. *shrug*
1563 ldflags = [ "-Wl,-ObjC" ]
1565 if (!is_mac && !is_ios) {
1567 "//third_party/hunspell",
1568 "//chrome:packed_extra_resources",
1569 "//chrome:packed_resources",
1570 "//chrome/tools/convert_dict:lib",
1573 if (is_win || is_mac) {
1574 sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_mac_sources,
1578 if (is_win || is_mac || is_chromeos) {
1579 sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ]
1582 deps += [ "//rlz:test_support" ]
1584 sources -= [ "../browser/rlz/rlz_unittest.cc" ]
1587 if (!is_component_build) {
1588 # Unit_tests pdb files can get too big when incremental linking is
1589 # on, disabling for this target.
1590 #'LinkIncremental': '<(msvs_debug_link_nonincremental)', TODO(GYP)
1593 sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_sources,
1597 # TODO: It would be nice to have these pulled in
1598 # automatically from direct_dependent_settings in
1599 # their various targets (net.gyp:net_resources, etc.),
1600 # but that causes errors in other targets when
1601 # resulting .res files get referenced multiple times.
1602 #'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
1603 #'<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc', TODO(GYP)
1604 #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc', TODO(GYP)
1608 #'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_1', TODO(GYP)
1609 #'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_2', TODO(GYP)
1610 #'chrome_version_resources', TODO(GYP)
1611 "//chrome_elf:blacklist_test_dll_1",
1612 "//third_party/iaccessible2",
1613 "//third_party/isimpledom",
1614 "//third_party/wtl",
1625 if (is_android || is_ios) {
1627 "../browser/devtools/device/webrtc/devtools_bridge_instances_request_unittest.cc",
1628 "../browser/ui/sync/sync_promo_ui_unittest.cc",
1632 "../browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc",
1633 "../browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc",
1635 deps += [ "//chrome/tools/profile_reset:jtl_compiler_lib" ]
1637 if (!is_android && !is_chromeos) {
1638 sources += rebase_path(
1639 unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources,
1643 if (enable_themes) {
1644 sources += rebase_path(unit_gypi_values.chrome_unit_tests_themes_sources,
1648 if (!is_android && (use_nss_certs || use_openssl_certs)) {
1649 sources += [ "../common/net/x509_certificate_model_unittest.cc" ]
1651 if (enable_supervised_users) {
1652 sources += rebase_path(
1653 unit_gypi_values.chrome_unit_tests_supervised_user_sources,
1657 if (safe_browsing_mode == 1 && enable_extensions) {
1658 sources += [ "../browser/extensions/blacklist_unittest.cc" ]
1660 if (cld_version == 1) {
1661 sources += [ "//third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc" ]
1662 defines += [ "CLD_WINDOWS" ]
1663 deps += [ "//third_party/cld" ]
1665 if (enable_app_list) {
1667 rebase_path(unit_gypi_values.chrome_unit_tests_app_list_sources,
1670 deps += [ "//ui/app_list:test_support" ]
1674 sources -= [ "../browser/chromeos/events/event_rewriter_unittest.cc" ]
1676 if (!enable_plugin_installation) {
1677 sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]