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

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

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. 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
« no previous file with comments | « no previous file | chrome/browser/sync/engine/all_status.cc » ('j') | 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) 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/backend_migrator.h" 5 #include "chrome/browser/sync/backend_migrator.h"
6 6
7 #include "chrome/browser/sync/glue/data_type_manager_mock.h" 7 #include "chrome/browser/sync/glue/data_type_manager_mock.h"
8 #include "chrome/browser/sync/profile_sync_service_mock.h" 8 #include "chrome/browser/sync/profile_sync_service_mock.h"
9 #include "chrome/browser/sync/sessions/session_state.h" 9 #include "chrome/browser/sync/sessions/session_state.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void ReturnNonEmptyProgressMarkersInSnapshot( 48 void ReturnNonEmptyProgressMarkersInSnapshot(
49 const syncable::ModelTypeSet& for_types) { 49 const syncable::ModelTypeSet& for_types) {
50 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 50 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
51 for (syncable::ModelTypeSet::const_iterator it = for_types.begin(); 51 for (syncable::ModelTypeSet::const_iterator it = for_types.begin();
52 it != for_types.end(); ++it) { 52 it != for_types.end(); ++it) {
53 download_progress_markers[*it] = "foobar"; 53 download_progress_markers[*it] = "foobar";
54 } 54 }
55 55
56 snap_.reset(new SyncSessionSnapshot(SyncerStatus(), ErrorCounters(), 56 snap_.reset(new SyncSessionSnapshot(SyncerStatus(), ErrorCounters(),
57 0, false, syncable::ModelTypeBitSet(), download_progress_markers, 57 0, false, syncable::ModelTypeBitSet(), download_progress_markers,
58 false, false, 0, 0, 0, false, sessions::SyncSourceInfo(), 0)); 58 false, false, 0, 0, 0, false, sessions::SyncSourceInfo(), 0,
59 base::Time::Now()));
59 EXPECT_CALL(service_, GetLastSessionSnapshot()) 60 EXPECT_CALL(service_, GetLastSessionSnapshot())
60 .WillOnce(Return(snap_.get())); 61 .WillOnce(Return(snap_.get()));
61 } 62 }
62 63
63 void SendConfigureDone(DataTypeManager::ConfigureStatus status, 64 void SendConfigureDone(DataTypeManager::ConfigureStatus status,
64 const syncable::ModelTypeSet& types) { 65 const syncable::ModelTypeSet& types) {
65 if (status == DataTypeManager::OK) { 66 if (status == DataTypeManager::OK) {
66 DataTypeManager::ConfigureResult result(status, types); 67 DataTypeManager::ConfigureResult result(status, types);
67 NotificationService::current()->Notify( 68 NotificationService::current()->Notify(
68 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, 69 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 EXPECT_CALL(*manager(), state()) 311 EXPECT_CALL(*manager(), state())
311 .WillOnce(Return(DataTypeManager::CONFIGURED)); 312 .WillOnce(Return(DataTypeManager::CONFIGURED));
312 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION)) 313 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION))
313 .Times(1); 314 .Times(1);
314 migrator.MigrateTypes(to_migrate); 315 migrator.MigrateTypes(to_migrate);
315 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet()); 316 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet());
316 EXPECT_EQ(BackendMigrator::IDLE, migrator.state()); 317 EXPECT_EQ(BackendMigrator::IDLE, migrator.state());
317 } 318 }
318 319
319 }; // namespace browser_sync 320 }; // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/all_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698