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

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

Issue 463053002: Flag for rollback feature switched to covering by default state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests adapted for flag add. Created 6 years, 4 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 | Annotate | Revision Log
« 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 21 matching lines...) Expand all
32 32
33 class ResetTest : public LoginManagerTest { 33 class ResetTest : public LoginManagerTest {
34 public: 34 public:
35 ResetTest() : LoginManagerTest(false), 35 ResetTest() : LoginManagerTest(false),
36 update_engine_client_(NULL), 36 update_engine_client_(NULL),
37 session_manager_client_(NULL), 37 session_manager_client_(NULL),
38 power_manager_client_(NULL) { 38 power_manager_client_(NULL) {
39 } 39 }
40 virtual ~ResetTest() {} 40 virtual ~ResetTest() {}
41 41
42 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE {
43 LoginManagerTest::SetUpCommandLine(command_line);
44 command_line->AppendSwitch(switches::kEnableRollbackOption);
45 }
46
42 // LoginManagerTest overrides: 47 // LoginManagerTest overrides:
43 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 48 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
44 FakeDBusThreadManager* dbus_manager = new FakeDBusThreadManager; 49 FakeDBusThreadManager* dbus_manager = new FakeDBusThreadManager;
45 dbus_manager->SetFakeClients(); 50 dbus_manager->SetFakeClients();
46 session_manager_client_ = new FakeSessionManagerClient; 51 session_manager_client_ = new FakeSessionManagerClient;
47 dbus_manager->SetSessionManagerClient( 52 dbus_manager->SetSessionManagerClient(
48 scoped_ptr<SessionManagerClient>(session_manager_client_)); 53 scoped_ptr<SessionManagerClient>(session_manager_client_));
49 power_manager_client_ = new FakePowerManagerClient; 54 power_manager_client_ = new FakePowerManagerClient;
50 dbus_manager->SetPowerManagerClient( 55 dbus_manager->SetPowerManagerClient(
51 scoped_ptr<PowerManagerClient>(power_manager_client_)); 56 scoped_ptr<PowerManagerClient>(power_manager_client_));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 FakePowerManagerClient* power_manager_client_; 89 FakePowerManagerClient* power_manager_client_;
85 }; 90 };
86 91
87 class ResetFirstAfterBootTest : public ResetTest { 92 class ResetFirstAfterBootTest : public ResetTest {
88 public: 93 public:
89 virtual ~ResetFirstAfterBootTest() {} 94 virtual ~ResetFirstAfterBootTest() {}
90 95
91 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { 96 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE {
92 LoginManagerTest::SetUpCommandLine(command_line); 97 LoginManagerTest::SetUpCommandLine(command_line);
93 command_line->AppendSwitch(switches::kFirstExecAfterBoot); 98 command_line->AppendSwitch(switches::kFirstExecAfterBoot);
99 command_line->AppendSwitch(switches::kEnableRollbackOption);
94 } 100 }
95 }; 101 };
96 102
97 IN_PROC_BROWSER_TEST_F(ResetTest, PRE_ShowAndCancel) { 103 IN_PROC_BROWSER_TEST_F(ResetTest, PRE_ShowAndCancel) {
98 RegisterSomeUser(); 104 RegisterSomeUser();
99 } 105 }
100 106
101 IN_PROC_BROWSER_TEST_F(ResetTest, ShowAndCancel) { 107 IN_PROC_BROWSER_TEST_F(ResetTest, ShowAndCancel) {
102 JSExpect("!!document.querySelector('#reset.hidden')"); 108 JSExpect("!!document.querySelector('#reset.hidden')");
103 EXPECT_EQ(0, update_engine_client_->can_rollback_call_count()); 109 EXPECT_EQ(0, update_engine_client_->can_rollback_call_count());
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 UpdateEngineClient::Status ready_for_reboot_status; 254 UpdateEngineClient::Status ready_for_reboot_status;
249 ready_for_reboot_status.status = 255 ready_for_reboot_status.status =
250 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; 256 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT;
251 update_engine_client_->NotifyObserversThatStatusChanged( 257 update_engine_client_->NotifyObserversThatStatusChanged(
252 ready_for_reboot_status); 258 ready_for_reboot_status);
253 EXPECT_EQ(1, power_manager_client_->num_request_restart_calls()); 259 EXPECT_EQ(1, power_manager_client_->num_request_restart_calls());
254 } 260 }
255 261
256 262
257 } // namespace chromeos 263 } // 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