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

Unified Diff: sync/internal_api/sync_manager_impl_unittest.cc

Issue 455023003: Let SyncBackupManager keep backup data in memory until shutdown. Only persist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix sync manager test Created 6 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 | « sync/internal_api/sync_manager_impl.cc ('k') | sync/internal_api/sync_rollback_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_manager_impl_unittest.cc
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index 5518d4fa48d01af91ba31470a8907a01d94cf320..4571d08052486b7874135e0cfed941375263d9b4 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -834,6 +834,8 @@ class SyncManagerTest : public testing::Test,
sync_manager_.GetEncryptionHandler()->AddObserver(&encryption_observer_);
EXPECT_TRUE(js_backend_.IsInitialized());
+ EXPECT_EQ(InternalComponentsFactory::STORAGE_ON_DISK,
+ storage_used_);
if (initialization_succeeded_) {
for (ModelSafeRoutingInfo::iterator i = routing_info.begin();
@@ -951,7 +953,9 @@ class SyncManagerTest : public testing::Test,
}
virtual InternalComponentsFactory* GetFactory() {
- return new TestInternalComponentsFactory(GetSwitches(), STORAGE_IN_MEMORY);
+ return new TestInternalComponentsFactory(
+ GetSwitches(), InternalComponentsFactory::STORAGE_IN_MEMORY,
+ &storage_used_);
}
// Returns true if we are currently encrypting all sync data. May
@@ -1011,6 +1015,7 @@ class SyncManagerTest : public testing::Test,
StrictMock<SyncManagerObserverMock> manager_observer_;
StrictMock<SyncEncryptionHandlerObserverMock> encryption_observer_;
InternalComponentsFactory::Switches switches_;
+ InternalComponentsFactory::StorageOption storage_used_;
};
TEST_F(SyncManagerTest, GetAllNodesForTypeTest) {
@@ -2409,8 +2414,10 @@ class ComponentsFactory : public TestInternalComponentsFactory {
public:
ComponentsFactory(const Switches& switches,
SyncScheduler* scheduler_to_use,
- sessions::SyncSessionContext** session_context)
- : TestInternalComponentsFactory(switches, syncer::STORAGE_IN_MEMORY),
+ sessions::SyncSessionContext** session_context,
+ InternalComponentsFactory::StorageOption* storage_used)
+ : TestInternalComponentsFactory(
+ switches, InternalComponentsFactory::STORAGE_IN_MEMORY, storage_used),
scheduler_to_use_(scheduler_to_use),
session_context_(session_context) {}
virtual ~ComponentsFactory() {}
@@ -2433,7 +2440,8 @@ class SyncManagerTestWithMockScheduler : public SyncManagerTest {
SyncManagerTestWithMockScheduler() : scheduler_(NULL) {}
virtual InternalComponentsFactory* GetFactory() OVERRIDE {
scheduler_ = new MockSyncScheduler();
- return new ComponentsFactory(GetSwitches(), scheduler_, &session_context_);
+ return new ComponentsFactory(GetSwitches(), scheduler_, &session_context_,
+ &storage_used_);
}
MockSyncScheduler* scheduler() { return scheduler_; }
@@ -3177,7 +3185,9 @@ class SyncManagerInitInvalidStorageTest : public SyncManagerTest {
}
virtual InternalComponentsFactory* GetFactory() OVERRIDE {
- return new TestInternalComponentsFactory(GetSwitches(), STORAGE_INVALID);
+ return new TestInternalComponentsFactory(
+ GetSwitches(), InternalComponentsFactory::STORAGE_INVALID,
+ &storage_used_);
}
};
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/internal_api/sync_rollback_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698