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