OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/backup_rollback_controller.h" | 5 #include "components/sync_driver/backup_rollback_controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "components/sync_driver/signin_manager_wrapper.h" | 14 #include "components/sync_driver/signin_manager_wrapper.h" |
15 #include "components/sync_driver/sync_driver_features.h" | |
16 #include "components/sync_driver/sync_driver_switches.h" | 15 #include "components/sync_driver/sync_driver_switches.h" |
17 #include "components/sync_driver/sync_prefs.h" | 16 #include "components/sync_driver/sync_prefs.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
20 | 19 |
21 using ::testing::Return; | 20 using ::testing::Return; |
22 | 21 |
23 namespace { | 22 namespace { |
24 | 23 |
25 #if BUILDFLAG(ENABLE_PRE_SYNC_BACKUP) | 24 #if defined(ENABLE_PRE_SYNC_BACKUP) |
26 | 25 |
27 class MockSigninManagerWrapper : public SigninManagerWrapper { | 26 class MockSigninManagerWrapper : public SigninManagerWrapper { |
28 public: | 27 public: |
29 MockSigninManagerWrapper() : SigninManagerWrapper(NULL) {} | 28 MockSigninManagerWrapper() : SigninManagerWrapper(NULL) {} |
30 | 29 |
31 MOCK_CONST_METHOD0(GetEffectiveUsername, std::string()); | 30 MOCK_CONST_METHOD0(GetEffectiveUsername, std::string()); |
32 }; | 31 }; |
33 | 32 |
34 class FakeSyncPrefs : public sync_driver::SyncPrefs { | 33 class FakeSyncPrefs : public sync_driver::SyncPrefs { |
35 public: | 34 public: |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 EXPECT_FALSE(controller_->StartRollback()); | 138 EXPECT_FALSE(controller_->StartRollback()); |
140 EXPECT_EQ(0, fake_prefs_.GetRemainingRollbackTries()); | 139 EXPECT_EQ(0, fake_prefs_.GetRemainingRollbackTries()); |
141 | 140 |
142 PumpLoop(); | 141 PumpLoop(); |
143 EXPECT_FALSE(rollback_started_); | 142 EXPECT_FALSE(rollback_started_); |
144 } | 143 } |
145 | 144 |
146 #endif | 145 #endif |
147 | 146 |
148 } // anonymous namespace | 147 } // anonymous namespace |
OLD | NEW |