OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/system/automatic_reboot_manager.h" | 5 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 void AutomaticRebootManagerBasicTest::NotifyUpdateRebootNeeded() { | 420 void AutomaticRebootManagerBasicTest::NotifyUpdateRebootNeeded() { |
421 SetUpdateStatusNeedReboot(); | 421 SetUpdateStatusNeedReboot(); |
422 automatic_reboot_manager_->UpdateStatusChanged( | 422 automatic_reboot_manager_->UpdateStatusChanged( |
423 update_engine_client_->GetLastStatus()); | 423 update_engine_client_->GetLastStatus()); |
424 task_runner_->RunUntilIdle(); | 424 task_runner_->RunUntilIdle(); |
425 EXPECT_EQ(0, power_manager_client_->num_request_restart_calls()); | 425 EXPECT_EQ(0, power_manager_client_->num_request_restart_calls()); |
426 } | 426 } |
427 | 427 |
428 void AutomaticRebootManagerBasicTest::NotifyResumed(bool expect_reboot) { | 428 void AutomaticRebootManagerBasicTest::NotifyResumed(bool expect_reboot) { |
429 automatic_reboot_manager_->SystemResumed(base::TimeDelta::FromHours(1)); | 429 automatic_reboot_manager_->SuspendDone(base::TimeDelta::FromHours(1)); |
430 task_runner_->RunUntilIdle(); | 430 task_runner_->RunUntilIdle(); |
431 EXPECT_EQ(expect_reboot ? 1 : 0, | 431 EXPECT_EQ(expect_reboot ? 1 : 0, |
432 power_manager_client_->num_request_restart_calls()); | 432 power_manager_client_->num_request_restart_calls()); |
433 } | 433 } |
434 | 434 |
435 void AutomaticRebootManagerBasicTest::NotifyTerminating(bool expect_reboot) { | 435 void AutomaticRebootManagerBasicTest::NotifyTerminating(bool expect_reboot) { |
436 automatic_reboot_manager_->Observe( | 436 automatic_reboot_manager_->Observe( |
437 chrome::NOTIFICATION_APP_TERMINATING, | 437 chrome::NOTIFICATION_APP_TERMINATING, |
438 content::Source<AutomaticRebootManagerBasicTest>(this), | 438 content::Source<AutomaticRebootManagerBasicTest>(this), |
439 content::NotificationService::NoDetails()); | 439 content::NotificationService::NoDetails()); |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 INSTANTIATE_TEST_CASE_P( | 2054 INSTANTIATE_TEST_CASE_P( |
2055 AutomaticRebootManagerTestInstance, | 2055 AutomaticRebootManagerTestInstance, |
2056 AutomaticRebootManagerTest, | 2056 AutomaticRebootManagerTest, |
2057 ::testing::Values( | 2057 ::testing::Values( |
2058 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, | 2058 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, |
2059 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, | 2059 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, |
2060 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); | 2060 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); |
2061 | 2061 |
2062 } // namespace system | 2062 } // namespace system |
2063 } // namespace chromeos | 2063 } // namespace chromeos |
OLD | NEW |