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

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

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing a typo. Created 9 years, 4 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) 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 "chrome/browser/sync/test_profile_sync_service.h" 5 #include "chrome/browser/sync/test_profile_sync_service.h"
6 6
7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
8 #include "chrome/browser/sync/engine/syncapi.h" 8 #include "chrome/browser/sync/engine/syncapi.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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 i != enabled_types.end(); ++i) { 78 i != enabled_types.end(); ++i) {
79 sync_ended.set(i->first); 79 sync_ended.set(i->first);
80 } 80 }
81 81
82 if (fail_initial_download_) 82 if (fail_initial_download_)
83 sync_ended.reset(); 83 sync_ended.reset();
84 84
85 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( 85 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot(
86 SyncerStatus(), ErrorCounters(), 0, false, 86 SyncerStatus(), ErrorCounters(), 0, false,
87 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, 87 sync_ended, download_progress_markers, false, false, 0, 0, 0, false,
88 SyncSourceInfo(), 0)); 88 SyncSourceInfo(), 0, base::Time::Now()));
89 } 89 }
90 90
91 sync_api::HttpPostProviderFactory* 91 sync_api::HttpPostProviderFactory*
92 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( 92 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory(
93 const scoped_refptr<net::URLRequestContextGetter>& getter) { 93 const scoped_refptr<net::URLRequestContextGetter>& getter) {
94 return new browser_sync::TestHttpBridgeFactory; 94 return new browser_sync::TestHttpBridgeFactory;
95 } 95 }
96 96
97 void SyncBackendHostForProfileSyncTest::InitCore( 97 void SyncBackendHostForProfileSyncTest::InitCore(
98 const Core::DoInitializeOptions& options) { 98 const Core::DoInitializeOptions& options) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); 153 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop();
154 if (initialization_state_ == DOWNLOADING_NIGORI) { 154 if (initialization_state_ == DOWNLOADING_NIGORI) {
155 syncable::ModelTypeBitSet sync_ended; 155 syncable::ModelTypeBitSet sync_ended;
156 156
157 if (!fail_initial_download_) 157 if (!fail_initial_download_)
158 sync_ended.set(syncable::NIGORI); 158 sync_ended.set(syncable::NIGORI);
159 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 159 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
160 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( 160 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot(
161 SyncerStatus(), ErrorCounters(), 0, false, 161 SyncerStatus(), ErrorCounters(), 0, false,
162 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, 162 sync_ended, download_progress_markers, false, false, 0, 0, 0, false,
163 SyncSourceInfo(), 0)); 163 SyncSourceInfo(), 0, base::Time::Now()));
164 } 164 }
165 } 165 }
166 166
167 void SyncBackendHostForProfileSyncTest:: 167 void SyncBackendHostForProfileSyncTest::
168 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { 168 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) {
169 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). 169 EXPECT_CALL(*profile, GetPasswordStore(testing::_)).
170 WillOnce(testing::Return((PasswordStore*)NULL)); 170 WillOnce(testing::Return((PasswordStore*)NULL));
171 } 171 }
172 172
173 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( 173 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations(
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( 293 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest(
294 profile(), 294 profile(),
295 set_initial_sync_ended_on_init_, 295 set_initial_sync_ended_on_init_,
296 synchronous_backend_initialization_, 296 synchronous_backend_initialization_,
297 fail_initial_download_)); 297 fail_initial_download_));
298 } 298 }
299 299
300 std::string TestProfileSyncService::GetLsidForAuthBootstraping() { 300 std::string TestProfileSyncService::GetLsidForAuthBootstraping() {
301 return "foo"; 301 return "foo";
302 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698