summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvabr <vabr@chromium.org>2016-02-19 09:24:22 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-19 17:25:13 +0000
commit7e9f0b977401718795e716cc77be9d491e020118 (patch)
treebd80a9fec6d7bfe72981eb9ade1d22e2c9575f8f
parent7f4baf0e04c8ceccfd0ca4f087e19e8241c3f1a4 (diff)
downloadchromium_src-7e9f0b977401718795e716cc77be9d491e020118.zip
chromium_src-7e9f0b977401718795e716cc77be9d491e020118.tar.gz
chromium_src-7e9f0b977401718795e716cc77be9d491e020118.tar.bz2
Move ProfileSyncService tests for autofill & typed URLs to components
This includes also shared test support. BUG=581640 Review URL: https://codereview.chromium.org/1692873004 Cr-Commit-Position: refs/heads/master@{#376474}
-rw-r--r--chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc2
-rw-r--r--chrome/chrome_tests_unit.gypi8
-rw-r--r--components/browser_sync.gypi6
-rw-r--r--components/browser_sync/browser/BUILD.gn14
-rw-r--r--components/browser_sync/browser/DEPS2
-rw-r--r--components/browser_sync/browser/abstract_profile_sync_service_test.cc (renamed from chrome/browser/sync/abstract_profile_sync_service_test.cc)6
-rw-r--r--components/browser_sync/browser/abstract_profile_sync_service_test.h (renamed from chrome/browser/sync/abstract_profile_sync_service_test.h)6
-rw-r--r--components/browser_sync/browser/profile_sync_service_autofill_unittest.cc (renamed from chrome/browser/sync/profile_sync_service_autofill_unittest.cc)7
-rw-r--r--components/browser_sync/browser/profile_sync_service_typed_url_unittest.cc (renamed from chrome/browser/sync/profile_sync_service_typed_url_unittest.cc)7
-rw-r--r--components/browser_sync/browser/test_http_bridge_factory.cc (renamed from chrome/browser/sync/test/test_http_bridge_factory.cc)2
-rw-r--r--components/browser_sync/browser/test_http_bridge_factory.h (renamed from chrome/browser/sync/test/test_http_bridge_factory.h)6
-rw-r--r--components/browser_sync/browser/test_profile_sync_service.cc (renamed from chrome/browser/sync/test_profile_sync_service.cc)2
-rw-r--r--components/browser_sync/browser/test_profile_sync_service.h (renamed from chrome/browser/sync/test_profile_sync_service.h)6
-rw-r--r--components/components_tests.gyp4
-rw-r--r--components/sync_driver.gypi3
-rw-r--r--components/sync_driver/BUILD.gn2
16 files changed, 51 insertions, 32 deletions
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc b/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
index efe9874..5a5c80b 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
@@ -16,9 +16,9 @@
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
-#include "chrome/browser/sync/test_profile_sync_service.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/browser_sync/browser/test_profile_sync_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/sync_driver/startup_controller.h"
#include "content/public/browser/render_frame_host.h"
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index e71db96..581e5f1 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -230,17 +230,9 @@
'browser/status_icons/status_icon_unittest.cc',
'browser/status_icons/status_tray_unittest.cc',
'browser/storage/durable_storage_permission_context_unittest.cc',
- 'browser/sync/abstract_profile_sync_service_test.cc',
- 'browser/sync/abstract_profile_sync_service_test.h',
- 'browser/sync/profile_sync_service_autofill_unittest.cc',
'browser/sync/profile_sync_service_bookmark_unittest.cc',
'browser/sync/profile_sync_service_factory_unittest.cc',
- 'browser/sync/profile_sync_service_typed_url_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',
- 'browser/sync/test_profile_sync_service.cc',
- 'browser/sync/test_profile_sync_service.h',
'browser/task_profiler/task_profiler_data_serializer_unittest.cc',
'browser/thumbnails/content_analysis_unittest.cc',
'browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc',
diff --git a/components/browser_sync.gypi b/components/browser_sync.gypi
index f9d4b4c..86244e5 100644
--- a/components/browser_sync.gypi
+++ b/components/browser_sync.gypi
@@ -82,10 +82,16 @@
],
'sources': [
# Note: file list duplicated in GN build.
+ 'browser_sync/browser/abstract_profile_sync_service_test.cc',
+ 'browser_sync/browser/abstract_profile_sync_service_test.h',
'browser_sync/browser/profile_sync_service_mock.cc',
'browser_sync/browser/profile_sync_service_mock.h',
'browser_sync/browser/profile_sync_test_util.cc',
'browser_sync/browser/profile_sync_test_util.h',
+ 'browser_sync/browser/test_http_bridge_factory.cc',
+ 'browser_sync/browser/test_http_bridge_factory.h',
+ 'browser_sync/browser/test_profile_sync_service.cc',
+ 'browser_sync/browser/test_profile_sync_service.h',
],
}
],
diff --git a/components/browser_sync/browser/BUILD.gn b/components/browser_sync/browser/BUILD.gn
index d77b676..653fb88 100644
--- a/components/browser_sync/browser/BUILD.gn
+++ b/components/browser_sync/browser/BUILD.gn
@@ -48,7 +48,9 @@ source_set("unit_tests") {
testonly = true
sources = [
+ "profile_sync_service_autofill_unittest.cc",
"profile_sync_service_startup_unittest.cc",
+ "profile_sync_service_typed_url_unittest.cc",
"profile_sync_service_unittest.cc",
]
@@ -57,8 +59,11 @@ source_set("unit_tests") {
":test_support",
"//base",
"//base/test:test_support",
+ "//components/autofill/core/browser:test_support",
+ "//components/autofill/core/common:common",
"//components/browser_sync/common",
"//components/dom_distiller/core",
+ "//components/history/core/browser:browser",
"//components/invalidation/impl",
"//components/invalidation/public",
"//components/prefs",
@@ -74,6 +79,7 @@ source_set("unit_tests") {
"//components/syncable_prefs:test_support",
"//components/version_info",
"//components/version_info:generate_version_info",
+ "//components/webdata_services:test_support",
"//google_apis",
"//net",
"//testing/gmock",
@@ -85,10 +91,16 @@ source_set("unit_tests") {
source_set("test_support") {
testonly = true
sources = [
+ "abstract_profile_sync_service_test.cc",
+ "abstract_profile_sync_service_test.h",
"profile_sync_service_mock.cc",
"profile_sync_service_mock.h",
"profile_sync_test_util.cc",
"profile_sync_test_util.h",
+ "test_http_bridge_factory.cc",
+ "test_http_bridge_factory.h",
+ "test_profile_sync_service.cc",
+ "test_profile_sync_service.h",
]
deps = [
@@ -107,6 +119,8 @@ source_set("test_support") {
"//components/syncable_prefs:test_support",
"//google_apis",
"//net:test_support",
+ "//sync:test_support_sync_core",
+ "//sync:test_support_sync_internal_api",
"//testing/gmock",
]
}
diff --git a/components/browser_sync/browser/DEPS b/components/browser_sync/browser/DEPS
index 34efff6..a932286 100644
--- a/components/browser_sync/browser/DEPS
+++ b/components/browser_sync/browser/DEPS
@@ -17,6 +17,8 @@ include_rules = [
"+components/strings",
"+components/variations",
"+components/version_info",
+ "+components/webdata/common",
+ "+components/webdata_services",
"+google_apis",
"+net",
"+sync",
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/components/browser_sync/browser/abstract_profile_sync_service_test.cc
index c555080..b122e12 100644
--- a/chrome/browser/sync/abstract_profile_sync_service_test.cc
+++ b/components/browser_sync/browser/abstract_profile_sync_service_test.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/sync/abstract_profile_sync_service_test.h"
+#include "components/browser_sync/browser/abstract_profile_sync_service_test.h"
#include <utility>
@@ -11,8 +11,8 @@
#include "base/files/file_path.h"
#include "base/location.h"
#include "base/run_loop.h"
-#include "chrome/browser/sync/test/test_http_bridge_factory.h"
-#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "components/browser_sync/browser/test_http_bridge_factory.h"
+#include "components/browser_sync/browser/test_profile_sync_service.h"
#include "components/sync_driver/glue/sync_backend_host_core.h"
#include "components/sync_driver/sync_api_component_factory_mock.h"
#include "google_apis/gaia/gaia_constants.h"
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/components/browser_sync/browser/abstract_profile_sync_service_test.h
index 39cb4cc..5963db7 100644
--- a/chrome/browser/sync/abstract_profile_sync_service_test.h
+++ b/components/browser_sync/browser/abstract_profile_sync_service_test.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
-#define CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
+#ifndef COMPONENTS_BROWSER_SYNC_BROWSER_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
+#define COMPONENTS_BROWSER_SYNC_BROWSER_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
#include <stdint.h>
@@ -90,4 +90,4 @@ class CreateRootHelper {
DISALLOW_COPY_AND_ASSIGN(CreateRootHelper);
};
-#endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
+#endif // COMPONENTS_BROWSER_SYNC_BROWSER_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/components/browser_sync/browser/profile_sync_service_autofill_unittest.cc
index b32d162..d69e11b 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/components/browser_sync/browser/profile_sync_service_autofill_unittest.cc
@@ -10,8 +10,6 @@
#include <utility>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
-
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -26,8 +24,6 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
-#include "chrome/browser/sync/abstract_profile_sync_service_test.h"
-#include "chrome/browser/sync/test_profile_sync_service.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/country_names.h"
#include "components/autofill/core/browser/personal_data_manager.h"
@@ -40,7 +36,9 @@
#include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/browser_sync/browser/abstract_profile_sync_service_test.h"
#include "components/browser_sync/browser/profile_sync_service.h"
+#include "components/browser_sync/browser/test_profile_sync_service.h"
#include "components/sync_driver/data_type_controller.h"
#include "components/sync_driver/data_type_manager_impl.h"
#include "components/sync_driver/sync_api_component_factory_mock.h"
@@ -57,6 +55,7 @@
#include "sync/syncable/mutable_entry.h"
#include "sync/syncable/syncable_write_transaction.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
using autofill::AutocompleteSyncableService;
using autofill::AutofillChange;
diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/components/browser_sync/browser/profile_sync_service_typed_url_unittest.cc
index 9300403..7cf6eae 100644
--- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
+++ b/components/browser_sync/browser/profile_sync_service_typed_url_unittest.cc
@@ -9,8 +9,6 @@
#include <utility>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
-
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -23,8 +21,8 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
-#include "chrome/browser/sync/abstract_profile_sync_service_test.h"
-#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "components/browser_sync/browser/abstract_profile_sync_service_test.h"
+#include "components/browser_sync/browser/test_profile_sync_service.h"
#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_backend_client.h"
#include "components/history/core/browser/history_backend_notifier.h"
@@ -40,6 +38,7 @@
#include "sync/internal_api/public/write_transaction.h"
#include "sync/protocol/typed_url_specifics.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
using browser_sync::TypedUrlDataTypeController;
diff --git a/chrome/browser/sync/test/test_http_bridge_factory.cc b/components/browser_sync/browser/test_http_bridge_factory.cc
index f9ee282..b38bb6e 100644
--- a/chrome/browser/sync/test/test_http_bridge_factory.cc
+++ b/components/browser_sync/browser/test_http_bridge_factory.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/sync/test/test_http_bridge_factory.h"
+#include "components/browser_sync/browser/test_http_bridge_factory.h"
namespace browser_sync {
diff --git a/chrome/browser/sync/test/test_http_bridge_factory.h b/components/browser_sync/browser/test_http_bridge_factory.h
index 4ee1855..b4c2608 100644
--- a/chrome/browser/sync/test/test_http_bridge_factory.h
+++ b/components/browser_sync/browser/test_http_bridge_factory.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
-#define CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
+#ifndef COMPONENTS_BROWSER_SYNC_BROWSER_TEST_HTTP_BRIDGE_FACTORY_H_
+#define COMPONENTS_BROWSER_SYNC_BROWSER_TEST_HTTP_BRIDGE_FACTORY_H_
#include "base/compiler_specific.h"
#include "sync/internal_api/public/http_post_provider_factory.h"
@@ -49,4 +49,4 @@ class TestHttpBridgeFactory : public syncer::HttpPostProviderFactory {
} // namespace browser_sync
-#endif // CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
+#endif // COMPONENTS_BROWSER_SYNC_BROWSER_TEST_HTTP_BRIDGE_FACTORY_H_
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/components/browser_sync/browser/test_profile_sync_service.cc
index 9909e33..092fdfe 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/components/browser_sync/browser/test_profile_sync_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "components/browser_sync/browser/test_profile_sync_service.h"
#include <utility>
diff --git a/chrome/browser/sync/test_profile_sync_service.h b/components/browser_sync/browser/test_profile_sync_service.h
index 097b4b9..54b0c37 100644
--- a/chrome/browser/sync/test_profile_sync_service.h
+++ b/components/browser_sync/browser/test_profile_sync_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
-#define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
+#ifndef COMPONENTS_BROWSER_SYNC_BROWSER_TEST_PROFILE_SYNC_SERVICE_H_
+#define COMPONENTS_BROWSER_SYNC_BROWSER_TEST_PROFILE_SYNC_SERVICE_H_
#include "base/macros.h"
#include "components/browser_sync/browser/profile_sync_service.h"
@@ -49,4 +49,4 @@ class TestProfileSyncService : public ProfileSyncService {
DISALLOW_COPY_AND_ASSIGN(TestProfileSyncService);
};
-#endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
+#endif // COMPONENTS_BROWSER_SYNC_BROWSER_TEST_PROFILE_SYNC_SERVICE_H_
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 1d685d6..8fa53c4 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -76,8 +76,10 @@
'bookmarks/managed/managed_bookmarks_tracker_unittest.cc',
],
'browser_sync_unittest_sources': [
+ 'browser_sync/browser/profile_sync_service_autofill_unittest.cc',
'browser_sync/browser/profile_sync_service_startup_unittest.cc',
'browser_sync/browser/profile_sync_service_unittest.cc',
+ 'browser_sync/browser/profile_sync_service_typed_url_unittest.cc',
],
'browser_watcher_unittest_sources': [
'browser_watcher/crash_reporting_metrics_win_unittest.cc',
@@ -1105,6 +1107,7 @@
'components.gyp:ssl_errors',
'components.gyp:suggestions',
'components.gyp:sync_bookmarks',
+ 'components.gyp:sync_driver',
'components.gyp:sync_driver_features',
'components.gyp:sync_driver_test_support',
'components.gyp:sync_sessions',
@@ -1125,6 +1128,7 @@
'components.gyp:variations_net',
'components.gyp:variations_service',
'components.gyp:version_info',
+ 'components.gyp:webdata_services_test_support',
'components.gyp:web_resource',
'components.gyp:web_resource_test_support',
'components_resources.gyp:components_resources',
diff --git a/components/sync_driver.gypi b/components/sync_driver.gypi
index 6b7fbf7..0a4310b9a 100644
--- a/components/sync_driver.gypi
+++ b/components/sync_driver.gypi
@@ -21,6 +21,9 @@
'sync_driver_features',
'version_info',
],
+ 'export_dependent_settings': [
+ '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
+ ],
'include_dirs': [
'..',
],
diff --git a/components/sync_driver/BUILD.gn b/components/sync_driver/BUILD.gn
index edcb9b4..b20c8bc 100644
--- a/components/sync_driver/BUILD.gn
+++ b/components/sync_driver/BUILD.gn
@@ -123,6 +123,7 @@ source_set("sync_driver") {
public_deps = [
":features",
+ "//third_party/cacheinvalidation",
]
deps = [
"//base",
@@ -137,7 +138,6 @@ source_set("sync_driver") {
"//google_apis",
"//net",
"//sync",
- "//third_party/cacheinvalidation",
]
if (enable_configuration_policy) {