| OLD | NEW |
| 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 "chrome/browser/chromeos/login/screens/update_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/update_screen.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 status.status = UpdateEngineClient::UPDATE_STATUS_FINALIZING; | 175 status.status = UpdateEngineClient::UPDATE_STATUS_FINALIZING; |
| 176 update_screen_->UpdateStatusChanged(status); | 176 update_screen_->UpdateStatusChanged(status); |
| 177 | 177 |
| 178 status.status = UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; | 178 status.status = UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT; |
| 179 update_screen_->UpdateStatusChanged(status); | 179 update_screen_->UpdateStatusChanged(status); |
| 180 // UpdateStatusChanged(status) calls RebootAfterUpdate(). | 180 // UpdateStatusChanged(status) calls RebootAfterUpdate(). |
| 181 EXPECT_EQ(1, fake_update_engine_client_->reboot_after_update_call_count()); | 181 EXPECT_EQ(1, fake_update_engine_client_->reboot_after_update_call_count()); |
| 182 // Check that OOBE will resume back at this screen. | 182 // Check that OOBE will resume back at this screen. |
| 183 base::RunLoop().RunUntilIdle(); | 183 base::RunLoop().RunUntilIdle(); |
| 184 EXPECT_FALSE(StartupUtils::IsOobeCompleted()); | 184 EXPECT_FALSE(StartupUtils::IsOobeCompleted()); |
| 185 EXPECT_EQ(update_screen_->GetName(), | 185 EXPECT_EQ( |
| 186 update_screen_->screen_id(), |
| 186 g_browser_process->local_state()->GetString(prefs::kOobeScreenPending)); | 187 g_browser_process->local_state()->GetString(prefs::kOobeScreenPending)); |
| 187 } | 188 } |
| 188 | 189 |
| 189 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestErrorIssuingUpdateCheck) { | 190 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestErrorIssuingUpdateCheck) { |
| 190 // First, cancel the update that is already in progress. | 191 // First, cancel the update that is already in progress. |
| 191 EXPECT_CALL(*mock_base_screen_delegate_, | 192 EXPECT_CALL(*mock_base_screen_delegate_, |
| 192 OnExit(_, BaseScreenDelegate::UPDATE_NOUPDATE, _)).Times(1); | 193 OnExit(_, BaseScreenDelegate::UPDATE_NOUPDATE, _)).Times(1); |
| 193 update_screen_->CancelUpdate(); | 194 update_screen_->CancelUpdate(); |
| 194 | 195 |
| 195 fake_update_engine_client_->set_update_check_result( | 196 fake_update_engine_client_->set_update_check_result( |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); | 402 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); |
| 402 EXPECT_CALL(*mock_base_screen_delegate_, | 403 EXPECT_CALL(*mock_base_screen_delegate_, |
| 403 OnExit(_, BaseScreenDelegate::UPDATE_ERROR_CHECKING_FOR_UPDATE, | 404 OnExit(_, BaseScreenDelegate::UPDATE_ERROR_CHECKING_FOR_UPDATE, |
| 404 _)).Times(1); | 405 _)).Times(1); |
| 405 | 406 |
| 406 update_screen_->OnConnectRequested(); | 407 update_screen_->OnConnectRequested(); |
| 407 base::RunLoop().RunUntilIdle(); | 408 base::RunLoop().RunUntilIdle(); |
| 408 } | 409 } |
| 409 | 410 |
| 410 } // namespace chromeos | 411 } // namespace chromeos |
| OLD | NEW |