Index: chrome/browser/sync/profile_sync_service_unittest.cc |
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc |
index 47724f03d287019acf621f68fb8209f42318e779..d68696699e85b91281da76f0eca3cb4a4310a230 100644 |
--- a/chrome/browser/sync/profile_sync_service_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc |
@@ -155,6 +155,31 @@ TEST_F(ProfileSyncServiceTest, AbortedByShutdown) { |
service_.reset(); |
} |
+TEST_F(ProfileSyncServiceTest, DisableAndEnableSyncTemporarily) { |
+ service_.reset(new TestProfileSyncService(&factory_, |
+ profile_.get(), |
+ "test", true, NULL)); |
+ // Register the bookmark data type. |
+ EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). |
+ WillRepeatedly(ReturnNewDataTypeManager()); |
+ |
+ profile_->GetTokenService()->IssueAuthTokenForTest( |
+ GaiaConstants::kSyncService, "token"); |
+ |
+ service_->Initialize(); |
+ EXPECT_TRUE(service_->sync_initialized()); |
+ EXPECT_TRUE(service_->GetBackendForTest() != NULL); |
+ EXPECT_FALSE(profile_->GetPrefs()->GetBoolean(prefs::kSyncSuppressStart)); |
+ |
+ service_->StopSyncAndSuppressStartUp(); |
+ EXPECT_FALSE(service_->sync_initialized()); |
+ EXPECT_TRUE(profile_->GetPrefs()->GetBoolean(prefs::kSyncSuppressStart)); |
+ |
+ service_->DisableSyncSuppressionAndStartUpSync(); |
+ EXPECT_TRUE(service_->sync_initialized()); |
+ EXPECT_FALSE(profile_->GetPrefs()->GetBoolean(prefs::kSyncSuppressStart)); |
+} |
+ |
TEST_F(ProfileSyncServiceTest, JsControllerHandlersBasic) { |
StartSyncService(); |
EXPECT_TRUE(service_->sync_initialized()); |