Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: components/sync/driver/device_info_sync_service_unittest.cc

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/driver/device_info_sync_service.cc ('k') | components/sync/driver/device_info_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/device_info_sync_service_unittest.cc
diff --git a/components/sync_driver/device_info_sync_service_unittest.cc b/components/sync/driver/device_info_sync_service_unittest.cc
similarity index 87%
rename from components/sync_driver/device_info_sync_service_unittest.cc
rename to components/sync/driver/device_info_sync_service_unittest.cc
index c6f449b4137005792c45febc344b274b96cbf019..48ed830515aeeceae5cc9a34ee2d1683021844cd 100644
--- a/components/sync_driver/device_info_sync_service_unittest.cc
+++ b/components/sync/driver/device_info_sync_service_unittest.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 "components/sync_driver/device_info_sync_service.h"
+#include "components/sync/driver/device_info_sync_service.h"
#include <stddef.h>
#include <stdint.h>
@@ -16,8 +16,8 @@
#include "components/sync/api/sync_error_factory_mock.h"
#include "components/sync/base/time.h"
#include "components/sync/core/attachments/attachment_service_proxy_for_test.h"
-#include "components/sync_driver/device_info_util.h"
-#include "components/sync_driver/local_device_info_provider_mock.h"
+#include "components/sync/driver/device_info_util.h"
+#include "components/sync/driver/local_device_info_provider_mock.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::Time;
@@ -93,12 +93,8 @@ class DeviceInfoSyncServiceTest : public testing::Test,
void SetUp() override {
local_device_.reset(new LocalDeviceInfoProviderMock(
- "guid_1",
- "client_1",
- "Chromium 10k",
- "Chrome 10k",
- sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
- "device_id"));
+ "guid_1", "client_1", "Chromium 10k", "Chrome 10k",
+ sync_pb::SyncEnums_DeviceType_TYPE_LINUX, "device_id"));
sync_service_.reset(new DeviceInfoSyncService(local_device_.get()));
sync_processor_.reset(new TestChangeProcessor());
// Register observer
@@ -190,11 +186,9 @@ namespace {
TEST_F(DeviceInfoSyncServiceTest, StartSyncEmptyInitialData) {
EXPECT_FALSE(sync_service_->IsSyncing());
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- SyncDataList(),
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, SyncDataList(), PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_TRUE(sync_service_->IsSyncing());
EXPECT_EQ(0, merge_result.num_items_added());
@@ -232,11 +226,9 @@ TEST_F(DeviceInfoSyncServiceTest, StartSyncMatchingInitialData) {
SyncDataList sync_data;
AddInitialData(&sync_data, "guid_1", "client_1");
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- sync_data,
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, sync_data, PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(0, merge_result.num_items_added());
EXPECT_EQ(0, merge_result.num_items_modified());
EXPECT_EQ(0, merge_result.num_items_deleted());
@@ -260,11 +252,9 @@ TEST_F(DeviceInfoSyncServiceTest, StartSync) {
// This guid matches the local device but the client name is different.
AddInitialData(&sync_data, "guid_1", "baz");
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- sync_data,
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, sync_data, PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(2, merge_result.num_items_added());
EXPECT_EQ(1, merge_result.num_items_modified());
@@ -290,11 +280,9 @@ TEST_F(DeviceInfoSyncServiceTest, ProcessAddChange) {
EXPECT_EQ(0, num_device_info_changed_callbacks_);
// Start with an empty initial data.
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- SyncDataList(),
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, SyncDataList(), PassProcessor(),
+ CreateAndPassSyncErrorFactory());
// There should be only one item corresponding to the local device
EXPECT_EQ(1, merge_result.num_items_after_association());
EXPECT_EQ(1, num_device_info_changed_callbacks_);
@@ -321,11 +309,9 @@ TEST_F(DeviceInfoSyncServiceTest, ProcessMultipleChanges) {
AddInitialData(&sync_data, "guid_2", "foo");
AddInitialData(&sync_data, "guid_3", "bar");
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- sync_data,
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, sync_data, PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(3, merge_result.num_items_after_association());
// reset callbacks counter
num_device_info_changed_callbacks_ = 0;
@@ -355,11 +341,9 @@ TEST_F(DeviceInfoSyncServiceTest, ProcessMultipleChanges) {
// Process update to the local device info and verify that it is ignored.
TEST_F(DeviceInfoSyncServiceTest, ProcessUpdateChangeMatchingLocalDevice) {
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- SyncDataList(),
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, SyncDataList(), PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(1, merge_result.num_items_after_association());
// reset callbacks counter
num_device_info_changed_callbacks_ = 0;
@@ -382,11 +366,9 @@ TEST_F(DeviceInfoSyncServiceTest, ProcessDeleteChange) {
AddInitialData(&sync_data, "guid_2", "foo");
AddInitialData(&sync_data, "guid_3", "bar");
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- sync_data,
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, sync_data, PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(3, merge_result.num_items_after_association());
// reset callbacks counter
num_device_info_changed_callbacks_ = 0;
@@ -404,11 +386,9 @@ TEST_F(DeviceInfoSyncServiceTest, ProcessDeleteChange) {
// Process sync change with unexpected action.
TEST_F(DeviceInfoSyncServiceTest, ProcessInvalidChange) {
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- SyncDataList(),
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, SyncDataList(), PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(1, merge_result.num_items_after_association());
// reset callbacks counter
num_device_info_changed_callbacks_ = 0;
@@ -426,11 +406,9 @@ TEST_F(DeviceInfoSyncServiceTest, ProcessInvalidChange) {
// Process sync change after unsubscribing from notifications.
TEST_F(DeviceInfoSyncServiceTest, ProcessChangesAfterUnsubscribing) {
- SyncMergeResult merge_result =
- sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
- SyncDataList(),
- PassProcessor(),
- CreateAndPassSyncErrorFactory());
+ SyncMergeResult merge_result = sync_service_->MergeDataAndStartSyncing(
+ syncer::DEVICE_INFO, SyncDataList(), PassProcessor(),
+ CreateAndPassSyncErrorFactory());
EXPECT_EQ(1, merge_result.num_items_after_association());
// reset callbacks counter
num_device_info_changed_callbacks_ = 0;
« no previous file with comments | « components/sync/driver/device_info_sync_service.cc ('k') | components/sync/driver/device_info_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698