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

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 review. 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
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { 302 TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
303 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); 303 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager();
304 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; 304 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED;
305 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS); 305 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS);
306 std::list<SyncError> errors; 306 std::list<SyncError> errors;
307 errors.push_back(error); 307 errors.push_back(error);
308 browser_sync::DataTypeManager::ConfigureResult result( 308 browser_sync::DataTypeManager::ConfigureResult result(
309 status, 309 status,
310 syncable::ModelTypeSet(), 310 syncable::ModelTypeSet(),
311 errors); 311 errors,
312 syncable::ModelTypeSet());
312 EXPECT_CALL(*data_type_manager, Configure(_, _)). 313 EXPECT_CALL(*data_type_manager, Configure(_, _)).
313 WillRepeatedly( 314 WillRepeatedly(
314 DoAll( 315 DoAll(
315 NotifyFromDataTypeManager(data_type_manager, 316 NotifyFromDataTypeManager(data_type_manager,
316 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)), 317 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)),
317 NotifyFromDataTypeManagerWithResult(data_type_manager, 318 NotifyFromDataTypeManagerWithResult(data_type_manager,
318 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), 319 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE),
319 &result))); 320 &result)));
320 EXPECT_CALL(*data_type_manager, state()). 321 EXPECT_CALL(*data_type_manager, state()).
321 WillOnce(Return(DataTypeManager::STOPPED)); 322 WillOnce(Return(DataTypeManager::STOPPED));
(...skipping 14 matching lines...) Expand all
336 337
337 // Preload the tokens. 338 // Preload the tokens.
338 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( 339 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
339 GaiaConstants::kSyncService, "sync_token"); 340 GaiaConstants::kSyncService, "sync_token");
340 service_->fail_initial_download(); 341 service_->fail_initial_download();
341 342
342 service_->Initialize(); 343 service_->Initialize();
343 EXPECT_FALSE(service_->sync_initialized()); 344 EXPECT_FALSE(service_->sync_initialized());
344 EXPECT_FALSE(service_->GetBackendForTest()); 345 EXPECT_FALSE(service_->GetBackendForTest());
345 } 346 }
OLDNEW
« chrome/browser/sync/profile_sync_service.cc ('K') | « 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