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