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
17 # GYP version: chrome/chrome_tests_unit.gypi:test_support_common
18 source_set("test_support") {
23 "base/chrome_process_util.cc",
24 "base/chrome_process_util.h",
25 "base/chrome_process_util_mac.cc",
26 "base/chrome_render_view_host_test_harness.cc",
27 "base/chrome_render_view_host_test_harness.h",
28 "base/chrome_test_launcher.cc",
29 "base/chrome_test_launcher.h",
30 "base/chrome_test_suite.cc",
31 "base/chrome_test_suite.h",
32 "base/chrome_unit_test_suite.cc",
33 "base/chrome_unit_test_suite.h",
34 "base/find_in_page_observer.cc",
35 "base/find_in_page_observer.h",
36 "base/history_index_restore_observer.cc",
37 "base/history_index_restore_observer.h",
38 "base/in_process_browser_test.cc",
39 "base/in_process_browser_test.h",
40 "base/profile_mock.cc",
41 "base/profile_mock.h",
42 "base/scoped_browser_locale.cc",
43 "base/scoped_browser_locale.h",
44 "base/scoped_testing_local_state.cc",
45 "base/scoped_testing_local_state.h",
46 "base/test_browser_window.cc",
47 "base/test_browser_window.h",
48 "base/test_launcher_utils.cc",
49 "base/test_launcher_utils.h",
50 "base/test_switches.cc",
51 "base/test_switches.h",
52 "base/testing_browser_process.cc",
53 "base/testing_browser_process.h",
54 "base/testing_browser_process_platform_part.cc",
55 "base/testing_browser_process_platform_part.h",
56 "base/testing_io_thread_state.cc",
57 "base/testing_io_thread_state.h",
58 "base/testing_pref_service_syncable.cc",
59 "base/testing_pref_service_syncable.h",
60 "base/testing_profile.cc",
61 "base/testing_profile.h",
62 "base/testing_profile_manager.cc",
63 "base/testing_profile_manager.h",
66 "base/ui_test_utils.cc",
67 "base/ui_test_utils.h",
68 "logging/win/file_logger.cc",
69 "logging/win/file_logger.h",
70 "logging/win/log_file_printer.cc",
71 "logging/win/log_file_printer.h",
72 "logging/win/log_file_reader.cc",
73 "logging/win/log_file_reader.h",
74 "logging/win/mof_data_parser.cc",
75 "logging/win/mof_data_parser.h",
76 "logging/win/test_log_collector.cc",
77 "logging/win/test_log_collector.h",
80 # New deps should go in the non-iOS section below.
82 "//content/test:test_support",
85 "//base:prefs_test_support",
86 "//base/test:test_support",
89 "//chrome/app:test_support",
91 #"//chrome/app/theme:theme_resources",
92 "//chrome/browser:test_support",
93 "//chrome/common:test_support",
94 "//chrome/renderer:test_support",
95 "//components/bookmarks/test",
96 "//components/gcm_driver:test_support",
97 "//components/history/core/test:test",
98 "//components/metrics:test_support",
99 "//components/omnibox:test_support",
100 "//components/ownership",
101 "//components/password_manager/core/browser:test_support",
102 "//components/pref_registry:test_support",
103 "//components/rappor:test_support",
104 "//components/search_engines:test_support",
105 "//components/signin/core/browser:test_support",
106 "//components/sync_driver:test_support",
107 "//components/update_client:test_support",
108 "//content/public/app:both",
109 "//ui/gfx:test_support",
111 "//net:test_support",
114 "//sql:test_support",
118 "//third_party/zlib",
119 "//ui/message_center:test_support",
128 "//content/public/child",
129 "//content/public/common",
130 "//content/public/plugin",
131 "//content/public/renderer",
132 "//content/public/utility",
133 "//components/autofill/core/browser:test_support",
134 "//components/captive_portal:test_support",
135 "//components/infobars/core",
136 "//components/sessions:test_support",
137 "//components/user_manager:test_support",
138 "//components/web_resource:test_support",
139 "//google_apis:test_support",
140 "//ipc:test_support",
141 "//media:test_support",
142 "//ppapi/shared_impl",
143 "//sql:test_support",
144 "//third_party/leveldatabase",
146 "//ui/events:events_base",
151 if (enable_extensions) {
153 "//chrome/common/extensions/api",
154 "//extensions:test_support",
159 deps += [ "//crypto:platform" ]
162 deps += [ "//third_party/wtl" ]
165 "//win8:test_registrar_constants",
166 "//win8:test_support_win8",
171 if (enable_plugins) {
173 "ppapi/ppapi_test.cc",
174 "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",
219 import("//chrome/chrome_tests.gni")
221 test("interactive_ui_tests") {
223 rebase_path(chrome_tests_gypi_values.chrome_interactive_ui_test_sources,
227 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
233 "//chrome/browser/devtools",
235 "//chrome/test:test_support",
236 "//chrome:resources",
238 "//chrome:packed_extra_resources",
239 "//chrome:packed_resources",
240 "//content/app/resources",
242 "//crypto:test_support",
243 "//google_apis:test_support",
245 "//net:net_resources",
246 "//net:test_support",
248 #"//ppapi:ppapi_tests", # TODO(GYP) this doesn't exist yet.
253 "//third_party/hunspell",
255 "//third_party/libpng",
256 "//third_party/npapi",
257 "//third_party/zlib",
258 "//ui/base:test_support",
259 "//ui/web_dialogs:test_support",
262 # Runtime dependencies
264 "//third_party/mesa:osmesa",
268 sources += rebase_path(
269 chrome_tests_gypi_values.chrome_interactive_ui_test_views_sources,
274 "//ui/views:test_support",
275 "//ui/views/controls/webview:test_support",
278 sources += rebase_path(
279 chrome_tests_gypi_values.chrome_interactive_ui_test_views_non_mac_sources,
284 # TODO(gbillock): aura linux does not support the automation for
285 # SendMouseMoveNotifyWhenDone
286 sources -= [ "../browser/ui/views/toolbar/toolbar_button_test.cc" ]
288 if (is_chromeos || !use_x11) {
290 "../../ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc",
291 "../../ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc",
296 if (is_linux && !is_chromeos) {
299 # TODO(port): This times out. Attempts have been made to fix the
300 # individual failures, but each time I disable a test from these
301 # suites, it seems like one or another starts timing out too.
302 "../browser/ui/views/keyboard_access_browsertest.cc",
305 # Everything but desktop Linux.
306 sources += rebase_path(
307 chrome_tests_gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources,
313 sources += rebase_path(
314 chrome_tests_gypi_values.chrome_interactive_ui_test_chromeos_sources,
317 sources += [ "../browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc" ]
319 # Use only the _chromeos version on ChromeOS.
320 "base/view_event_test_platform_part_ash.cc",
330 "//native_client/src/trusted/service_runtime/linux:munge_nacl_helper_bootstrap",
331 "//components/nacl:nacl_helper",
333 # '../components/nacl_nonsfi.gyp:nacl_helper_nonsfi', TODO(GYP)
337 if (is_chrome_branded) {
339 # These tests are failing on official cros bots. crbug.com/431450.
340 "../browser/ui/views/bookmarks/bookmark_bar_view_test.cc",
344 # ChromeOS doesn't use panels, everybody else does.
345 sources += rebase_path(
346 chrome_tests_gypi_values.chrome_interactive_ui_test_panels_sources,
350 # TODO(tapted): Include on mac when views panels are ported.
351 if (toolkit_views && !is_mac) {
352 sources += rebase_path(
353 chrome_tests_gypi_values.chrome_interactive_ui_test_panels_views_sources,
360 # Non-Linux platforms (Linux includes ChromeOS here).
361 sources += rebase_path(
362 chrome_tests_gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources,
368 sources += rebase_path(
369 chrome_tests_gypi_values.chrome_interactive_ui_test_win_sources,
372 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
374 "//chrome:chrome_version_resources",
375 "//third_party/isimpledom",
382 datadeps += [ "//chrome" ]
384 # TODO(mark): We really want this for all non-static library targets, but
385 # when we tried to pull it up to the common.gypi level, it broke other
386 # things like the ui and startup tests. *shrug*
387 ldflags += [ "-Wl,-ObjC" ]
390 if (cld_version == 0 || cld_version == 2) {
391 # Interactive tests should use whatever CLD2 data access mode that the
392 # application embedder is using.
393 deps += [ "//third_party/cld_2:cld2_platform_impl" ]
397 configs += [ "//build/config/linux:xtst" ]
398 datadeps += [ "//tools/xdisplaycheck" ]
401 if (enable_app_list) {
402 sources += rebase_path(
403 chrome_tests_gypi_values.chrome_interactive_ui_test_app_list_sources,
409 sources += rebase_path(
410 chrome_tests_gypi_values.chrome_interactive_ui_test_ash_sources,
413 deps += [ "//ash:test_support" ]
416 if (enable_notifications) {
417 sources += rebase_path(
418 chrome_tests_gypi_values.chrome_interactive_ui_test_notifications_sources,
422 # Non-ChromeOS notifications tests (ChromeOS does not use cross-platform
426 "../browser/notifications/notification_browsertest.cc",
427 "../browser/notifications/platform_notification_service_browsertest.cc",
433 # Android does not use the message center-based Notification system.
434 "../browser/notifications/message_center_notifications_browsertest.cc",
436 # TODO(peter): Enable the Notification browser tests.
437 "../browser/notifications/notification_browsertest.cc",
438 "../browser/notifications/platform_notification_service_browsertest.cc",
441 } # enable_notifications
443 if (use_aura || is_chromeos) {
445 [ "../../ui/views/corewm/desktop_capture_controller_unittest.cc" ]
449 source_set("sync_integration_test_support") {
451 sources = rebase_path(
452 chrome_tests_gypi_values.test_support_sync_integration_sources,
462 "//components/invalidation",
463 "//components/invalidation:test_support",
467 "//sync:test_support_sync_testserver",
468 "//sync:test_support_sync_fake_server",
469 "//ui/app_list:test_support",
474 "../browser/sync/test/integration/dictionary_helper.cc",
475 "../browser/sync/test/integration/dictionary_helper.h",
476 "../browser/sync/test/integration/dictionary_load_observer.cc",
477 "../browser/sync/test/integration/dictionary_load_observer.h",
480 if (!enable_app_list) {
482 "../browser/sync/test/integration/sync_app_list_helper.cc",
483 "../browser/sync/test/integration/sync_app_list_helper.h",
488 "../browser/sync/test/integration/wifi_credentials_helper.cc",
489 "../browser/sync/test/integration/wifi_credentials_helper.h",
494 # TODO(GYP) when v8's GN build supports "//v8:d8" then enable the code
495 # controlled by this flag (and the flg itself can be deleted).
496 has_d8_definition = false
498 if (has_d8_definition) {
499 template("js2webui") {
500 action_name = target_name + "_action"
501 source_set_name = target_name
503 action_foreach(action_name) {
505 visibility = [ ":$source_set_name" ]
506 script = "//tools/gypv8sh.py"
508 sources = invoker.sources
511 get_label_info("//v8:d8($host_toolchain)", "root_out_dir") + "/d8"
517 "//chrome/third_party/mock4js/mock4js.js",
518 "//chrome/test/data/webui/test_api.js",
519 "//chrome/test/base/js2gtest.js",
521 inputs = [ d8_path ] + input_js
524 "$target_gen_dir/{{source_name_part}}-gen.cc",
525 "$root_out_dir/test_data/chrome/{{source_root_relative_dir}}/{{source_file_part}}",
529 # Need "./" for script to find binary (cur dir is not on path).
530 "./" + rebase_path(d8_path, root_build_dir),
532 args += rebase_path(input_js, root_build_dir) + [ "webui" ]
533 if (v8_use_external_startup_data) {
534 args += [ "--external=y" ]
536 args += [ "--external=n" ]
540 "{{source_root_relative_dir}}/{{source_file_part}}",
542 args += rebase_path(outputs, root_build_dir)
545 "//v8:d8($host_toolchain)",
549 source_set(source_set_name) {
551 if (defined(invoker.visibility)) {
552 visibility = invoker.visibility
554 sources = get_target_outputs(":$action_name")
555 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
559 # The generator implicitly makes includes from these targets.
564 if (defined(invoker.deps)) {
570 js2webui("browser_tests_js_webui") {
571 sources = rebase_path(
572 chrome_tests_gypi_values.chrome_browser_tests_webui_js_sources,
575 if (is_chrome_branded) {
577 sources -= [ "data/webui/accessibility_audit_browsertest.js" ]
581 "data/webui/certificate_viewer_dialog_test.js",
582 "test/data/chromeos/oobe_webui_browsertest.js",
585 if (!enable_app_list) {
586 sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ]
588 if (!enable_supervised_users) {
590 [ "../browser/ui/webui/downloads_ui_supervised_browsertest.js" ]
598 test("browser_tests") {
600 "base/browser_tests_main.cc",
603 rebase_path(chrome_tests_gypi_values.chrome_browser_tests_sources,
606 sources += rebase_path(
607 chrome_tests_gypi_values.chrome_browser_extensions_test_support_sources,
612 ":sync_integration_test_support",
617 "//base/test:test_support",
618 "//chrome:browser_tests_pak",
619 "//chrome:packed_extra_resources",
620 "//chrome:packed_resources",
621 "//chrome:resources",
624 "//chrome/common/extensions/api",
626 "//components/autofill/content/browser:risk_proto",
627 "//components/autofill/content/browser:test_support",
628 "//components/captive_portal:test_support",
629 "//components/dom_distiller/content",
630 "//components/dom_distiller/core:test_support",
631 "//components/resources",
632 "//components/strings",
633 "//components/translate/core/common",
634 "//components/user_manager:test_support",
636 "//crypto:test_support",
637 "//device/bluetooth:mocks",
638 "//device/serial:test_support",
639 "//extensions/common/api",
640 "//google_apis:test_support",
642 "//media/base:test_support",
643 "//media/cast:test_support",
645 "//net:test_support",
649 "//sync:test_support_sync_api",
653 "//third_party/cacheinvalidation",
655 "//third_party/leveldatabase",
656 "//third_party/libaddressinput",
657 "//third_party/libjingle",
658 "//third_party/safe_browsing:test_support",
659 "//third_party/widevine/cdm:version_h",
660 "//ui/accessibility:test_support",
661 "//ui/compositor:test_support",
663 "//ui/web_dialogs:test_support",
666 if (has_d8_definition) {
667 deps += [ ":browser_tests_js_webui" ]
670 # Runtime dependencies
672 #"//ppapi:ppapi_tests", # TODO(GYP) this doesn't exist yet.
673 #'../remoting/remoting.gyp:remoting_browser_test_resources', TODO(GYP)
674 #'../remoting/remoting.gyp:remoting_webapp_unittest', TODO(GYP)
675 "//third_party/mesa:osmesa",
676 "//third_party/widevine/cdm:widevine_test_license_server",
679 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
681 # TODO(GYP) if (is_win) {
682 # ['incremental_chrome_dll==1', {
683 # 'UseLibraryDependencyInputs': "true",
686 if (cld_version == 0 || cld_version == 2) {
687 # Because the browser_tests use translate, they need CLD data.
688 deps += [ "//third_party/cld_2:cld2_platform_impl" ]
691 if (!enable_one_click_signin) {
692 sources -= [ "../browser/ui/sync/one_click_signin_bubble_links_delegate_browsertest.cc" ]
696 "../browser/extensions/extension_nacl_browsertest.cc",
697 "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc",
699 deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
701 if (enable_nacl_untrusted) {
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",
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")
717 # "test/data/nacl:shared_test_files", # TODO(GYP)
718 "//ppapi/native_client:nacl_irt(//native_client/build/toolchain/nacl:irt_x64)",
719 # "../ppapi/ppapi_nacl.gyp:ppapi_nacl_tests", # TODO(GYP)
720 # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_background_keepalive", # TODO(GYP)
721 # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_media_galleries", # TODO(GYP)
722 # "../ppapi/tests/extensions/extensions.gyp:ppapi_tests_extensions_packaged_app", # TODO(GYP)
723 # "../ppapi/ppapi_tests_mojo.gyp:ppapi_tests_mojo", # TODO(GYP)
726 sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ]
728 #'browser_chromeos', TODO(GYP)
729 #'../third_party/liblouis/liblouis_nacl.gyp:liblouis_test_data', TODO(GYP)
733 if (is_win || is_linux) {
734 sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ]
735 deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ]
738 # TODO(halyavin) NaCl on Windows can't open debug stub socket in
739 # browser process as needed by this test. See http://crbug.com/157312.
740 sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ]
742 #'chrome.gyp:chrome_nacl_win64', TODO(GYP)
747 "//native_client/src/trusted/service_runtime/linux:munge_nacl_helper_bootstrap",
748 "//components/nacl:nacl_helper",
750 # "//components/nacl_nonsfi.gyp:nacl_helper_nonsfi", # TODO(GYP)
754 if (debug_devtools) {
755 defines += [ "DEBUG_DEVTOOLS=1" ]
758 deps += [ "//ash:test_support" ]
760 if (use_aura || toolkit_views) {
761 deps += [ "//ui/events:test_support" ]
764 sources += rebase_path(
765 chrome_tests_gypi_values.chrome_browser_tests_views_sources,
768 deps += [ "//ui/views" ]
770 sources += rebase_path(
771 chrome_tests_gypi_values.chrome_browser_tests_views_non_mac_sources,
777 sources += rebase_path(
778 chrome_tests_gypi_values.chrome_browser_tests_chromeos_sources,
782 "../../apps/load_and_launch_browsertest.cc",
783 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
784 "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
786 # chromeos does not support profile list avatar menu
787 "../browser/profiles/profile_list_desktop_browsertest.cc",
788 "../browser/service_process/service_process_control_browsertest.cc",
790 # chromeos does not use cross-platform panels
791 "../browser/ui/panels/panel_extension_browsertest.cc",
793 # chromeos does not use the desktop user manager
794 "../browser/ui/webui/signin/user_manager_ui_browsertest.cc",
798 "//dbus:test_support",
800 #"//ui/login:resources", TODO(GYP)
804 "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
805 "../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc",
806 "../browser/extensions/api/terminal/terminal_private_apitest.cc",
807 "../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
808 "../browser/net/nss_context_chromeos_browsertest.cc",
809 "../browser/ui/ash/keyboard_controller_browsertest.cc",
810 "data/webui/certificate_viewer_ui_test-inl.h",
813 sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ]
816 if (enable_configuration_policy) {
817 sources += rebase_path(
818 chrome_tests_gypi_values.chrome_browser_tests_policy_sources,
822 if (enable_web_speech) {
823 sources += rebase_path(
824 chrome_tests_gypi_values.chrome_browser_tests_speech_sources,
828 if (safe_browsing_mode == 1) {
829 sources += rebase_path(
830 chrome_tests_gypi_values.chrome_browser_tests_full_safe_browsing_sources,
833 defines += [ "FULL_SAFE_BROWSING" ]
835 if (enable_captive_portal_detection) {
836 sources += [ "../browser/captive_portal/captive_portal_browsertest.cc" ]
838 if (!enable_webrtc) {
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",
848 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
850 "//chrome:chrome_version_resources",
856 "../app/chrome_command_ids.h",
857 "../app/chrome_dll_resource.h",
858 "../app/chrome_version.rc.version",
859 "../browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc",
862 if (!is_chromeos && use_aura) {
864 # On Windows and Linux, we currently don't support enough of the
865 # ash environment to run these unit tests.
867 # TODO: enable these on windows and linux.
868 "../browser/ui/ash/accelerator_commands_browsertest.cc",
869 "../browser/ui/ash/accelerator_controller_browsertest.cc",
870 "../browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc",
871 "../browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc",
872 "../browser/ui/ash/shelf_browsertest.cc",
873 "../browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc",
877 # TODO(mark): We really want this for all non-static library
878 # targets, but when we tried to pull it up to the common.gypi
879 # level, it broke other things like the ui and startup tests. *shrug*
880 ldflags = [ "-Wl,-ObjC" ]
882 # Other platforms only need
883 # chrome_resources.gyp:{packed_extra_resources,packed_resources},
884 # and can build this target standalone much faster.
886 #'app_mode_app_support', TODO(GYP)
888 #'../components/components.gyp:breakpad_stubs', TODO(GYP)
889 #'../third_party/ocmock/ocmock.gyp:ocmock', TODO(GYP)
892 "../browser/media_galleries/fileapi/iphoto_data_provider_browsertest.cc",
893 "../browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm",
894 "../browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc",
897 # TODO(groby): This test depends on hunspell and we cannot run it on
898 # Mac, which does not use hunspell by default.
899 "../browser/spellchecker/spellcheck_service_browsertest.cc",
901 # TODO(rouslan): This test depends on the custom dictionary UI,
902 # which is disabled on Mac.
903 # TODO(GYP): This should be added somewhere first ...
904 # "../browser/ui/webui/options/edit_dictionary_browsertest.js",
906 # TODO(rouslan): This test depends on hunspell and we cannot run it
907 # on Mac, which does use hunspell by default.
908 # TODO(GYP): This should be added somewhere first ...
909 # "../browser/ui/webui/options/language_options_dictionary_download_browsertest.js",
911 # ProcessSingletonMac doesn"t do anything.
912 "../browser/process_singleton_browsertest.cc",
914 # This test depends on GetCommandLineForRelaunch, which is not
916 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
918 # single-process mode hangs on Mac sometimes because of multiple UI
919 # message loops. See 306348
920 "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
921 "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
922 "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
925 if (is_mac || is_win) {
927 "../browser/extensions/api/networking_private/networking_private_apitest.cc",
928 "../browser/extensions/api/networking_private/networking_private_service_client_apitest.cc",
929 "../browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc",
930 "../browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc",
932 deps += [ "//components/wifi:test_support" ]
934 if (!is_posix || is_chromeos) {
935 sources -= [ "../common/time_format_browsertest.cc" ]
939 "../browser/policy/cloud/component_cloud_policy_browsertest.cc",
940 "../browser/prefs/pref_hash_browsertest.cc",
945 "../browser/extensions/api/networking_private/networking_private_apitest.cc",
946 "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
949 if (!is_android && !is_ios) {
951 [ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ]
952 deps += [ "//components/copresence" ]
954 if (!is_android && !is_ios && !is_linux) {
955 # NPAPI test plugin only works on some platforms.
957 #'../content/content_shell_and_tests.gyp:copy_npapi_test_plugin', TODO(GYP)
960 if (enable_app_list) {
961 sources += rebase_path(
962 chrome_tests_gypi_values.chrome_browser_tests_app_list_sources,
966 if (enable_supervised_users) {
967 sources += rebase_path(
968 chrome_tests_gypi_values.chrome_browser_tests_supervised_user_sources,
972 if (enable_pepper_cdms) {
973 # Runtime dependencies.
975 "//media/cdm/ppapi:clearkeycdmadapter",
976 "//third_party/widevine/cdm:adapter",
979 if (!enable_print_preview) {
981 "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc",
982 "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc",
983 "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc",
984 "../browser/printing/print_preview_dialog_controller_browsertest.cc",
985 "../browser/printing/print_preview_pdf_generated_browsertest.cc",
986 "../browser/service_process/service_process_control_browsertest.cc",
987 "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc",
988 "data/webui/print_preview.cc",
989 "data/webui/print_preview.h",
990 "data/webui/print_preview.js",
994 sources += [ "../browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc" ]
997 deps += [ "//build/config/linux:libbrlapi" ]
999 sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ]
1001 if (is_chrome_branded) {
1003 # These tests depend on single process mode, which is disabled in
1005 "../renderer/safe_browsing/phishing_classifier_browsertest.cc",
1006 "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc",
1007 "../renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc",
1010 if (!enable_autofill_dialog || is_android || is_ios) {
1011 deps -= [ "//third_party/libaddressinput" ]
1016 "../browser/chromeos/input_method/input_method_engine_browsertests.cc",
1017 "../browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc",
1020 if (enable_remoting) {
1021 sources += rebase_path(
1022 chrome_tests_gypi_values.chrome_browser_tests_remoting_sources,
1025 #deps += [ "//remoting:remoting_webapp" ] TODO(GYP)
1028 deps += [ "//tools/xdisplaycheck" ]
1032 test("sync_integration_tests") {
1034 rebase_path(chrome_tests_gypi_values.sync_integration_tests_sources,
1038 # TODO(phajdan.jr): Only temporary, to make transition easier.
1039 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1042 ":sync_integration_test_support",
1045 "//chrome:packed_extra_resources",
1046 "//chrome:packed_resources",
1047 "//chrome:resources",
1050 "//chrome/renderer",
1051 "//crypto:platform",
1055 "//third_party/icu",
1056 "//third_party/leveldatabase",
1057 "//third_party/npapi",
1058 "//third_party/WebKit/public:blink",
1061 if (cld_version == 0 || cld_version == 2) {
1062 # Language detection is irrelevant to sync, so it can depend on any
1063 # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1064 deps += [ "//third_party/cld_2:cld2_dynamic" ]
1067 # Dictionary sync is disabled on Mac.
1069 "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc",
1070 "../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
1071 "../browser/sync/test/integration/two_client_dictionary_sync_test.cc",
1074 # The sync_integration_tests do not run on mac without this flag.
1075 # Search for comments about "xcode_settings" elsewhere in this file.
1076 ldflags = [ "-Wl,-ObjC" ]
1079 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
1081 "//chrome:chrome_version_resources",
1082 "//third_party/wtl",
1086 sources -= [ "../app/chrome_version.rc.version" ]
1090 "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc",
1091 "../browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc",
1095 if (toolkit_views) {
1096 deps += [ "//ui/views" ]
1098 if (enable_basic_printing || enable_print_preview) {
1099 deps += [ "//printing" ]
1101 if (!enable_app_list) {
1103 "../browser/sync/test/integration/single_client_app_list_sync_test.cc",
1104 "../browser/sync/test/integration/two_client_app_list_sync_test.cc",
1107 if (!enable_supervised_users) {
1108 sources -= [ "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc" ]
1112 test("sync_performance_tests") {
1114 rebase_path(chrome_tests_gypi_values.sync_performance_tests_sources,
1118 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
1121 ":sync_integration_test_support",
1123 "//crypto:platform",
1129 if (cld_version == 0 || cld_version == 2) {
1130 # Language detection is irrelevant to sync, so it can depend on any
1131 # implementation for CLD2. Dynamic is smaller, so go with dynamic.
1132 deps += [ "//third_party/cld_2:cld2_dynamic" ]
1136 # Dictionary sync is disabled on Mac.
1137 sources -= [ "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc" ]
1139 # The sync_performance_tests do not run on mac without this flag.
1140 # Search for comments about "xcode_settings" elsewhere in this file.
1141 ldflags = [ "-Wl,-ObjC" ]
1144 sources += [ "$root_gen_dir/chrome/other_version.rc" ]
1146 "//chrome:chrome_version_resources",
1147 "//third_party/wtl",
1151 sources -= [ "../app/chrome_version.rc.version" ]
1154 if (toolkit_views) {
1155 deps += [ "//ui/views" ]
1159 # Executable to measure time to load libraries.
1160 test("load_library_perf_tests") {
1162 "../browser/load_library_perf_test.cc",
1166 "//base/test:test_support_perf",
1169 "//third_party/widevine/cdm:version_h",
1172 if (enable_pepper_cdms) {
1174 "//media/cdm/ppapi:clearkeycdmadapter",
1175 "//third_party/widevine/cdm:adapter",
1180 unit_gypi_values = exec_script("//build/gypi_to_gn.py",
1181 [ rebase_path("../chrome_tests_unit.gypi") ],
1183 [ "../chrome_tests_unit.gypi" ])
1185 test("unit_tests") {
1187 rebase_path(unit_gypi_values.chrome_unit_tests_sources, ".", "//chrome")
1192 # NOTE: New depndencies should generally be added in the OS!="ios"
1193 # dependencies block below, rather than here.
1194 # Unit tests should only depend on:
1195 # 1) everything that the chrome binaries depend on:
1196 "//chrome:browser_dependencies",
1197 "//chrome:child_dependencies",
1199 # 2) test-specific support libraries:
1200 ":test_support_unit",
1201 "//base/test:test_support",
1202 "//chrome/test:test_support",
1203 "//components/resources",
1204 "//components/content_settings/core/test:test_support",
1205 "//content/test:test_support",
1206 "//content/public/app:both",
1207 "//crypto:platform",
1208 "//crypto:test_support",
1210 "//net:test_support",
1211 "//sync:test_support_sync_api",
1212 "//sync:test_support_sync_core",
1213 "//sync:test_support_sync_internal_api",
1217 # 3) anything tests directly depend on
1219 "//chrome:resources",
1221 "//courgette:courgette_lib",
1224 "//third_party/cacheinvalidation",
1225 "//third_party/icu",
1226 "//third_party/libxml",
1227 "//ui/base:test_support",
1228 "//ui/gfx:test_support",
1233 # TODO(GYP) Windows stuff
1234 # ['incremental_chrome_dll==1', {
1235 # 'UseLibraryDependencyInputs': "true",
1239 "//components/audio_modem:audio_modem_test_support",
1240 "//components/autofill/content/browser:test_support",
1241 "//components/metrics/proto",
1242 "//components/data_reduction_proxy/core/browser:test_support",
1243 "//components/webdata_services:test_support",
1244 "//components/strings",
1245 "//device/bluetooth:mocks",
1246 "//content/app/resources",
1247 "//gpu:test_support",
1248 "//media:test_support",
1250 #'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared', TODO(GYP)
1251 "//third_party/leveldatabase",
1252 "//third_party/libaddressinput",
1253 "//third_party/libjingle",
1254 "//third_party/libphonenumber",
1255 "//tools/json_schema_compiler/test",
1262 deps -= [ "//third_party/libaddressinput" ]
1264 # Some android targets still depend on --gc-sections to link.
1265 # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
1266 ldflags = [ "-Wl,--gc-sections" ]
1267 deps += [ "//testing/android:native_test_native_code" ]
1270 rebase_path(unit_gypi_values.chrome_unit_tests_non_android_sources,
1275 if (is_ios || is_chromeos) {
1277 [ "../browser/metrics/signin_status_metrics_provider_unittest.cc" ]
1279 if (enable_background) {
1281 rebase_path(unit_gypi_values.chrome_unit_tests_background_sources,
1285 if (enable_spellcheck) {
1287 rebase_path(unit_gypi_values.chrome_unit_tests_spellchecker_sources,
1290 if (is_mac && !is_ios) {
1291 deps += [ "//third_party/hunspell" ]
1295 if (enable_one_click_signin) {
1296 sources += rebase_path(
1297 unit_gypi_values.chrome_unit_tests_one_click_signin_sources,
1302 "../browser/ui/sync/one_click_signin_helper_unittest.cc",
1303 "../browser/ui/sync/one_click_signin_sync_starter_unittest.cc",
1306 if (!toolkit_views) {
1307 sources -= [ "../browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc" ]
1311 if (enable_extensions) {
1313 rebase_path(unit_gypi_values.chrome_unit_tests_extensions_sources,
1317 "//chrome/common/extensions/api",
1318 "//extensions:extensions_resources",
1319 "//extensions/strings",
1321 if (enable_configuration_policy) {
1322 sources += rebase_path(
1323 unit_gypi_values.chrome_unit_tests_extensions_policy_sources,
1328 sources += rebase_path(
1329 unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources,
1334 if (toolkit_views) {
1336 "//components/web_modal:test_support",
1338 "//ui/views:test_support",
1341 # TODO(tapted): Enable toolkit-views unit_tests on Mac when their
1342 # respective implementations are linked in. http://crbug.com/412234.
1343 sources += rebase_path(unit_gypi_values.chrome_unit_tests_views_sources,
1349 sources += rebase_path(unit_gypi_values.chrome_unit_tests_ash_sources,
1353 "//ash:test_support",
1358 # We eventually want to compile both in Win Aura builds, see
1359 # http://crbug.com/155545.
1361 sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ]
1365 sources += [ "//ui/views/controls/webview/webview_unittest.cc" ]
1368 "//ui/aura:test_support",
1369 "//ui/views:test_support",
1372 if (!is_chromeos && is_linux) {
1374 rebase_path(unit_gypi_values.chrome_unit_tests_desktop_linux_sources,
1378 if (!is_chromeos && !use_ozone && is_linux) {
1380 "//chrome/browser/ui/libgtk2ui",
1381 "//build/config/linux:gio",
1383 if (!is_component_build) {
1384 # TODO(erg): This file does not compile in shared library mode because
1385 # it is reaching into the internals of libgtk2ui, which shouldn't be
1386 # linked with the rest of chrome. This should either be fixed by
1387 # creating a separate unit test target, or by deleting the test.
1388 sources += [ "../browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2_unittest.cc" ]
1392 if (enable_task_manager) {
1394 rebase_path(unit_gypi_values.chrome_unit_tests_task_manager_sources,
1399 sources += rebase_path(unit_gypi_values.chrome_unit_tests_mdns_sources,
1403 if (enable_service_discovery) {
1404 sources += rebase_path(
1405 unit_gypi_values.chrome_unit_tests_service_discovery_sources,
1409 if (enable_configuration_policy) {
1410 sources += rebase_path(
1411 unit_gypi_values.chrome_unit_tests_configuration_policy_sources,
1416 [ "../browser/policy/cloud/user_policy_signin_service_unittest.cc" ]
1417 } else if (is_android) {
1418 sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ]
1420 if (!is_android && !is_ios && !is_chromeos) {
1422 [ "../browser/net/disk_cache_dir_policy_handler_unittest.cc" ]
1424 if (!is_android && !is_ios) {
1426 [ "../browser/download/download_dir_policy_handler_unittest.cc" ]
1429 if (enable_web_speech) {
1430 sources += rebase_path(unit_gypi_values.chrome_unit_tests_speech_sources,
1434 if (enable_notifications) {
1436 rebase_path(unit_gypi_values.chrome_unit_tests_notifications_sources,
1441 # Android does not use the Message Center notification system.
1442 "../browser/notifications/message_center_notifications_unittest.cc",
1443 "../browser/notifications/message_center_settings_controller_unittest.cc",
1447 if (safe_browsing_mode == 1) {
1448 # TODO(sgurun): enable tests for safe_browsing==2.
1449 sources += rebase_path(
1450 unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources,
1453 defines += [ "FULL_SAFE_BROWSING" ]
1455 sources -= [ "../browser/safe_browsing/download_protection_service_unittest.cc" ]
1456 } else if (is_android) {
1458 # Android doesn't support download feedbacks.
1459 "../browser/safe_browsing/download_feedback_service_unittest.cc",
1460 "../browser/safe_browsing/download_feedback_unittest.cc",
1461 "../browser/safe_browsing/download_protection_service_unittest.cc",
1462 "../browser/safe_browsing/two_phase_uploader_unittest.cc",
1466 if (enable_autofill_dialog && !is_android) {
1467 sources += rebase_path(
1468 unit_gypi_values.chrome_unit_tests_autofill_dialog_sources,
1472 if (enable_plugins) {
1473 sources += rebase_path(unit_gypi_values.chrome_unit_tests_plugins_sources,
1477 if (enable_print_preview) {
1479 rebase_path(unit_gypi_values.chrome_unit_tests_print_preview_sources,
1483 if (enable_captive_portal_detection) {
1485 rebase_path(unit_gypi_values.chrome_unit_tests_captive_portal_sources,
1489 if (enable_session_service) {
1490 sources += rebase_path(
1491 unit_gypi_values.chrome_unit_tests_session_service_sources,
1495 if (enable_webrtc) {
1496 sources += rebase_path(unit_gypi_values.chrome_unit_tests_webrtc_sources,
1502 rebase_path(unit_gypi_values.chrome_unit_tests_chromeos_sources,
1507 "//ui/chromeos/resources",
1510 "../browser/signin/signin_global_error_unittest.cc",
1511 "../browser/signin/signin_manager_unittest.cc",
1512 "../browser/signin/signin_names_io_thread_unittest.cc",
1513 "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc",
1514 "../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
1518 deps += [ "//ui/events/devices" ]
1519 data_deps += [ "//tools/xdisplaycheck" ]
1521 sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ]
1523 if (cld_version == 0 || cld_version == 2) {
1524 # Unit tests should be independent of the CLD2 access mechanism, just use
1525 # static for simplicity.
1526 deps += [ "//third_party/cld_2:cld2_static" ]
1528 if (is_desktop_linux && current_cpu == "x64") {
1529 # Only add this test for 64 bit builds because otherwise we need the 32
1530 # bit library on 64 bit systems when running this test.
1532 [ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ]
1534 "//chrome/browser:gnome_keyring",
1535 "//chrome/browser:gnome_keyring_direct",
1538 if (is_linux && !is_chromeos) {
1540 [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ]
1542 if (is_linux && use_aura) {
1545 "//dbus:test_support",
1546 "//ui/aura:test_support",
1549 if (is_linux && is_chrome_branded && current_cpu == "x86") {
1550 ldflags = [ "-Wl,--strip-debug" ]
1553 sources += rebase_path(unit_gypi_values.chrome_unit_tests_mac_sources,
1557 "../browser/ui/tests/ui_gfx_image_unittest.cc",
1558 "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
1559 "../tools/convert_dict/convert_dict_unittest.cc",
1562 # The test fetches resources which means Mac need the app bundle to exist
1563 # on disk so it can pull from it.
1565 "//third_party/google_toolbox_for_mac",
1566 # "//third_party/ocmock", # TODO(GYP)
1569 # TODO(mark): We really want this for all non-static library targets,
1570 # but when we tried to pull it up to the common.gypi level, it broke
1571 # other things like the ui and startup tests. *shrug*
1572 ldflags = [ "-Wl,-ObjC" ]
1574 if (!is_mac && !is_ios) {
1576 "//third_party/hunspell",
1577 "//chrome:packed_extra_resources",
1578 "//chrome:packed_resources",
1579 "//chrome/tools/convert_dict:lib",
1582 if (is_win || is_mac) {
1583 sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_mac_sources,
1587 if (is_win || is_mac || is_chromeos) {
1588 sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ]
1591 deps += [ "//rlz:test_support" ]
1593 sources -= [ "../browser/rlz/rlz_unittest.cc" ]
1596 if (!is_component_build) {
1597 # Unit_tests pdb files can get too big when incremental linking is
1598 # on, disabling for this target.
1599 #'LinkIncremental': '<(msvs_debug_link_nonincremental)', TODO(GYP)
1602 sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_sources,
1606 # TODO: It would be nice to have these pulled in
1607 # automatically from direct_dependent_settings in
1608 # their various targets (net.gyp:net_resources, etc.),
1609 # but that causes errors in other targets when
1610 # resulting .res files get referenced multiple times.
1611 #'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
1612 #'<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc', TODO(GYP)
1613 #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc', TODO(GYP)
1617 #'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_1', TODO(GYP)
1618 #'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_2', TODO(GYP)
1619 #'chrome_version_resources', TODO(GYP)
1620 "//chrome_elf:blacklist_test_dll_1",
1621 "//third_party/iaccessible2",
1622 "//third_party/isimpledom",
1623 "//third_party/wtl",
1634 if (is_android || is_ios) {
1636 "../browser/devtools/device/webrtc/devtools_bridge_instances_request_unittest.cc",
1637 "../browser/ui/sync/sync_promo_ui_unittest.cc",
1641 "../browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc",
1642 "../browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc",
1644 deps += [ "//chrome/tools/profile_reset:jtl_compiler_lib" ]
1646 if (!is_android && !is_chromeos) {
1647 sources += rebase_path(
1648 unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources,
1652 if (enable_themes) {
1653 sources += rebase_path(unit_gypi_values.chrome_unit_tests_themes_sources,
1657 if (!is_android && (use_nss_certs || use_openssl_certs)) {
1658 sources += [ "../common/net/x509_certificate_model_unittest.cc" ]
1660 if (enable_supervised_users) {
1661 sources += rebase_path(
1662 unit_gypi_values.chrome_unit_tests_supervised_user_sources,
1666 if (safe_browsing_mode == 1 && enable_extensions) {
1667 sources += [ "../browser/extensions/blacklist_unittest.cc" ]
1669 if (cld_version == 1) {
1670 sources += [ "//third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc" ]
1671 defines += [ "CLD_WINDOWS" ]
1672 deps += [ "//third_party/cld" ]
1674 if (enable_app_list) {
1676 rebase_path(unit_gypi_values.chrome_unit_tests_app_list_sources,
1679 deps += [ "//ui/app_list:test_support" ]
1683 sources -= [ "../browser/chromeos/events/event_rewriter_unittest.cc" ]
1685 if (!enable_plugin_installation) {
1686 sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]