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

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: For review. 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 ModelSafeRoutingInfo enabled_types; 60 ModelSafeRoutingInfo enabled_types;
61 GetModelSafeRoutingInfo(&enabled_types); 61 GetModelSafeRoutingInfo(&enabled_types);
62 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 62 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
63 for (ModelSafeRoutingInfo::const_iterator i = enabled_types.begin(); 63 for (ModelSafeRoutingInfo::const_iterator i = enabled_types.begin();
64 i != enabled_types.end(); ++i) { 64 i != enabled_types.end(); ++i) {
65 sync_ended.set(i->first); 65 sync_ended.set(i->first);
66 } 66 }
67 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( 67 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot(
68 SyncerStatus(), ErrorCounters(), 0, false, 68 SyncerStatus(), ErrorCounters(), 0, false,
69 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, 69 sync_ended, download_progress_markers, false, false, 0, 0, 0, false,
70 SyncSourceInfo(), 0)); 70 SyncSourceInfo(), 0, base::Time::Now()));
71 } 71 }
72 72
73 sync_api::HttpPostProviderFactory* 73 sync_api::HttpPostProviderFactory*
74 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( 74 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory(
75 const scoped_refptr<net::URLRequestContextGetter>& getter) { 75 const scoped_refptr<net::URLRequestContextGetter>& getter) {
76 return new browser_sync::TestHttpBridgeFactory; 76 return new browser_sync::TestHttpBridgeFactory;
77 } 77 }
78 78
79 void SyncBackendHostForProfileSyncTest::InitCore( 79 void SyncBackendHostForProfileSyncTest::InitCore(
80 const Core::DoInitializeOptions& options) { 80 const Core::DoInitializeOptions& options) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 Callback0::Type* callback) { 133 Callback0::Type* callback) {
134 scoped_ptr<Callback0::Type> scoped_callback(callback); 134 scoped_ptr<Callback0::Type> scoped_callback(callback);
135 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); 135 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop();
136 if (initialization_state_ == DOWNLOADING_NIGORI) { 136 if (initialization_state_ == DOWNLOADING_NIGORI) {
137 syncable::ModelTypeBitSet sync_ended; 137 syncable::ModelTypeBitSet sync_ended;
138 sync_ended.set(syncable::NIGORI); 138 sync_ended.set(syncable::NIGORI);
139 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 139 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
140 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( 140 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot(
141 SyncerStatus(), ErrorCounters(), 0, false, 141 SyncerStatus(), ErrorCounters(), 0, false,
142 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, 142 sync_ended, download_progress_markers, false, false, 0, 0, 0, false,
143 SyncSourceInfo(), 0)); 143 SyncSourceInfo(), 0, base::Time::Now()));
144 } 144 }
145 } 145 }
146 146
147 void SyncBackendHostForProfileSyncTest:: 147 void SyncBackendHostForProfileSyncTest::
148 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { 148 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) {
149 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). 149 EXPECT_CALL(*profile, GetPasswordStore(testing::_)).
150 WillOnce(testing::Return((PasswordStore*)NULL)); 150 WillOnce(testing::Return((PasswordStore*)NULL));
151 } 151 }
152 152
153 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( 153 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations(
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 void TestProfileSyncService::CreateBackend() { 266 void TestProfileSyncService::CreateBackend() {
267 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( 267 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest(
268 profile(), 268 profile(),
269 set_initial_sync_ended_on_init_, 269 set_initial_sync_ended_on_init_,
270 synchronous_backend_initialization_)); 270 synchronous_backend_initialization_));
271 } 271 }
272 272
273 std::string TestProfileSyncService::GetLsidForAuthBootstraping() { 273 std::string TestProfileSyncService::GetLsidForAuthBootstraping() {
274 return "foo"; 274 return "foo";
275 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698