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

Unified Diff: chrome/browser/sync/profile_sync_service_startup_unittest.cc

Issue 14655009: Client changes for disabled dasher account (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix small things based on feedback Created 7 years, 7 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: chrome/browser/sync/profile_sync_service_startup_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
index 6b3b6f5f7fe82f0e570b7330cb2bbd70e518f2ef..1e319644f0e1df62f07957d43696a44b8693b67c 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -446,6 +446,21 @@ TEST_F(ProfileSyncServiceStartupTest, SwitchManaged) {
profile_->GetPrefs()->ClearPref(prefs::kSyncManaged);
}
+TEST_F(ProfileSyncServiceStartupTest, DisabledByAdminStartup) {
+ // Disable sync through policy.
+ profile_->GetPrefs()->SetBoolean(prefs::kSyncDisabledByAdmin, true);
+
+ EXPECT_CALL(*sync_->components_factory_mock(),
+ CreateDataTypeManager(_, _, _, _, _)).Times(0);
+ EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
+
+ // Service should not be started by Initialize() since it's managed.
+ TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
+ GaiaConstants::kSyncService, "sync_token");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ sync_->Initialize();
+}
+
TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
DataTypeManagerMock* data_type_manager = SetUpDataTypeManager();
DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED;

Powered by Google App Engine
This is Rietveld 408576698