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

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

Issue 15701022: [Sync] Add support for sync Persistence Errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move bookmark change into separate patch Created 7 years, 5 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 "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/signin/fake_signin_manager.h" 10 #include "chrome/browser/signin/fake_signin_manager.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 506
507 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { 507 TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
508 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, 508 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
509 "test_user@gmail.com"); 509 "test_user@gmail.com");
510 SigninManagerFactory::GetForProfile(profile_.get())->Initialize( 510 SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
511 profile_.get(), NULL); 511 profile_.get(), NULL);
512 CreateSyncService(); 512 CreateSyncService();
513 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); 513 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager();
514 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; 514 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED;
515 syncer::SyncError error( 515 syncer::SyncError error(
516 FROM_HERE, "Association failed.", syncer::BOOKMARKS); 516 FROM_HERE,
517 syncer::SyncError::DATATYPE_ERROR,
518 "Association failed.",
519 syncer::BOOKMARKS);
517 std::map<syncer::ModelType, syncer::SyncError> errors; 520 std::map<syncer::ModelType, syncer::SyncError> errors;
518 errors[syncer::BOOKMARKS] = error; 521 errors[syncer::BOOKMARKS] = error;
519 DataTypeManager::ConfigureResult result( 522 DataTypeManager::ConfigureResult result(
520 status, 523 status,
521 syncer::ModelTypeSet(), 524 syncer::ModelTypeSet(),
522 errors, 525 errors,
523 syncer::ModelTypeSet(), 526 syncer::ModelTypeSet(),
524 syncer::ModelTypeSet()); 527 syncer::ModelTypeSet());
525 EXPECT_CALL(*data_type_manager, Configure(_, _)). 528 EXPECT_CALL(*data_type_manager, Configure(_, _)).
526 WillRepeatedly( 529 WillRepeatedly(
(...skipping 26 matching lines...) Expand all
553 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( 556 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
554 GaiaConstants::kSyncService, "token"); 557 GaiaConstants::kSyncService, "token");
555 sync_->fail_initial_download(); 558 sync_->fail_initial_download();
556 559
557 sync_->SetSetupInProgress(true); 560 sync_->SetSetupInProgress(true);
558 sync_->Initialize(); 561 sync_->Initialize();
559 sync_->SetSetupInProgress(false); 562 sync_->SetSetupInProgress(false);
560 EXPECT_FALSE(sync_->sync_initialized()); 563 EXPECT_FALSE(sync_->sync_initialized());
561 EXPECT_TRUE(sync_->GetBackendForTest()); 564 EXPECT_TRUE(sync_->GetBackendForTest());
562 } 565 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_typed_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698