Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/chromeos/login/reset_browsertest.cc

Issue 614643003: Rollback feature is taken out of the flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/reset_screen_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
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);
44 } 43 }
45 44
46 // LoginManagerTest overrides: 45 // LoginManagerTest overrides:
47 virtual void SetUpInProcessBrowserTestFixture() override { 46 virtual void SetUpInProcessBrowserTestFixture() override {
48 scoped_ptr<DBusThreadManagerSetter> dbus_setter = 47 scoped_ptr<DBusThreadManagerSetter> dbus_setter =
49 chromeos::DBusThreadManager::GetSetterForTesting(); 48 chromeos::DBusThreadManager::GetSetterForTesting();
50 session_manager_client_ = new FakeSessionManagerClient; 49 session_manager_client_ = new FakeSessionManagerClient;
51 dbus_setter->SetSessionManagerClient( 50 dbus_setter->SetSessionManagerClient(
52 scoped_ptr<SessionManagerClient>(session_manager_client_)); 51 scoped_ptr<SessionManagerClient>(session_manager_client_));
53 power_manager_client_ = new FakePowerManagerClient; 52 power_manager_client_ = new FakePowerManagerClient;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 FakePowerManagerClient* power_manager_client_; 97 FakePowerManagerClient* power_manager_client_;
99 }; 98 };
100 99
101 class ResetFirstAfterBootTest : public ResetTest { 100 class ResetFirstAfterBootTest : public ResetTest {
102 public: 101 public:
103 virtual ~ResetFirstAfterBootTest() {} 102 virtual ~ResetFirstAfterBootTest() {}
104 103
105 virtual void SetUpCommandLine(base::CommandLine* command_line) override { 104 virtual void SetUpCommandLine(base::CommandLine* command_line) override {
106 LoginManagerTest::SetUpCommandLine(command_line); 105 LoginManagerTest::SetUpCommandLine(command_line);
107 command_line->AppendSwitch(switches::kFirstExecAfterBoot); 106 command_line->AppendSwitch(switches::kFirstExecAfterBoot);
108 command_line->AppendSwitch(switches::kEnableRollbackOption);
109 } 107 }
110 }; 108 };
111 109
112 IN_PROC_BROWSER_TEST_F(ResetTest, PRE_ShowAndCancel) { 110 IN_PROC_BROWSER_TEST_F(ResetTest, PRE_ShowAndCancel) {
113 RegisterSomeUser(); 111 RegisterSomeUser();
114 } 112 }
115 113
116 IN_PROC_BROWSER_TEST_F(ResetTest, ShowAndCancel) { 114 IN_PROC_BROWSER_TEST_F(ResetTest, ShowAndCancel) {
117 JSExpect("!!document.querySelector('#reset.hidden')"); 115 JSExpect("!!document.querySelector('#reset.hidden')");
118 InvokeResetScreen(); 116 InvokeResetScreen();
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 UpdateEngineClient::Status ready_for_reboot_status; 250 UpdateEngineClient::Status ready_for_reboot_status;
253 ready_for_reboot_status.status = 251 ready_for_reboot_status.status =
254 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; 252 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT;
255 update_engine_client_->NotifyObserversThatStatusChanged( 253 update_engine_client_->NotifyObserversThatStatusChanged(
256 ready_for_reboot_status); 254 ready_for_reboot_status);
257 EXPECT_EQ(1, power_manager_client_->num_request_restart_calls()); 255 EXPECT_EQ(1, power_manager_client_->num_request_restart_calls());
258 } 256 }
259 257
260 258
261 } // namespace chromeos 259 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/reset_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698