| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chromeos/login/login_manager_test.h" | 9 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 10 #include "chrome/browser/chromeos/login/startup_utils.h" | 10 #include "chrome/browser/chromeos/login/startup_utils.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 class ResetTest : public LoginManagerTest { | 32 class ResetTest : public LoginManagerTest { |
| 33 public: | 33 public: |
| 34 ResetTest() : LoginManagerTest(false), | 34 ResetTest() : LoginManagerTest(false), |
| 35 update_engine_client_(NULL), | 35 update_engine_client_(NULL), |
| 36 session_manager_client_(NULL), | 36 session_manager_client_(NULL), |
| 37 power_manager_client_(NULL) { | 37 power_manager_client_(NULL) { |
| 38 } | 38 } |
| 39 virtual ~ResetTest() {} | 39 virtual ~ResetTest() {} |
| 40 | 40 |
| 41 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { | 41 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 42 LoginManagerTest::SetUpCommandLine(command_line); | 42 LoginManagerTest::SetUpCommandLine(command_line); |
| 43 command_line->AppendSwitch(switches::kEnableRollbackOption); | 43 command_line->AppendSwitch(switches::kEnableRollbackOption); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // LoginManagerTest overrides: | 46 // LoginManagerTest overrides: |
| 47 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 47 virtual void SetUpInProcessBrowserTestFixture() override { |
| 48 scoped_ptr<DBusThreadManagerSetter> dbus_setter = | 48 scoped_ptr<DBusThreadManagerSetter> dbus_setter = |
| 49 chromeos::DBusThreadManager::GetSetterForTesting(); | 49 chromeos::DBusThreadManager::GetSetterForTesting(); |
| 50 session_manager_client_ = new FakeSessionManagerClient; | 50 session_manager_client_ = new FakeSessionManagerClient; |
| 51 dbus_setter->SetSessionManagerClient( | 51 dbus_setter->SetSessionManagerClient( |
| 52 scoped_ptr<SessionManagerClient>(session_manager_client_)); | 52 scoped_ptr<SessionManagerClient>(session_manager_client_)); |
| 53 power_manager_client_ = new FakePowerManagerClient; | 53 power_manager_client_ = new FakePowerManagerClient; |
| 54 dbus_setter->SetPowerManagerClient( | 54 dbus_setter->SetPowerManagerClient( |
| 55 scoped_ptr<PowerManagerClient>(power_manager_client_)); | 55 scoped_ptr<PowerManagerClient>(power_manager_client_)); |
| 56 update_engine_client_ = new FakeUpdateEngineClient; | 56 update_engine_client_ = new FakeUpdateEngineClient; |
| 57 dbus_setter->SetUpdateEngineClient( | 57 dbus_setter->SetUpdateEngineClient( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 FakeUpdateEngineClient* update_engine_client_; | 97 FakeUpdateEngineClient* update_engine_client_; |
| 98 FakeSessionManagerClient* session_manager_client_; | 98 FakeSessionManagerClient* session_manager_client_; |
| 99 FakePowerManagerClient* power_manager_client_; | 99 FakePowerManagerClient* power_manager_client_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 class ResetFirstAfterBootTest : public ResetTest { | 102 class ResetFirstAfterBootTest : public ResetTest { |
| 103 public: | 103 public: |
| 104 virtual ~ResetFirstAfterBootTest() {} | 104 virtual ~ResetFirstAfterBootTest() {} |
| 105 | 105 |
| 106 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { | 106 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 107 LoginManagerTest::SetUpCommandLine(command_line); | 107 LoginManagerTest::SetUpCommandLine(command_line); |
| 108 command_line->AppendSwitch(switches::kFirstExecAfterBoot); | 108 command_line->AppendSwitch(switches::kFirstExecAfterBoot); |
| 109 command_line->AppendSwitch(switches::kEnableRollbackOption); | 109 command_line->AppendSwitch(switches::kEnableRollbackOption); |
| 110 } | 110 } |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 IN_PROC_BROWSER_TEST_F(ResetTest, PRE_ShowAndCancel) { | 113 IN_PROC_BROWSER_TEST_F(ResetTest, PRE_ShowAndCancel) { |
| 114 RegisterSomeUser(); | 114 RegisterSomeUser(); |
| 115 } | 115 } |
| 116 | 116 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 UpdateEngineClient::Status ready_for_reboot_status; | 252 UpdateEngineClient::Status ready_for_reboot_status; |
| 253 ready_for_reboot_status.status = | 253 ready_for_reboot_status.status = |
| 254 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; | 254 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; |
| 255 update_engine_client_->NotifyObserversThatStatusChanged( | 255 update_engine_client_->NotifyObserversThatStatusChanged( |
| 256 ready_for_reboot_status); | 256 ready_for_reboot_status); |
| 257 EXPECT_EQ(1, power_manager_client_->num_request_restart_calls()); | 257 EXPECT_EQ(1, power_manager_client_->num_request_restart_calls()); |
| 258 } | 258 } |
| 259 | 259 |
| 260 | 260 |
| 261 } // namespace chromeos | 261 } // namespace chromeos |
| OLD | NEW |