# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/features.gni") import("//build/config/ui.gni") import("//testing/test.gni") import("//tools/grit/repack.gni") # Collection of all components. You wouldn't link to this, but this is rather # to reference the files so they can be compiled by the build system. group("all_components") { testonly = true # You shouldn't actually link to this. visibility = [ "//:*" ] # Only for the root targets to bring in. deps = [ "//components/auto_login_parser", "//components/autofill/content/browser", "//components/autofill/content/common", "//components/autofill/content/renderer", "//components/bookmarks/browser", "//components/bookmarks/common", "//components/bookmarks/managed", "//components/bookmarks/test", "//components/captive_portal", "//components/cdm/browser", "//components/cdm/common", "//components/cdm/renderer", "//components/cloud_devices/common", "//components/component_updater", "//components/content_settings/core/browser", "//components/content_settings/core/common", "//components/crash/app", "//components/crash/browser", "//components/crx_file", "//components/data_reduction_proxy/core/browser", "//components/data_reduction_proxy/core/common", "//components/device_event_log", "//components/devtools_discovery", "//components/devtools_http_handler", "//components/dom_distiller/core", "//components/domain_reliability", "//components/enhanced_bookmarks", "//components/favicon/core", "//components/favicon_base", "//components/feedback", "//components/gcm_driver", "//components/google/core/browser", "//components/history/content/browser", "//components/history/core/browser", "//components/history/core/common", "//components/history/core/test", "//components/infobars/core", "//components/invalidation", "//components/json_schema", "//components/keyed_service/content", "//components/language_usage_metrics", "//components/leveldb_proto", "//components/login", "//components/metrics", "//components/navigation_interception", "//components/navigation_metrics", "//components/network_time", "//components/omnibox", "//components/onc", "//components/os_crypt", "//components/packed_ct_ev_whitelist", "//components/pairing", "//components/password_manager/content/browser", "//components/password_manager/core/browser", "//components/password_manager/core/common", "//components/pdf/browser", "//components/pdf/common", "//components/pdf/renderer", "//components/plugins/common", "//components/plugins/renderer", "//components/policy", "//components/power", "//components/precache/core", "//components/precache/content", "//components/pref_registry", "//components/query_parser", "//components/rappor", "//components/renderer_context_menu", "//components/resources:components_resources", "//components/search", "//components/search_engines", "//components/search_provider_logos", "//components/sessions:sessions_content", "//components/signin/core/browser", "//components/startup_metric_utils", "//components/strings", "//components/sync_driver", "//components/tracing", "//components/translate/content/browser", "//components/translate/content/common", "//components/translate/content/renderer", "//components/translate/core/browser", "//components/translate/core/common", "//components/ui/zoom:ui_zoom", "//components/undo", "//components/update_client", "//components/url_fixer", "//components/url_matcher", "//components/user_manager", "//components/user_prefs", "//components/variations", "//components/visitedlink/browser", "//components/visitedlink/common", "//components/visitedlink/renderer", "//components/wallpaper", "//components/web_cache/browser", "//components/web_cache/common", "//components/web_cache/renderer", "//components/web_modal", "//components/web_resource", "//components/webcrypto", "//components/webdata/common", "//components/webui_generator", "//components/wifi", "//components/wifi_sync", ] if (!is_android && !is_ios) { deps += [ "//components/proximity_auth", "//components/proximity_auth/cryptauth", ] } if (!enable_configuration_policy) { deps -= [ "//components/policy" ] } if (!is_win && !is_mac) { deps -= [ "//components/wifi" ] } if (!is_chromeos) { deps -= [ "//components/pairing", "//components/wifi_sync", ] } if (is_ios) { deps -= [ "//components/history/content/browser", "//components/keyed_service/content", "//components/webui_generator", ] } if (!enable_plugins) { deps -= [ "//components/pdf/browser", "//components/pdf/common", "//components/pdf/renderer", ] } if (is_android) { deps -= [ "//components/autofill/content/browser", # Blocked on content/blink. "//components/autofill/content/common", # Blocked on content. "//components/autofill/content/renderer", # Blocked on content/blink. "//components/crash/app", # Should work, needs checking. "//components/crash/browser", # Should work, needs checking. "//components/captive_portal", # Should work, needs checking. "//components/cloud_devices/common", # Should work, needs checking. "//components/cdm/browser", # Blocked on content. "//components/cdm/common", # Blocked on content. "//components/cdm/renderer", # Blocked on content. "//components/data_reduction_proxy/core/browser", # Should work, needs checking. "//components/data_reduction_proxy/core/common", # Should work, needs checking. "//components/dom_distiller/core", # Blocked on content. "//components/domain_reliability", # Blocked on content. "//components/favicon/core", # Blocked on keyed service. "//components/favicon_base", # Should work, needs checking. "//components/feedback", # Blocked on content. "//components/gcm_driver", # Should work, needs checking. "//components/google/core/browser", # Should work, needs checking. "//components/history/core/browser", # Should work, needs checking. "//components/history/core/common", # Should work, needs checking. "//components/history/core/test", # Should work, needs checking. "//components/infobars/core", # Should work, needs checking. "//components/invalidation", # Should work, needs checking. "//components/json_schema", # Should work, needs checking. "//components/keyed_service/content", # Blocked on content. "//components/navigation_interception", # Blocked on content. "//components/omnibox", # Should work, needs checking. "//components/password_manager/content/browser", # Blocked on content. "//components/password_manager/core/browser", # Should work, needs checking. "//components/password_manager/core/common", # Should work, needs checking. "//components/plugins/renderer", # Blocked on blink. "//components/power", # Blocked on content. "//components/policy", # Blocked on content (indirectly via autofill). "//components/precache/content", # Blocked on content. "//components/precache/core", # Should work, needs checking. "//components/rappor", # Should work, needs checking. "//components/renderer_context_menu", # Blocked on content. "//components/search_engines", # Should work, needs checking. "//components/search_provider_logos", # Should work, needs checking. "//components/sessions:sessions_content", # Blocked on content. "//components/signin/core/browser", # Should work, needs checking. "//components/translate/content/browser", # Blocked on content. "//components/translate/content/common", # Blocked on content. "//components/translate/content/renderer", # Blocked on content. "//components/user_prefs", # Blocked on content. "//components/visitedlink/browser", # Blocked on content. "//components/visitedlink/common", # Blocked on content. "//components/visitedlink/renderer", # Blocked on blink "//components/web_cache/browser", # Blocked on content and blink. "//components/web_cache/renderer", # Blocked on content and blink. "//components/web_modal", # Blocked on content. ] } if (!is_ios && !is_android) { deps += [ "//components/copresence", "//components/storage_monitor", ] } if (!is_ios) { deps += [ "//components/app_modal", "//components/browsing_data", "//components/scheduler", ] } if (toolkit_views) { deps += [ "//components/constrained_window" ] } } # To add a unit test to this target, make a "unit_test" source_set in your # component (it's important to use a source_set instead of a static library or # no tests will run) and add a reference here. You can add more than one unit # test target if convenient. test("components_unittests") { sources = [ "test/run_all_unittests.cc", ] # Add only ":unit_tests" dependencies here. If your tests have dependencies # (this would at least include the component itself), they should be on the # test source set and not here. deps = [ "//components/auto_login_parser:unit_tests", "//components/autofill/content/browser:unit_tests", "//components/autofill/core/browser:unit_tests", "//components/autofill/core/common:unit_tests", "//components/bookmarks/browser:unit_tests", "//components/bookmarks/managed:unit_tests", "//components/captive_portal:unit_tests", "//components/cloud_devices/common:unit_tests", "//components/content_settings/core/browser:unit_tests", "//components/content_settings/core/common:unit_tests", "//components/crx_file:unit_tests", "//components/data_reduction_proxy/content/browser:unit_tests", "//components/data_reduction_proxy/core/browser:unit_tests", "//components/data_reduction_proxy/core/common:unit_tests", "//components/device_event_log:unit_tests", "//components/devtools_http_handler:unit_tests", "//components/dom_distiller/core:unit_tests", "//components/domain_reliability:unit_tests", "//components/favicon_base:unit_tests", "//components/google/core/browser:unit_tests", "//components/invalidation:unittests", "//components/login:unit_tests", "//components/metrics:unit_tests", "//components/omnibox:unit_tests", "//components/ownership:unit_tests", "//components/packed_ct_ev_whitelist:unit_tests", "//components/undo:unit_tests", "//components/update_client:unit_tests", "//components/variations:unit_tests", "//components/web_resource:unit_tests", "//components/webcrypto:unit_tests", "//components/webdata/common:unit_tests", # These are the deps required by the code in this target. "//base", "//base/test:test_support", "//content/test:test_support", "//ui/base", ] data_deps = [ ":components_tests_pak" ] if (!is_android && !is_ios) { deps += [ "//components/proximity_auth:unit_tests" ] } # TODO(GYP) need this target. #'breakpad/app/crash_keys_win_unittest.cc', # Precache tests need these defines. #configs += [ "//components/precache/core:precache_config" ] if (toolkit_views) { # TODO(GYP) enable this as above. #deps += [ "//components/constrained_window:unit_tests" ] } if (is_win) { deps += [ "//components/browser_watcher:unit_tests" ] } if (is_ios) { deps -= [ "//components/devtools_http_handler:unit_tests" ] } if (!is_ios) { deps += [ "//components/scheduler:unit_tests" ] } } repack("components_tests_pak") { sources = [ "$root_gen_dir/components/components_resources.pak", "$root_gen_dir/components/strings/components_strings_en-US.pak", "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", "$root_gen_dir/ui/resources/webui_resources.pak", "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", "$root_gen_dir/ui/strings/ui_strings_en-US.pak", ] output = "$root_out_dir/components_tests_resources.pak" deps = [ "//components/resources", "//components/strings", "//ui/resources", "//ui/strings", ] } if (is_android) { import("//build/config/android/rules.gni") generate_jni("components_browsertests_jni_headers") { jni_package = "components_browsertests/shell" sources = [ "test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java", ] } } test("components_browsertests") { sources = [ "autofill/content/browser/risk/fingerprint_browsertest.cc", "autofill/content/renderer/password_form_conversion_utils_browsertest.cc", "dom_distiller/content/distillable_page_utils_browsertest.cc", "dom_distiller/content/distiller_page_web_contents_browsertest.cc", "password_manager/content/renderer/credential_manager_client_browsertest.cc", ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] deps = [ "autofill/content/browser", "autofill/content/renderer", "content_settings/core/common", "dom_distiller/content", "dom_distiller/core", "dom_distiller/core:test_support", "password_manager/content/browser", "password_manager/content/common", "password_manager/content/renderer", "strings", "//base", "//base/test:test_support", "//content/test:browsertest_support", "//content/test:test_support", "//testing/gmock", "//testing/gtest", "//ui/base", ] data_deps = [ ":components_tests_pak" ] if (is_android) { sources += [ "test/android/browsertests_apk/components_browser_tests_android.cc", "test/android/browsertests_apk/components_browser_tests_android.h", "test/android/browsertests_apk/components_browser_tests_jni_onload.cc", ] sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ] deps += [ ":components_browsertests_jni_headers", "//testing/android/native_test:native_test_util", ] use_launcher = false } if (is_linux) { # content_extractor_browsertest is a standalone content extraction tool built as # a MANUAL component_browsertest. sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ] deps += [ "pref_registry:test_support", "//base:prefs_test_support", ] } } test("components_perftests") { sources = [ "scheduler/child/task_queue_manager_perftest.cc", "visitedlink/test/visitedlink_perftest.cc", ] # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ "//base", "//base/test:test_support_perf", "//testing/gtest", "//testing/perf", "//content/test:test_support", "//components/visitedlink/browser", ] }