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

Side by Side Diff: chrome/browser/sync/profile_sync_service_startup_unittest.cc

Issue 8760019: Make the change in ProfileSyncService such that it declares success (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/net/gaia/token_service.h" 9 #include "chrome/browser/net/gaia/token_service.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 WillOnce(Return(DataTypeManager::CONFIGURED)). 117 WillOnce(Return(DataTypeManager::CONFIGURED)).
118 WillOnce(Return(DataTypeManager::CONFIGURED)); 118 WillOnce(Return(DataTypeManager::CONFIGURED));
119 EXPECT_CALL(*data_type_manager, Stop()).Times(1); 119 EXPECT_CALL(*data_type_manager, Stop()).Times(1);
120 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); 120 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
121 121
122 // Create some tokens in the token service; the service will startup when 122 // Create some tokens in the token service; the service will startup when
123 // it is notified that tokens are available. 123 // it is notified that tokens are available.
124 service_->OnUserSubmittedAuth("test_user", "", "", ""); 124 service_->OnUserSubmittedAuth("test_user", "", "", "");
125 profile_->GetTokenService()->IssueAuthTokenForTest( 125 profile_->GetTokenService()->IssueAuthTokenForTest(
126 GaiaConstants::kSyncService, "sync_token"); 126 GaiaConstants::kSyncService, "sync_token");
127 profile_->GetTokenService()->IssueAuthTokenForTest(
128 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token");
127 129
128 syncable::ModelTypeSet set; 130 syncable::ModelTypeSet set;
129 set.insert(syncable::BOOKMARKS); 131 set.insert(syncable::BOOKMARKS);
130 service_->OnUserChoseDatatypes(false, set); 132 service_->OnUserChoseDatatypes(false, set);
131 EXPECT_TRUE(service_->ShouldPushChanges()); 133 EXPECT_TRUE(service_->ShouldPushChanges());
132 } 134 }
133 135
134 TEST_F(ProfileSyncServiceStartupCrosTest, StartFirstTime) { 136 TEST_F(ProfileSyncServiceStartupCrosTest, StartFirstTime) {
135 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); 137 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager();
136 profile_->GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted); 138 profile_->GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 307
306 // Preload the tokens. 308 // Preload the tokens.
307 profile_->GetTokenService()->IssueAuthTokenForTest( 309 profile_->GetTokenService()->IssueAuthTokenForTest(
308 GaiaConstants::kSyncService, "sync_token"); 310 GaiaConstants::kSyncService, "sync_token");
309 service_->fail_initial_download(); 311 service_->fail_initial_download();
310 312
311 service_->Initialize(); 313 service_->Initialize();
312 EXPECT_FALSE(service_->sync_initialized()); 314 EXPECT_FALSE(service_->sync_initialized());
313 EXPECT_FALSE(service_->GetBackendForTest()); 315 EXPECT_FALSE(service_->GetBackendForTest());
314 } 316 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698