| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/sync/driver/backend_migrator.h" | 5 #include "components/sync/driver/backend_migrator.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
| 10 #include "components/sync/base/model_type_test_util.h" | 10 #include "components/sync/base/model_type_test_util.h" |
| 11 #include "components/sync/core/test/test_user_share.h" | 11 #include "components/sync/core/test/test_user_share.h" |
| 12 #include "components/sync/core/write_transaction.h" | 12 #include "components/sync/core/write_transaction.h" |
| 13 #include "components/sync/driver/data_type_manager_mock.h" | 13 #include "components/sync/driver/data_type_manager_mock.h" |
| 14 #include "components/sync/driver/fake_sync_service.h" | 14 #include "components/sync/driver/fake_sync_service.h" |
| 15 #include "components/sync/protocol/sync.pb.h" | 15 #include "components/sync/protocol/sync.pb.h" |
| 16 #include "components/sync/syncable/directory.h" // TODO(tim): Remove. Bug 13113
0. | 16 #include "components/sync/syncable/directory.h" // TODO(tim): Remove. Bug 13113
0. |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using ::testing::_; | 20 using ::testing::_; |
| 21 using ::testing::Eq; | 21 using ::testing::Eq; |
| 22 using ::testing::Mock; | 22 using ::testing::Mock; |
| 23 using ::testing::NiceMock; | 23 using ::testing::NiceMock; |
| 24 using ::testing::Return; | 24 using ::testing::Return; |
| 25 using sync_driver::DataTypeManager; | 25 using sync_driver::DataTypeManager; |
| 26 using sync_driver::DataTypeManagerMock; | 26 using sync_driver::DataTypeManagerMock; |
| 27 | 27 |
| 28 namespace browser_sync { | 28 namespace browser_sync { |
| 29 | 29 |
| 30 using syncer::sessions::SyncSessionSnapshot; | 30 using syncer::SyncCycleSnapshot; |
| 31 | 31 |
| 32 class SyncBackendMigratorTest : public testing::Test { | 32 class SyncBackendMigratorTest : public testing::Test { |
| 33 public: | 33 public: |
| 34 SyncBackendMigratorTest() {} | 34 SyncBackendMigratorTest() {} |
| 35 virtual ~SyncBackendMigratorTest() {} | 35 virtual ~SyncBackendMigratorTest() {} |
| 36 | 36 |
| 37 virtual void SetUp() { | 37 virtual void SetUp() { |
| 38 test_user_share_.SetUp(); | 38 test_user_share_.SetUp(); |
| 39 Mock::VerifyAndClear(manager()); | 39 Mock::VerifyAndClear(manager()); |
| 40 preferred_types_.Put(syncer::BOOKMARKS); | 40 preferred_types_.Put(syncer::BOOKMARKS); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 EXPECT_CALL(*manager(), | 317 EXPECT_CALL(*manager(), |
| 318 PurgeForMigration(_, syncer::CONFIGURE_REASON_MIGRATION)) | 318 PurgeForMigration(_, syncer::CONFIGURE_REASON_MIGRATION)) |
| 319 .Times(1); | 319 .Times(1); |
| 320 migrator()->MigrateTypes(to_migrate); | 320 migrator()->MigrateTypes(to_migrate); |
| 321 SetUnsyncedTypes(syncer::ModelTypeSet()); | 321 SetUnsyncedTypes(syncer::ModelTypeSet()); |
| 322 SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); | 322 SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); |
| 323 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); | 323 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); |
| 324 } | 324 } |
| 325 | 325 |
| 326 }; // namespace browser_sync | 326 }; // namespace browser_sync |
| OLD | NEW |