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

Side by Side Diff: chrome/browser/chromeos/login/screens/update_screen_browsertest.cc

Issue 296713003: Make sure that OOBE resumes at the update screen when update was done. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed the test. Created 6 years, 6 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 | « chrome/browser/chromeos/login/screens/update_screen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/chromeos/login/screens/mock_error_screen.h" 9 #include "chrome/browser/chromeos/login/screens/mock_error_screen.h"
8 #include "chrome/browser/chromeos/login/screens/mock_screen_observer.h" 10 #include "chrome/browser/chromeos/login/screens/mock_screen_observer.h"
9 #include "chrome/browser/chromeos/login/screens/update_screen.h" 11 #include "chrome/browser/chromeos/login/screens/update_screen.h"
12 #include "chrome/browser/chromeos/login/startup_utils.h"
10 #include "chrome/browser/chromeos/login/test/wizard_in_process_browser_test.h" 13 #include "chrome/browser/chromeos/login/test/wizard_in_process_browser_test.h"
11 #include "chrome/browser/chromeos/login/wizard_controller.h" 14 #include "chrome/browser/chromeos/login/wizard_controller.h"
12 #include "chrome/browser/chromeos/net/network_portal_detector.h" 15 #include "chrome/browser/chromeos/net/network_portal_detector.h"
13 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" 16 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
17 #include "chrome/common/pref_names.h"
14 #include "chromeos/chromeos_switches.h" 18 #include "chromeos/chromeos_switches.h"
15 #include "chromeos/dbus/fake_dbus_thread_manager.h" 19 #include "chromeos/dbus/fake_dbus_thread_manager.h"
16 #include "chromeos/dbus/fake_update_engine_client.h" 20 #include "chromeos/dbus/fake_update_engine_client.h"
17 #include "testing/gmock/include/gmock/gmock.h" 21 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
19 23
20 using ::testing::AnyNumber; 24 using ::testing::AnyNumber;
21 using ::testing::AtLeast; 25 using ::testing::AtLeast;
22 using ::testing::Exactly; 26 using ::testing::Exactly;
23 using ::testing::Invoke; 27 using ::testing::Invoke;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 status.status = UpdateEngineClient::UPDATE_STATUS_VERIFYING; 174 status.status = UpdateEngineClient::UPDATE_STATUS_VERIFYING;
171 update_screen_->UpdateStatusChanged(status); 175 update_screen_->UpdateStatusChanged(status);
172 176
173 status.status = UpdateEngineClient::UPDATE_STATUS_FINALIZING; 177 status.status = UpdateEngineClient::UPDATE_STATUS_FINALIZING;
174 update_screen_->UpdateStatusChanged(status); 178 update_screen_->UpdateStatusChanged(status);
175 179
176 status.status = UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; 180 status.status = UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT;
177 update_screen_->UpdateStatusChanged(status); 181 update_screen_->UpdateStatusChanged(status);
178 // UpdateStatusChanged(status) calls RebootAfterUpdate(). 182 // UpdateStatusChanged(status) calls RebootAfterUpdate().
179 EXPECT_EQ(1, fake_update_engine_client_->reboot_after_update_call_count()); 183 EXPECT_EQ(1, fake_update_engine_client_->reboot_after_update_call_count());
184 // Check that OOBE will resume back at this screen.
185 base::MessageLoop::current()->RunUntilIdle();
186 EXPECT_FALSE(StartupUtils::IsOobeCompleted());
187 EXPECT_EQ(update_screen_->GetName(),
188 g_browser_process->local_state()->GetString(prefs::kOobeScreenPending));
180 } 189 }
181 190
182 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestErrorIssuingUpdateCheck) { 191 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestErrorIssuingUpdateCheck) {
183 // First, cancel the update that is already in progress. 192 // First, cancel the update that is already in progress.
184 EXPECT_CALL(*mock_screen_observer_, 193 EXPECT_CALL(*mock_screen_observer_,
185 OnExit(ScreenObserver::UPDATE_NOUPDATE)) 194 OnExit(ScreenObserver::UPDATE_NOUPDATE))
186 .Times(1); 195 .Times(1);
187 update_screen_->CancelUpdate(); 196 update_screen_->CancelUpdate();
188 197
189 fake_update_engine_client_->set_update_check_result( 198 fake_update_engine_client_->set_update_check_result(
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); 398 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED);
390 EXPECT_CALL(*mock_screen_observer_, 399 EXPECT_CALL(*mock_screen_observer_,
391 OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE)) 400 OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE))
392 .Times(1); 401 .Times(1);
393 402
394 update_screen_->OnConnectToNetworkRequested(kStubEthernetServicePath); 403 update_screen_->OnConnectToNetworkRequested(kStubEthernetServicePath);
395 base::MessageLoop::current()->RunUntilIdle(); 404 base::MessageLoop::current()->RunUntilIdle();
396 } 405 }
397 406
398 } // namespace chromeos 407 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/update_screen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698