| 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 "chrome/browser/sync/backup_rollback_controller.h" | 5 #include "chrome/browser/sync/backup_rollback_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class BackupRollbackControllerTest : public testing::Test { | 44 class BackupRollbackControllerTest : public testing::Test { |
| 45 public: | 45 public: |
| 46 void ControllerCallback(bool start_backup) { | 46 void ControllerCallback(bool start_backup) { |
| 47 if (start_backup) | 47 if (start_backup) |
| 48 backup_started_ = true; | 48 backup_started_ = true; |
| 49 else | 49 else |
| 50 rollback_started_ = true; | 50 rollback_started_ = true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 virtual void SetUp() override { | 54 void SetUp() override { |
| 55 backup_started_ = false; | 55 backup_started_ = false; |
| 56 rollback_started_ = false; | 56 rollback_started_ = false; |
| 57 | 57 |
| 58 EXPECT_CALL(signin_wrapper_, GetEffectiveUsername()) | 58 EXPECT_CALL(signin_wrapper_, GetEffectiveUsername()) |
| 59 .WillRepeatedly(Return("")); | 59 .WillRepeatedly(Return("")); |
| 60 | 60 |
| 61 controller_.reset(new browser_sync::BackupRollbackController( | 61 controller_.reset(new browser_sync::BackupRollbackController( |
| 62 &fake_prefs_, &signin_wrapper_, | 62 &fake_prefs_, &signin_wrapper_, |
| 63 base::Bind(&BackupRollbackControllerTest::ControllerCallback, | 63 base::Bind(&BackupRollbackControllerTest::ControllerCallback, |
| 64 base::Unretained(this), true), | 64 base::Unretained(this), true), |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 EXPECT_EQ(0, fake_prefs_.GetRemainingRollbackTries()); | 136 EXPECT_EQ(0, fake_prefs_.GetRemainingRollbackTries()); |
| 137 | 137 |
| 138 PumpLoop(); | 138 PumpLoop(); |
| 139 EXPECT_FALSE(rollback_started_); | 139 EXPECT_FALSE(rollback_started_); |
| 140 } | 140 } |
| 141 | 141 |
| 142 #endif | 142 #endif |
| 143 | 143 |
| 144 } // anonymous namespace | 144 } // anonymous namespace |
| 145 | 145 |
| OLD | NEW |