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

Unified Diff: components/sync/device_info/device_info_sync_bridge_unittest.cc

Issue 2536043002: [Sync] Stop updating local device info time stamp on merge. (Closed)
Patch Set: Created 4 years, 1 month 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/device_info/device_info_sync_bridge.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/device_info/device_info_sync_bridge_unittest.cc
diff --git a/components/sync/device_info/device_info_sync_bridge_unittest.cc b/components/sync/device_info/device_info_sync_bridge_unittest.cc
index 115166664dbf96858d9130d5ce7a49276e8554ec..583553a2ad252938c87ceeef9ee59372b6b4f99b 100644
--- a/components/sync/device_info/device_info_sync_bridge_unittest.cc
+++ b/components/sync/device_info/device_info_sync_bridge_unittest.cc
@@ -663,6 +663,21 @@ TEST_F(DeviceInfoSyncBridgeTest, MergeLocalGuid) {
EXPECT_TRUE(processor()->put_multimap().empty());
}
+TEST_F(DeviceInfoSyncBridgeTest, MergeLocalGuidBeforeReconcile) {
+ InitializeBridge();
+ const DeviceInfoSpecifics specifics = CreateSpecifics(kDefaultLocalSuffix);
+
+ // The message loop is never pumped, which means local data/metadata is never
+ // loaded, and thus reconcile is never called. The bridge should ignore this
+ // EntityData because its cache guid is the same the local device's.
+ const SyncError error = bridge()->MergeSyncData(
+ bridge()->CreateMetadataChangeList(),
+ {{specifics.cache_guid(), SpecificsToEntity(specifics)}});
+ EXPECT_FALSE(error.IsSet());
+ EXPECT_EQ(0, change_count());
+ EXPECT_EQ(0u, bridge()->GetAllDeviceInfo().size());
+}
+
TEST_F(DeviceInfoSyncBridgeTest, CountActiveDevices) {
InitializeAndPump();
EXPECT_EQ(1, bridge()->CountActiveDevices());
« no previous file with comments | « components/sync/device_info/device_info_sync_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698