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

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

Issue 7013040: Add information about sync session and other useful data to about:sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. Created 9 years, 7 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 "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void ReturnNonEmptyProgressMarkersInSnapshot( 46 void ReturnNonEmptyProgressMarkersInSnapshot(
47 const syncable::ModelTypeSet& for_types) { 47 const syncable::ModelTypeSet& for_types) {
48 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 48 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
49 for (syncable::ModelTypeSet::const_iterator it = for_types.begin(); 49 for (syncable::ModelTypeSet::const_iterator it = for_types.begin();
50 it != for_types.end(); ++it) { 50 it != for_types.end(); ++it) {
51 download_progress_markers[*it] = "foobar"; 51 download_progress_markers[*it] = "foobar";
52 } 52 }
53 53
54 snap_.reset(new SyncSessionSnapshot(SyncerStatus(), ErrorCounters(), 54 snap_.reset(new SyncSessionSnapshot(SyncerStatus(), ErrorCounters(),
55 0, false, syncable::ModelTypeBitSet(), download_progress_markers, 55 0, false, syncable::ModelTypeBitSet(), download_progress_markers,
56 false, false, 0, 0, 0, false, sessions::SyncSourceInfo())); 56 false, false, 0, 0, 0, false, sessions::SyncSourceInfo(), 0));
57 EXPECT_CALL(service_, GetLastSessionSnapshot()) 57 EXPECT_CALL(service_, GetLastSessionSnapshot())
58 .WillOnce(Return(snap_.get())); 58 .WillOnce(Return(snap_.get()));
59 } 59 }
60 60
61 void SendConfigureDone(DataTypeManager::ConfigureResult result, 61 void SendConfigureDone(DataTypeManager::ConfigureResult result,
62 const syncable::ModelTypeSet& types) { 62 const syncable::ModelTypeSet& types) {
63 DataTypeManager::ConfigureResultWithErrorLocation result_with_location( 63 DataTypeManager::ConfigureResultWithErrorLocation result_with_location(
64 result, FROM_HERE, types); 64 result, FROM_HERE, types);
65 NotificationService::current()->Notify( 65 NotificationService::current()->Notify(
66 NotificationType::SYNC_CONFIGURE_DONE, 66 NotificationType::SYNC_CONFIGURE_DONE,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 EXPECT_CALL(*manager(), state()) 266 EXPECT_CALL(*manager(), state())
267 .WillOnce(Return(DataTypeManager::CONFIGURED)); 267 .WillOnce(Return(DataTypeManager::CONFIGURED));
268 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION)) 268 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION))
269 .Times(1); 269 .Times(1);
270 migrator.MigrateTypes(to_migrate); 270 migrator.MigrateTypes(to_migrate);
271 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet()); 271 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet());
272 EXPECT_EQ(BackendMigrator::IDLE, migrator.state()); 272 EXPECT_EQ(BackendMigrator::IDLE, migrator.state());
273 } 273 }
274 274
275 }; // namespace browser_sync 275 }; // 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