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

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

Issue 10387144: [Sync] - Implement isolated model association. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For submitting. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/signin/signin_manager.h" 10 #include "chrome/browser/signin/signin_manager.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { 304 TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
305 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); 305 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager();
306 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; 306 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED;
307 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS); 307 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS);
308 std::list<SyncError> errors; 308 std::list<SyncError> errors;
309 errors.push_back(error); 309 errors.push_back(error);
310 browser_sync::DataTypeManager::ConfigureResult result( 310 browser_sync::DataTypeManager::ConfigureResult result(
311 status, 311 status,
312 syncable::ModelTypeSet(), 312 syncable::ModelTypeSet(),
313 errors); 313 errors,
314 syncable::ModelTypeSet());
314 EXPECT_CALL(*data_type_manager, Configure(_, _)). 315 EXPECT_CALL(*data_type_manager, Configure(_, _)).
315 WillRepeatedly( 316 WillRepeatedly(
316 DoAll( 317 DoAll(
317 NotifyFromDataTypeManager(data_type_manager, 318 NotifyFromDataTypeManager(data_type_manager,
318 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)), 319 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)),
319 NotifyFromDataTypeManagerWithResult(data_type_manager, 320 NotifyFromDataTypeManagerWithResult(data_type_manager,
320 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), 321 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE),
321 &result))); 322 &result)));
322 EXPECT_CALL(*data_type_manager, state()). 323 EXPECT_CALL(*data_type_manager, state()).
323 WillOnce(Return(DataTypeManager::STOPPED)); 324 WillOnce(Return(DataTypeManager::STOPPED));
(...skipping 14 matching lines...) Expand all
338 339
339 // Preload the tokens. 340 // Preload the tokens.
340 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( 341 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
341 GaiaConstants::kSyncService, "sync_token"); 342 GaiaConstants::kSyncService, "sync_token");
342 service_->fail_initial_download(); 343 service_->fail_initial_download();
343 344
344 service_->Initialize(); 345 service_->Initialize();
345 EXPECT_FALSE(service_->sync_initialized()); 346 EXPECT_FALSE(service_->sync_initialized());
346 EXPECT_FALSE(service_->GetBackendForTest()); 347 EXPECT_FALSE(service_->GetBackendForTest());
347 } 348 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698