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

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

Issue 9235040: [Sync] Handle errors during first sync gracefully. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. Created 8 years, 10 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/sessions/sync_session.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 "chrome/browser/sync/test_profile_sync_service.h" 5 #include "chrome/browser/sync/test_profile_sync_service.h"
6 6
7 #include "chrome/browser/signin/signin_manager.h" 7 #include "chrome/browser/signin/signin_manager.h"
8 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 8 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
9 #include "chrome/browser/sync/glue/data_type_controller.h" 9 #include "chrome/browser/sync/glue/data_type_controller.h"
10 #include "chrome/browser/sync/glue/sync_backend_host.h" 10 #include "chrome/browser/sync/glue/sync_backend_host.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void SyncBackendHostForProfileSyncTest:: 46 void SyncBackendHostForProfileSyncTest::
47 SimulateSyncCycleCompletedInitialSyncEnded( 47 SimulateSyncCycleCompletedInitialSyncEnded(
48 const tracked_objects::Location& location) { 48 const tracked_objects::Location& location) {
49 syncable::ModelTypeSet sync_ended; 49 syncable::ModelTypeSet sync_ended;
50 if (!fail_initial_download_) 50 if (!fail_initial_download_)
51 sync_ended = syncable::ModelTypeSet::All(); 51 sync_ended = syncable::ModelTypeSet::All();
52 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 52 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
53 HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( 53 HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot(
54 SyncerStatus(), ErrorCounters(), 0, false, 54 SyncerStatus(), ErrorCounters(), 0, false,
55 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, 55 sync_ended, download_progress_markers, false, false, 0, 0, 0, false,
56 SyncSourceInfo(), 0, base::Time::Now())); 56 SyncSourceInfo(), 0, base::Time::Now(), false));
57 } 57 }
58 58
59 namespace { 59 namespace {
60 60
61 sync_api::HttpPostProviderFactory* MakeTestHttpBridgeFactory() { 61 sync_api::HttpPostProviderFactory* MakeTestHttpBridgeFactory() {
62 return new browser_sync::TestHttpBridgeFactory(); 62 return new browser_sync::TestHttpBridgeFactory();
63 } 63 }
64 64
65 } // namespace 65 } // namespace
66 66
(...skipping 20 matching lines...) Expand all
87 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); 87 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop();
88 if (IsDownloadingNigoriForTest()) { 88 if (IsDownloadingNigoriForTest()) {
89 syncable::ModelTypeSet sync_ended; 89 syncable::ModelTypeSet sync_ended;
90 90
91 if (!fail_initial_download_) 91 if (!fail_initial_download_)
92 sync_ended.Put(syncable::NIGORI); 92 sync_ended.Put(syncable::NIGORI);
93 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 93 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
94 HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( 94 HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot(
95 SyncerStatus(), ErrorCounters(), 0, false, 95 SyncerStatus(), ErrorCounters(), 0, false,
96 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, 96 sync_ended, download_progress_markers, false, false, 0, 0, 0, false,
97 SyncSourceInfo(), 0, base::Time::Now())); 97 SyncSourceInfo(), 0, base::Time::Now(), false));
98 } 98 }
99 } 99 }
100 100
101 void SyncBackendHostForProfileSyncTest:: 101 void SyncBackendHostForProfileSyncTest::
102 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { 102 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) {
103 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). 103 EXPECT_CALL(*profile, GetPasswordStore(testing::_)).
104 WillOnce(testing::Return((PasswordStore*)NULL)); 104 WillOnce(testing::Return((PasswordStore*)NULL));
105 } 105 }
106 106
107 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( 107 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations(
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 void TestProfileSyncService::CreateBackend() { 232 void TestProfileSyncService::CreateBackend() {
233 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( 233 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest(
234 profile(), 234 profile(),
235 sync_prefs_.AsWeakPtr(), 235 sync_prefs_.AsWeakPtr(),
236 set_initial_sync_ended_on_init_, 236 set_initial_sync_ended_on_init_,
237 synchronous_backend_initialization_, 237 synchronous_backend_initialization_,
238 fail_initial_download_)); 238 fail_initial_download_));
239 } 239 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698