OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |