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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 471 |
472 if (is_user_logged_in_ || expect_reboot) | 472 if (is_user_logged_in_ || expect_reboot) |
473 VerifyLoginScreenIdleTimerIsStopped(); | 473 VerifyLoginScreenIdleTimerIsStopped(); |
474 else | 474 else |
475 VerifyLoginScreenIdleTimerIsRunning(); | 475 VerifyLoginScreenIdleTimerIsRunning(); |
476 } | 476 } |
477 | 477 |
478 bool AutomaticRebootManagerBasicTest::ReadUpdateRebootNeededUptimeFromFile( | 478 bool AutomaticRebootManagerBasicTest::ReadUpdateRebootNeededUptimeFromFile( |
479 base::TimeDelta* uptime) { | 479 base::TimeDelta* uptime) { |
480 std::string contents; | 480 std::string contents; |
481 if (!file_util::ReadFileToString(update_reboot_needed_uptime_file_, | 481 if (!base::ReadFileToString(update_reboot_needed_uptime_file_, &contents)) { |
482 &contents)) { | |
483 return false; | 482 return false; |
484 } | 483 } |
485 double seconds; | 484 double seconds; |
486 if (!base::StringToDouble(contents.substr(0, contents.find(' ')), &seconds) || | 485 if (!base::StringToDouble(contents.substr(0, contents.find(' ')), &seconds) || |
487 seconds < 0.0) { | 486 seconds < 0.0) { |
488 return false; | 487 return false; |
489 } | 488 } |
490 *uptime = base::TimeDelta::FromMilliseconds(seconds * 1000.0); | 489 *uptime = base::TimeDelta::FromMilliseconds(seconds * 1000.0); |
491 return true; | 490 return true; |
492 } | 491 } |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 INSTANTIATE_TEST_CASE_P( | 2052 INSTANTIATE_TEST_CASE_P( |
2054 AutomaticRebootManagerTestInstance, | 2053 AutomaticRebootManagerTestInstance, |
2055 AutomaticRebootManagerTest, | 2054 AutomaticRebootManagerTest, |
2056 ::testing::Values( | 2055 ::testing::Values( |
2057 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, | 2056 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, |
2058 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, | 2057 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, |
2059 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); | 2058 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); |
2060 | 2059 |
2061 } // namespace system | 2060 } // namespace system |
2062 } // namespace chromeos | 2061 } // namespace chromeos |
OLD | NEW |