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

Unified Diff: components/browser_sync/profile_sync_service_unittest.cc

Issue 2649133012: [Sync] Calculate active types and track catch up in DTMI not PSS. (Closed)
Patch Set: Fix ProfileSyncServiceTest. Created 3 years, 11 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
Index: components/browser_sync/profile_sync_service_unittest.cc
diff --git a/components/browser_sync/profile_sync_service_unittest.cc b/components/browser_sync/profile_sync_service_unittest.cc
index 916d3b3e98f58a13436c2ca83f67b76b9c13807a..24d5b41fc94e78cc0b8ac41f0702356743717d70 100644
--- a/components/browser_sync/profile_sync_service_unittest.cc
+++ b/components/browser_sync/profile_sync_service_unittest.cc
@@ -41,6 +41,7 @@
using syncer::DataTypeController;
using syncer::FakeSyncEngine;
+using syncer::ModelTypeSet;
using syncer::SyncMergeResult;
using testing::Return;
@@ -71,7 +72,8 @@ class FakeDataTypeManager : public syncer::DataTypeManager {
void PurgeForMigration(syncer::ModelTypeSet undesired_types,
syncer::ConfigureReason reason) override {}
void Stop() override{};
- State state() const override { return syncer::DataTypeManager::CONFIGURED; };
+ ModelTypeSet GetActiveDataTypes() const override { return ModelTypeSet(); }
+ State state() const override { return syncer::DataTypeManager::CONFIGURED; }
private:
ConfigureCalled configure_called_;
@@ -259,6 +261,8 @@ class ProfileSyncServiceTest : public ::testing::Test {
void OnConfigureCalled(syncer::ConfigureReason configure_reason) {
syncer::DataTypeManager::ConfigureResult result;
result.status = syncer::DataTypeManager::OK;
+ if (configure_reason == syncer::CONFIGURE_REASON_CATCH_UP)
+ result.was_catch_up_configure = true;
service()->OnConfigureDone(result);
}
@@ -734,7 +738,9 @@ TEST_F(ProfileSyncServiceTest, OnLocalSetPassphraseEncryption) {
EXPECT_TRUE(captured_callback.is_null());
// Simulate configure successful. Ensure that SBH::ClearServerData is called.
+ result.was_catch_up_configure = true;
service()->OnConfigureDone(result);
+ result.was_catch_up_configure = false;
EXPECT_FALSE(captured_callback.is_null());
// Once SBH::ClearServerData finishes successfully ensure that sync is
@@ -793,7 +799,9 @@ TEST_F(ProfileSyncServiceTest,
// Simulate catch up configure successful. Ensure that SBH::ClearServerData is
// called.
+ result.was_catch_up_configure = true;
service()->OnConfigureDone(result);
+ result.was_catch_up_configure = false;
EXPECT_FALSE(captured_callback.is_null());
ExpectSyncEngineCreation(1);
@@ -845,7 +853,9 @@ TEST_F(ProfileSyncServiceTest,
// Simulate catch up configure successful. Ensure that SBH::ClearServerData is
// called.
+ result.was_catch_up_configure = true;
service()->OnConfigureDone(result);
+ result.was_catch_up_configure = false;
EXPECT_FALSE(captured_callback.is_null());
ExpectSyncEngineCreation(1);

Powered by Google App Engine
This is Rietveld 408576698