Commit a68ea2b7 authored by brettw's avatar brettw Committed by Commit bot

Add unit tests target to GN build.

Minor related GYP cleanup and added some missing dependencies and related targets to the GN build.

Support for compiling unit_tests with no ENABLE_WEBRTC.

Remove browser_action_drag_data_unittest.cc which is not compiled on any currently supported platform.

BUG=

Review URL: https://codereview.chromium.org/880873003

Cr-Commit-Position: refs/heads/master@{#314078}
parent 0d141491
......@@ -113,10 +113,7 @@ template("json_schema_api") {
if (defined(invoker.visibility)) {
# If visibility is restricted, add our own target to it.
visibility = [
invoker.visibility,
target_visibility,
]
visibility = invoker.visibility + target_visibility
}
}
}
......
......@@ -28,8 +28,24 @@ gypi_values = exec_script("//build/gypi_to_gn.py",
[ "../chrome_browser.gypi" ])
if (is_desktop_linux) {
# Gnome-keyring is normally dynamically loaded. The gnome_keyring config
# will set this up.
pkg_config("gnome_keyring") {
packages = [ "gnome-keyring-1" ]
defines = [
"USE_GNOME_KEYRING",
"DLOPEN_GNOME_KEYRING",
]
ignore_libs = true
}
# If you want to link gnome-keyring directly (use only for unit tests)
# ADDITIONALLY add this config on top of ":gnome_keyring". pkg-config is a
# bit slow, so prefer not to run it again. In practice, gnome-keyring's libs
# are just itself and common gnome ones we link already, so we can get away
# with additionally just coding the library name here.
config("gnome_keyring_direct") {
libs = [ "gnome-keyring" ]
}
}
......@@ -1012,8 +1028,12 @@ source_set("test_support") {
"chromeos/policy/cloud_external_data_manager_base_test_util.h",
"chromeos/policy/device_policy_builder.cc",
"chromeos/policy/device_policy_builder.h",
"chromeos/policy/fake_consumer_management_service.cc",
"chromeos/policy/fake_consumer_management_service.h",
"chromeos/policy/fake_device_cloud_policy_initializer.cc",
"chromeos/policy/fake_device_cloud_policy_initializer.h",
"chromeos/policy/fake_device_cloud_policy_manager.cc",
"chromeos/policy/fake_device_cloud_policy_manager.h",
"chromeos/policy/stub_enterprise_install_attributes.cc",
"chromeos/policy/stub_enterprise_install_attributes.h",
"chromeos/settings/device_settings_test_helper.cc",
......
......@@ -32,6 +32,8 @@ TEST_F(ChromeContentBrowserClientTest, ShouldAssignSiteForURL) {
EXPECT_TRUE(client.ShouldAssignSiteForURL(GURL("https://www.google.com")));
}
#if defined(ENABLE_WEBRTC)
// NOTE: Any updates to the expectations in these tests should also be done in
// the browser test WebRtcDisableEncryptionFlagBrowserTest.
class DisableWebRtcEncryptionFlagTest : public testing::Test {
......@@ -87,6 +89,8 @@ TEST_F(DisableWebRtcEncryptionFlagTest, StableChannel) {
EXPECT_FALSE(to_command_line_.HasSwitch(switches::kDisableWebRtcEncryption));
}
#endif // ENABLE_WEBRTC
} // namespace chrome
#if !defined(OS_IOS) && !defined(OS_ANDROID)
......
// Copyright (c) 2012 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.
#include "base/pickle.h"
#include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
#include "chrome/test/base/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_win.h"
#include "url/gurl.h"
namespace {
ui::OSExchangeData::Provider* CloneProvider(const ui::OSExchangeData& data) {
return new ui::OSExchangeDataProviderWin(
ui::OSExchangeDataProviderWin::GetIDataObject(data));
}
} // namespace
typedef testing::Test BrowserActionDragDataTest;
TEST_F(BrowserActionDragDataTest, ArbitraryFormat) {
TestingProfile profile;
profile.SetID(L"id");
ui::OSExchangeData data;
data.SetURL(GURL("http://www.google.com"), L"Title");
// We only support our format, so this should not succeed.
BrowserActionDragData drag_data;
EXPECT_FALSE(drag_data.Read(ui::OSExchangeData(CloneProvider(data))));
}
TEST_F(BrowserActionDragDataTest, BrowserActionDragDataFormat) {
TestingProfile profile;
Profile* profile_ptr = &profile;
profile.SetID(L"id");
const std::string extension_id = "42";
Pickle pickle;
pickle.WriteBytes(&profile_ptr, sizeof(&profile));
pickle.WriteString(extension_id);
pickle.WriteUInt64(42);
ui::OSExchangeData data;
data.SetPickledData(BrowserActionDragData::GetBrowserActionCustomFormat(),
pickle);
BrowserActionDragData drag_data;
EXPECT_TRUE(drag_data.Read(ui::OSExchangeData(CloneProvider(data))));
ASSERT_TRUE(drag_data.IsFromProfile(profile.GetOriginalProfile()));
ASSERT_STREQ(extension_id.c_str(), drag_data.id().c_str());
ASSERT_EQ(42, drag_data.index());
}
......@@ -12,7 +12,6 @@
# dependency is needed to make commit bots run unit_tests on
# histograms.xml changes.
'../tools/metrics/histograms/histograms.xml',
'app/chrome_dll.rc',
# All unittests in browser, common, renderer and service.
'browser/about_flags_unittest.cc',
'browser/android/bookmarks/partner_bookmarks_shim_unittest.cc',
......@@ -157,7 +156,6 @@
'browser/net/predictor_unittest.cc',
'browser/net/pref_proxy_config_tracker_impl_unittest.cc',
'browser/net/probe_message_unittest.cc',
'browser/net/proxy_policy_handler_unittest.cc',
'browser/net/quota_policy_channel_id_store_unittest.cc',
'browser/net/safe_search_util_unittest.cc',
'browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc',
......@@ -183,7 +181,6 @@
'browser/prefs/prefs_syncable_service_unittest.cc',
'browser/prefs/profile_pref_store_manager_unittest.cc',
'browser/prefs/proxy_config_dictionary_unittest.cc',
'browser/prefs/proxy_policy_unittest.cc',
'browser/prefs/proxy_prefs_unittest.cc',
'browser/prefs/session_startup_pref_unittest.cc',
'browser/prefs/tracked/device_id_unittest.cc',
......@@ -202,7 +199,6 @@
'browser/process_info_snapshot_mac_unittest.cc',
'browser/profiles/file_path_verifier_win_unittest.cc',
'browser/profiles/gaia_info_update_service_unittest.cc',
'browser/profiles/incognito_mode_policy_handler_unittest.cc',
'browser/profiles/profile_downloader_unittest.cc',
'browser/profiles/profile_info_cache_unittest.cc',
'browser/profiles/profile_info_cache_unittest.h',
......@@ -235,7 +231,6 @@
'browser/search/search_android_unittest.cc',
'browser/search_engines/default_search_pref_migration_unittest.cc',
'browser/search_engines/search_provider_install_data_unittest.cc',
'browser/search_engines/template_url_scraper_unittest.cc',
'browser/service_process/service_process_control_mac_unittest.mm',
'browser/services/gcm/fake_gcm_profile_service.cc',
'browser/services/gcm/fake_gcm_profile_service.h',
......@@ -244,7 +239,6 @@
'browser/services/gcm/gcm_account_tracker_unittest.cc',
'browser/services/gcm/push_messaging_application_id_unittest.cc',
'browser/services/gcm/push_messaging_permission_context_unittest.cc',
'browser/sessions/restore_on_startup_policy_handler_unittest.cc',
'browser/shell_integration_win_unittest.cc',
'browser/signin/account_reconcilor_unittest.cc',
'browser/signin/account_service_flag_fetcher_unittest.cc',
......@@ -296,7 +290,6 @@
'browser/sync/sessions/session_data_type_controller_unittest.cc',
'browser/sync/sessions/tab_node_pool_unittest.cc',
'browser/sync/startup_controller_unittest.cc',
'browser/sync/sync_policy_handler_unittest.cc',
'browser/sync/sync_startup_tracker_unittest.cc',
'browser/sync/test/test_http_bridge_factory.cc',
'browser/sync/test/test_http_bridge_factory.h',
......@@ -571,7 +564,6 @@
'test/base/menu_model_test.h',
'test/base/v8_unit_test.cc',
'test/base/v8_unit_test.h',
'test/data/resource.rc',
'test/data/unit/framework_unittest.gtestjs',
'test/logging/win/mof_data_parser_unittest.cc',
'utility/chrome_content_utility_client_unittest.cc',
......@@ -1188,7 +1180,6 @@
'browser/chromeos/file_system_provider/mount_path_util_unittest.cc',
'browser/chromeos/file_system_provider/operations/abort_unittest.cc',
'browser/chromeos/file_system_provider/operations/add_watcher_unittest.cc',
'browser/chromeos/file_system_provider/operations/add_watcher_unittest.cc',
'browser/chromeos/file_system_provider/operations/close_file_unittest.cc',
'browser/chromeos/file_system_provider/operations/copy_entry_unittest.cc',
'browser/chromeos/file_system_provider/operations/create_directory_unittest.cc',
......@@ -1328,7 +1319,6 @@
'browser/ui/views/confirm_bubble_views_unittest.cc',
'browser/ui/views/crypto_module_password_dialog_view_unittest.cc',
'browser/ui/views/desktop_media_picker_views_unittest.cc',
'browser/ui/views/extensions/browser_action_drag_data_unittest.cc',
'browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc',
'browser/ui/views/first_run_bubble_unittest.cc',
'browser/ui/views/frame/browser_view_layout_unittest.cc',
......@@ -1349,6 +1339,11 @@
'browser/ui/views/translate/translate_bubble_view_unittest.cc',
'browser/ui/views/validation_message_bubble_delegate_unittest.cc',
],
'chrome_unit_tests_win_sources': [
'app/chrome_dll.rc',
'browser/search_engines/template_url_scraper_unittest.cc',
'test/data/resource.rc',
],
'chrome_unit_tests_mac_sources': [
'browser/media_galleries/fileapi/iphoto_file_util_unittest.cc',
'utility/media_galleries/iphoto_library_parser_unittest.cc',
......@@ -1356,7 +1351,6 @@
'chrome_unit_tests_win_mac_sources': [
'browser/media_galleries/fileapi/itunes_file_util_unittest.cc',
'browser/media_galleries/fileapi/picasa_file_util_unittest.cc',
'common/extensions/api/networking_private/networking_private_crypto_unittest.cc',
'utility/media_galleries/itunes_library_parser_unittest.cc',
'utility/media_galleries/picasa_album_table_reader_unittest.cc',
'utility/media_galleries/picasa_albums_indexer_unittest.cc',
......@@ -1795,6 +1789,7 @@
'../chromeos/chromeos.gyp:chromeos_test_support',
],
'sources': [
# Note: sources list duplicated in GN build.
'browser/chromeos/app_mode/fake_cws.cc',
'browser/chromeos/app_mode/fake_cws.h',
'browser/chromeos/file_manager/fake_disk_mount_manager.cc',
......@@ -2001,6 +1996,7 @@
],
},
{
# GN version: //chrome/test:test_support_unit
'target_name': 'test_support_unit',
'type': 'static_library',
'dependencies': [
......@@ -2027,6 +2023,7 @@
],
},
{
# GN version: //chrome/test:unit_tests
'target_name': 'unit_tests',
'type': '<(gtest_target_type)',
'dependencies': [
......@@ -2203,9 +2200,6 @@
'../ui/aura/aura.gyp:aura_test_support',
'../ui/views/views.gyp:views_test_support',
],
'sources!': [
'browser/ui/views/extensions/browser_action_drag_data_unittest.cc',
],
'sources': [
'../ui/views/controls/webview/webview_unittest.cc',
],
......@@ -2258,6 +2252,16 @@
'browser/policy/policy_path_parser_unittest.cc',
],
}],
['OS!="android" and OS!="ios" and chromeos==0', {
'sources': [
'browser/net/disk_cache_dir_policy_handler_unittest.cc',
],
}],
['OS!="android" and OS!="ios"', {
'sources': [
'browser/download/download_dir_policy_handler_unittest.cc'
],
}],
],
}],
['enable_web_speech==1', {
......@@ -2464,6 +2468,7 @@
'<(DEPTH)/third_party/wtl/include',
],
'sources': [
'<@(chrome_unit_tests_win_sources)',
# TODO: It would be nice to have these pulled in
# automatically from direct_dependent_settings in
# their various targets (net.gyp:net_resources, etc.),
......@@ -2482,13 +2487,6 @@
'-lwinmm.lib',
],
},
}, { # else: OS != "win"
'sources!': [
'app/chrome_dll.rc',
'browser/search_engines/template_url_scraper_unittest.cc',
'browser/ui/views/extensions/browser_action_drag_data_unittest.cc',
'test/data/resource.rc',
],
}],
['OS=="android" or OS=="ios"', {
'sources!': [
......@@ -2501,8 +2499,6 @@
],
'sources!': [
'browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc',
'browser/net/spdyproxy/data_reduction_proxy_settings_unittest.cc',
'browser/net/spdyproxy/data_reduction_proxy_settings_unittest.h',
'browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc',
],
}],
......@@ -2524,16 +2520,6 @@
}, { # Not Android.
'sources': [ '<@(chrome_unit_tests_non_android_sources)' ],
}],
['OS!="android" and OS!="ios" and chromeos==0 and configuration_policy==1', {
'sources': [
'browser/net/disk_cache_dir_policy_handler_unittest.cc',
],
}],
['OS!="android" and OS!="ios" and configuration_policy==1', {
'sources': [
'browser/download/download_dir_policy_handler_unittest.cc'
],
}],
['enable_themes == 1', {
'sources': [ '<@(chrome_unit_tests_themes_sources)' ],
}],
......@@ -2597,6 +2583,7 @@
'browser/plugins/plugin_installer_unittest.cc',
],
}],
# Adding more conditions? Don't forget to update the GN build.
],
},
{
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
......@@ -102,6 +103,7 @@ source_set("test_support") {
"//components/ownership",
"//components/password_manager/core/browser:test_support",
"//components/pref_registry:test_support",
"//components/rappor:test_support",
"//components/search_engines:test_support",
"//components/signin/core/browser:test_support",
"//components/sync_driver:test_support",
......@@ -134,6 +136,7 @@ source_set("test_support") {
"//components/captive_portal:test_support",
"//components/infobars/core",
"//components/sessions:test_support",
"//components/web_resource:test_support",
"//google_apis:test_support",
"//ipc:test_support",
"//media:test_support",
......@@ -1160,4 +1163,517 @@ if (!is_android && (!is_win || link_chrome_on_windows)) {
# ]
#}
}
unit_gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../chrome_tests_unit.gypi") ],
"scope",
[ "../chrome_tests_unit.gypi" ])
test("unit_tests") {
sources =
rebase_path(unit_gypi_values.chrome_unit_tests_sources, ".", "//chrome")
defines = []
deps = [
# NOTE: New depndencies should generally be added in the OS!="ios"
# dependencies block below, rather than here.
# Unit tests should only depend on:
# 1) everything that the chrome binaries depend on:
"//chrome:browser_dependencies",
"//chrome:child_dependencies",
# 2) test-specific support libraries:
":test_support_unit",
"//base/test:test_support",
"//chrome/test:test_support",
"//components/resources",
"//components/content_settings/core/test:test_support",
"//content/test:test_support",
"//content/public/app:both",
"//crypto:platform",
"//crypto:test_support",
"//net",
"//net:test_support",
"//sync:test_support_sync_api",
"//sync:test_support_sync_core",
"//sync:test_support_sync_internal_api",
"//testing/gmock",
"//testing/gtest",
# 3) anything tests directly depend on
"//base/allocator",
"//chrome:resources",
"//chrome:strings",
"//courgette:courgette_lib",
"//google_apis",
"//skia",
"//third_party/cacheinvalidation",
"//third_party/icu",
"//third_party/libxml",
"//ui/accelerometer",
"//ui/base:test_support",
"//ui/gfx:test_support",
"//ui/resources",
]
data_deps = []
# TODO(GYP) Windows stuff
# ['incremental_chrome_dll==1', {
# 'UseLibraryDependencyInputs': "true",
if (!is_ios) {
deps += [
"//components/autofill/content/browser:test_support",
"//components/metrics/proto",
"//components/data_reduction_proxy/core/browser:test_support",
"//components/webdata_services:test_support",
"//components/strings",
"//content/app/resources",
"//gpu:test_support",
"//media:test_support",
#'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared', TODO(GYP)
"//third_party/leveldatabase",
"//third_party/libaddressinput",
"//third_party/libjingle",
"//third_party/libphonenumber",
"//tools/json_schema_compiler/test",
"//ui/gl",
"//v8",
]
}
if (is_android) {
deps -= [ "//third_party/libaddressinput" ]
# Some android targets still depend on --gc-sections to link.
# TODO: remove --gc-sections for Debug builds (crbug.com/159847).
ldflags = [ "-Wl,--gc-sections" ]
deps += [ "//testing/android:native_test_native_code" ]
} else {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_non_android_sources,
".",
"//chrome")
}
if (is_ios || is_chromeos) {
sources -=
[ "../browser/metrics/signin_status_metrics_provider_unittest.cc" ]
}
if (enable_background) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_background_sources,
".",
"//chrome")
}
if (enable_spellcheck) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_spellchecker_sources,
".",
"//chrome")
if (is_mac && !is_ios) {
deps += [ "//third_party/hunspell" ]
}
}
if (enable_one_click_signin) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_one_click_signin_sources,
".",
"//chrome")
if (is_chromeos) {
sources -= [
"../browser/ui/sync/one_click_signin_helper_unittest.cc",
"../browser/ui/sync/one_click_signin_sync_starter_unittest.cc",
]
}
if (!toolkit_views) {
sources -= [ "../browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc" ]
}
}
if (enable_nacl) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_nacl_sources,
".",
"//chrome")
}
if (enable_extensions) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_extensions_sources,
".",
"//chrome")
deps += [
"//chrome/common/extensions/api",
"//extensions:extensions_resources",
"//extensions/strings",
]
if (enable_configuration_policy) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_extensions_policy_sources,
".",
"//chrome")
}
if (!is_chromeos) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources,
".",
"//chrome")
}
}
if (toolkit_views) {
deps += [
"//components/web_modal:test_support",
"//ui/views",
"//ui/views:test_support",
]
if (!is_mac) {
# TODO(tapted): Enable toolkit-views unit_tests on Mac when their
# respective implementations are linked in. http://crbug.com/412234.
sources += rebase_path(unit_gypi_values.chrome_unit_tests_views_sources,
".",
"//chrome")
}
}
if (use_ash) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_ash_sources,
".",
"//chrome")
deps += [
"//ash:test_support",
"//ash/resources",
"//ash/strings",
]
# We eventually want to compile both in Win Aura builds, see
# http://crbug.com/155545.
if (!is_win) {
sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ]
}
}
if (use_aura) {
sources += [ "//ui/views/controls/webview/webview_unittest.cc" ]
deps += [
"//ui/wm",
"//ui/aura:test_support",
"//ui/views:test_support",
]
}
if (!is_chromeos && is_linux) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_desktop_linux_sources,
".",
"//chrome")
}
if (!is_chromeos && !use_ozone && is_linux) {
deps += [
"//chrome/browser/ui/libgtk2ui",
"//build/config/linux:gio",
]
if (!is_component_build) {
# TODO(erg): This file does not compile in shared library mode because
# it is reaching into the internals of libgtk2ui, which shouldn't be
# linked with the rest of chrome. This should either be fixed by
# creating a separate unit test target, or by deleting the test.
sources += [ "../browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2_unittest.cc" ]
}
}
if (enable_task_manager) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_task_manager_sources,
".",
"//chrome")
}
if (enable_mdns) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_mdns_sources,
".",
"//chrome")
}
if (enable_service_discovery) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_service_discovery_sources,
".",
"//chrome")
}
if (enable_configuration_policy) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_configuration_policy_sources,
".",
"//chrome")
if (is_chromeos) {
sources -=
[ "../browser/policy/cloud/user_policy_signin_service_unittest.cc" ]
} else if (is_android) {
sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ]
}
if (!is_android && !is_ios && !is_chromeos) {
sources +=
[ "../browser/net/disk_cache_dir_policy_handler_unittest.cc" ]
}
if (!is_android && !is_ios) {
sources +=
[ "../browser/download/download_dir_policy_handler_unittest.cc" ]
}
}
if (enable_web_speech) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_speech_sources,
".",
"//chrome")
}
if (enable_notifications) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_notifications_sources,
".",
"//chrome")
if (is_android) {
sources -= [
# Android does not use the Message Center notification system.
"../browser/notifications/message_center_notifications_unittest.cc",
"../browser/notifications/message_center_settings_controller_unittest.cc",
]
}
}
if (safe_browsing_mode == 1) {
# TODO(sgurun): enable tests for safe_browsing==2.
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources,
".",
"//chrome")
defines += [ "FULL_SAFE_BROWSING" ]
if (is_chromeos) {
sources -= [ "../browser/safe_browsing/download_protection_service_unittest.cc" ]
} else if (is_android) {
sources -= [
# Android doesn't support download feedbacks.
"../browser/safe_browsing/download_feedback_unittest.cc",
"../browser/safe_browsing/download_feedback_service_unittest.cc",
"../browser/safe_browsing/download_protection_service_unittest.cc",
"../browser/safe_browsing/two_phase_uploader_unittest.cc",
]
}
}
if (enable_autofill_dialog && !is_android) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_autofill_dialog_sources,
".",
"//chrome")
}
if (enable_plugins) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_plugins_sources,
".",
"//chrome")
}
if (enable_print_preview) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_print_preview_sources,
".",
"//chrome")
}
if (enable_captive_portal_detection) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_captive_portal_sources,
".",
"//chrome")
}
if (enable_session_service) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_session_service_sources,
".",
"//chrome")
}
if (enable_webrtc) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_webrtc_sources,
".",
"//chrome")
}
if (is_chromeos) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_chromeos_sources,
".",
"//chrome")
deps += [
"//ash/resources",
"//ui/chromeos/resources",
]
sources -= [
"../browser/signin/signin_global_error_unittest.cc",
"../browser/signin/signin_manager_unittest.cc",
"../browser/signin/signin_names_io_thread_unittest.cc",
"../browser/ui/views/app_list/linux/app_list_linux_unittest.cc",
"../browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc",
]
}
if (use_x11) {
deps += [ "//ui/events/devices" ]
data_deps += [ "//tools/xdisplaycheck" ]
} else {
sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ]
}
if (cld_version == 0 || cld_version == 2) {
# Unit tests should be independent of the CLD2 access mechanism, just use
# static for simplicity.
deps += [ "//third_party/cld_2:cld2_static" ]
}
if (is_desktop_linux && cpu_arch == "x64") {
# Only add this test for 64 bit builds because otherwise we need the 32
# bit library on 64 bit systems when running this test.
sources +=
[ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ]
configs += [
"//chrome/browser:gnome_keyring",
"//chrome/browser:gnome_keyring_direct",
]
}
if (is_linux && !is_chromeos) {
sources +=
[ "../browser/password_manager/native_backend_libsecret_unittest.cc" ]
}
if (is_linux && use_aura) {
deps += [
"//dbus",
"//dbus:test_support",
"//ui/aura:test_support",
]
}
if (is_linux && is_chrome_branded && cpu_arch == "x86") {
ldflags = [ "-Wl,--strip-debug" ]
}
if (is_mac) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_mac_sources,
".",
"//chrome")
sources -= [
"../browser/ui/tests/ui_gfx_image_unittest.cc",
"../tools/convert_dict/convert_dict_unittest.cc",
"../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc",
]
# The test fetches resources which means Mac need the app bundle to exist
# on disk so it can pull from it.
deps += [
"//third_party/google_toolbox_for_mac",
"//third_party/ocmock",
]
# TODO(mark): We really want this for all non-static library targets,
# but when we tried to pull it up to the common.gypi level, it broke
# other things like the ui and startup tests. *shrug*
ldflags = [ "-Wl,-ObjC" ]
}
if (!is_mac && !is_ios) {
deps += [
"//third_party/hunspell",
"//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome/tools/convert_dict:lib",
]
}
if (is_win || is_mac) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_mac_sources,
".",
"//chrome")
}
if (is_win || is_mac || is_chromeos) {
sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ]
}
if (enable_rlz) {
deps += [ "//rlz:test_support" ]
} else {
sources -= [ "../browser/rlz/rlz_unittest.cc" ]
}
if (is_win) {
if (!is_component_build) {
# Unit_tests pdb files can get too big when incremental linking is
# on, disabling for this target.
#'LinkIncremental': '<(msvs_debug_link_nonincremental)', TODO(GYP)
}
sources += rebase_path(unit_gypi_values.chrome_unit_tests_win_sources,
".",
"//chrome")
sources += [
# TODO: It would be nice to have these pulled in
# automatically from direct_dependent_settings in
# their various targets (net.gyp:net_resources, etc.),
# but that causes errors in other targets when
# resulting .res files get referenced multiple times.
#'<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', TODO(GYP)
#'<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc', TODO(GYP)
#'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc', TODO(GYP)
]
deps += [
#'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_1', TODO(GYP)
#'browser/safe_browsing/verifier_test/verifier_unittest.gyp:verifier_test_dll_2', TODO(GYP)
#'chrome_version_resources', TODO(GYP)
"//chrome_elf:blacklist_test_dll_1",
"//third_party/iaccessible2",
"//third_party/isimpledom",
"//third_party/wtl",
]
libs = [
"comsupp.lib",
"oleacc.lib",
"rpcrt4.lib",
"urlmon.lib",
"winmm.lib",
]
}
if (is_android || is_ios) {
sources -= [
"../browser/devtools/device/webrtc/devtools_bridge_instances_request_unittest.cc",
"../browser/ui/sync/sync_promo_ui_unittest.cc",
]
} else {
sources -= [
"../browser/metrics/variations/variations_request_scheduler_mobile_unittest.cc",
"../browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc",
]
deps += [ "//chrome/tools/profile_reset:jtl_compiler_lib" ]
}
if (!is_android && !is_chromeos) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources,
".",
"//chrome")
}
if (enable_themes) {
sources += rebase_path(unit_gypi_values.chrome_unit_tests_themes_sources,
".",
"//chrome")
}
if (!is_android && (use_nss_certs || use_openssl_certs)) {
sources += [ "../common/net/x509_certificate_model_unittest.cc" ]
}
if (enable_supervised_users) {
sources += rebase_path(
unit_gypi_values.chrome_unit_tests_supervised_user_sources,
".",
"//chrome")
}
if (safe_browsing_mode == 1 && enable_extensions) {
sources += [ "../browser/extensions/blacklist_unittest.cc" ]
}
if (cld_version == 1) {
sources += [ "//third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc" ]
defines += [ "CLD_WINDOWS" ]
deps += [ "//third_party/cld" ]
}
if (enable_app_list) {
sources +=
rebase_path(unit_gypi_values.chrome_unit_tests_app_list_sources,
".",
"//chrome")
deps += [ "//ui/app_list:test_support" ]
}
if (use_ozone) {
# crbug.com/354036
sources -= [ "browser/chromeos/events/event_rewriter_unittest.cc" ]
}
if (!enable_plugin_installation) {
sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]
}
}
}
# Copyright 2015 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.
source_set("lib") {
# Production code shouldn't be depending on this.
testonly = true
sources = [
"aff_reader.cc",
"aff_reader.h",
"dic_reader.cc",
"dic_reader.h",
"hunspell_reader.cc",
"hunspell_reader.h",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
"//base",
]
}
executable("convert_dict") {
# Production code shouldn't be depending on this.
testonly = true
sources = [
"convert_dict.cc",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
":lib",
"//base",
"//base:i18n",
"//third_party/hunspell",
]
}
......@@ -8,6 +8,7 @@
},
'targets': [
{
# GN version: //chrome/tools/convert_dict:lib
'target_name': 'convert_dict_lib',
'product_name': 'convert_dict',
'type': 'static_library',
......
# Copyright 2015 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.
executable("jtl_compiler") {
sources = [
"//chrome/browser/profile_resetter/jtl_foundation.cc",
"//chrome/browser/profile_resetter/jtl_foundation.h",
"jtl_compiler_frontend.cc",
]
deps = [
":jtl_compiler_lib",
"//base",
"//crypto",
]
}
source_set("jtl_compiler_lib") {
sources = [
"//chrome/browser/profile_resetter/jtl_foundation.h",
"//chrome/browser/profile_resetter/jtl_instructions.h",
"jtl_compiler.h",
"jtl_compiler.cc",
"jtl_parser.h",
"jtl_parser.cc",
]
deps = [
"//base",
"//third_party/re2",
]
}
......@@ -4,6 +4,7 @@
},
'targets': [
{
# GN version: //chrome/tools/profile_reset:jtl_compiler
'target_name': 'jtl_compiler',
'type': 'executable',
'dependencies': [
......@@ -18,6 +19,7 @@
],
},
{
# GN version: //chrome/tools/profile_reset:jtl_compiler_lib
'target_name': 'jtl_compiler_lib',
'type': 'static_library',
'product_name': 'jtl_compiler',
......
......@@ -75,6 +75,10 @@ source_set("test_support") {
"browser/api_test_utils.h",
"browser/api_unittest.cc",
"browser/api_unittest.h",
"browser/app_window/test_app_window_contents.cc",
"browser/app_window/test_app_window_contents.h",
"browser/extension_error_test_util.cc",
"browser/extension_error_test_util.h",
"browser/extensions_test.cc",
"browser/extensions_test.h",
"browser/guest_view/test_guest_view_manager.cc",
......
# Copyright 2015 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/json_schema_api.gni")
json_schema_api("api") {
visibility = [ ":*" ]
sources = [
"additional_properties.json",
"any.json",
"arrays.json",
"callbacks.json",
"choices.json",
"crossref.json",
"enums.json",
"functions_as_parameters.json",
"functions_on_types.json",
"idl_basics.idl",
"idl_other_namespace.idl",
"idl_other_namespace_sub_namespace.idl",
"idl_object_types.idl",
"objects.json",
"simple_api.json",
"error_generation.json",
]
schemas = true
root_namespace = "test::api::%(namespace)s"
}
source_set("test") {
testonly = true
sources = [
"test_util.cc",
"test_util.h",
]
public_deps = [
":api",
]
if (is_win) {
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
cflags = [ "/wd4267" ]
}
}
......@@ -5,6 +5,7 @@
{
'targets': [
{
# GN version: //tools/json_schema_compiler:test
'target_name': 'json_schema_compiler_tests',
'type': 'static_library',
'variables': {
......
......@@ -349,6 +349,8 @@ component("base") {
"ime/chromeos/input_method_manager.h",
"ime/chromeos/input_method_whitelist.cc",
"ime/chromeos/input_method_whitelist.h",
"ime/chromeos/mock_component_extension_ime_manager_delegate.cc",
"ime/chromeos/mock_component_extension_ime_manager_delegate.h",
"ime/chromeos/mock_ime_candidate_window_handler.cc",
"ime/chromeos/mock_ime_candidate_window_handler.h",
"ime/chromeos/mock_ime_engine_handler.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment