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

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

Issue 2587343005: Revert "[Sync] Actively guard against provider being cleared in DeviceInfoSyncBridge." (Closed)
Patch Set: Created 4 years 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 983873672985d587b1dcf67e0831b791a8b6e6b2..583553a2ad252938c87ceeef9ee59372b6b4f99b 100644
--- a/components/sync/device_info/device_info_sync_bridge_unittest.cc
+++ b/components/sync/device_info/device_info_sync_bridge_unittest.cc
@@ -26,7 +26,6 @@
namespace syncer {
-using base::OneShotTimer;
using base::Time;
using base::TimeDelta;
using sync_pb::DeviceInfoSpecifics;
@@ -263,8 +262,6 @@ class DeviceInfoSyncBridgeTest : public testing::Test,
return processor_;
}
- const OneShotTimer& pulse_timer() { return bridge()->pulse_timer_; }
-
// Should only be called after the bridge has been initialized. Will first
// recover the bridge's store, so another can be initialized later, and then
// deletes the bridge.
@@ -353,16 +350,6 @@ TEST_F(DeviceInfoSyncBridgeTest, LocalProviderInitRace) {
EXPECT_TRUE(processor()->metadata());
}
-// Simulate shutting down sync during the ModelTypeStore callbacks. The pulse
-// timer should still be initialized, even though reconcile never occurs.
-TEST_F(DeviceInfoSyncBridgeTest, ClearProviderDuringInit) {
- InitializeBridge();
- local_device()->Clear();
- base::RunLoop().RunUntilIdle();
- EXPECT_EQ(0u, bridge()->GetAllDeviceInfo().size());
- EXPECT_TRUE(pulse_timer().IsRunning());
-}
-
TEST_F(DeviceInfoSyncBridgeTest, GetClientTagNormal) {
InitializeBridge();
const std::string guid = "abc";
@@ -578,25 +565,6 @@ TEST_F(DeviceInfoSyncBridgeTest, ApplyDeleteNonexistent) {
EXPECT_EQ(1, change_count());
}
-TEST_F(DeviceInfoSyncBridgeTest, ClearProviderAndApply) {
- // This will initialize the provider a first time.
- InitializeAndPump();
- EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size());
-
- const DeviceInfoSpecifics specifics = CreateSpecifics(1, Time::Now());
-
- local_device()->Clear();
- SyncError error = bridge()->ApplySyncChanges(
- bridge()->CreateMetadataChangeList(), EntityAddList({specifics}));
- EXPECT_FALSE(error.IsSet());
- EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size());
-
- local_device()->Initialize(CreateModel(kDefaultLocalSuffix));
- error = bridge()->ApplySyncChanges(bridge()->CreateMetadataChangeList(),
- EntityAddList({specifics}));
- EXPECT_EQ(2u, bridge()->GetAllDeviceInfo().size());
-}
-
TEST_F(DeviceInfoSyncBridgeTest, MergeEmpty) {
InitializeAndPump();
EXPECT_EQ(1, change_count());
@@ -710,24 +678,6 @@ TEST_F(DeviceInfoSyncBridgeTest, MergeLocalGuidBeforeReconcile) {
EXPECT_EQ(0u, bridge()->GetAllDeviceInfo().size());
}
-TEST_F(DeviceInfoSyncBridgeTest, ClearProviderAndMerge) {
- // This will initialize the provider a first time.
- InitializeAndPump();
- EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size());
-
- const DeviceInfoSpecifics specifics = CreateSpecifics(1, Time::Now());
-
- local_device()->Clear();
- SyncError error = bridge()->MergeSyncData(
- bridge()->CreateMetadataChangeList(), InlineEntityDataMap({specifics}));
- EXPECT_FALSE(error.IsSet());
- EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size());
- local_device()->Initialize(CreateModel(kDefaultLocalSuffix));
- error = bridge()->MergeSyncData(bridge()->CreateMetadataChangeList(),
- InlineEntityDataMap({specifics}));
- EXPECT_EQ(2u, 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