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" |
| 11 #include "chrome/test/testing_browser_process_test.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 | 14 |
14 using ::testing::_; | 15 using ::testing::_; |
15 using ::testing::Eq; | 16 using ::testing::Eq; |
16 using ::testing::Mock; | 17 using ::testing::Mock; |
17 using ::testing::NiceMock; | 18 using ::testing::NiceMock; |
18 using ::testing::Return; | 19 using ::testing::Return; |
19 using ::testing::SetArgumentPointee; | 20 using ::testing::SetArgumentPointee; |
20 | 21 |
21 namespace browser_sync { | 22 namespace browser_sync { |
22 | 23 |
23 using sessions::ErrorCounters; | 24 using sessions::ErrorCounters; |
24 using sessions::SyncerStatus; | 25 using sessions::SyncerStatus; |
25 using sessions::SyncSessionSnapshot; | 26 using sessions::SyncSessionSnapshot; |
26 | 27 |
27 class BackendMigratorTest : public testing::Test { | 28 class BackendMigratorTest : public TestingBrowserProcessTest { |
28 public: | 29 public: |
29 BackendMigratorTest() { } | 30 BackendMigratorTest() { } |
30 virtual ~BackendMigratorTest() { } | 31 virtual ~BackendMigratorTest() { } |
31 | 32 |
32 virtual void SetUp() { | 33 virtual void SetUp() { |
33 Mock::VerifyAndClear(manager()); | 34 Mock::VerifyAndClear(manager()); |
34 Mock::VerifyAndClear(&service_); | 35 Mock::VerifyAndClear(&service_); |
35 preferred_types_.insert(syncable::BOOKMARKS); | 36 preferred_types_.insert(syncable::BOOKMARKS); |
36 preferred_types_.insert(syncable::PREFERENCES); | 37 preferred_types_.insert(syncable::PREFERENCES); |
37 preferred_types_.insert(syncable::AUTOFILL); | 38 preferred_types_.insert(syncable::AUTOFILL); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 EXPECT_CALL(*manager(), state()) | 310 EXPECT_CALL(*manager(), state()) |
310 .WillOnce(Return(DataTypeManager::CONFIGURED)); | 311 .WillOnce(Return(DataTypeManager::CONFIGURED)); |
311 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION)) | 312 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION)) |
312 .Times(1); | 313 .Times(1); |
313 migrator.MigrateTypes(to_migrate); | 314 migrator.MigrateTypes(to_migrate); |
314 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet()); | 315 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet()); |
315 EXPECT_EQ(BackendMigrator::IDLE, migrator.state()); | 316 EXPECT_EQ(BackendMigrator::IDLE, migrator.state()); |
316 } | 317 } |
317 | 318 |
318 }; // namespace browser_sync | 319 }; // namespace browser_sync |
OLD | NEW |