| 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 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 user_manager_enabler_(mock_user_manager_), | 309 user_manager_enabler_(mock_user_manager_), |
| 310 power_manager_client_(NULL), | 310 power_manager_client_(NULL), |
| 311 update_engine_client_(NULL) { | 311 update_engine_client_(NULL) { |
| 312 } | 312 } |
| 313 | 313 |
| 314 AutomaticRebootManagerBasicTest::~AutomaticRebootManagerBasicTest() { | 314 AutomaticRebootManagerBasicTest::~AutomaticRebootManagerBasicTest() { |
| 315 } | 315 } |
| 316 | 316 |
| 317 void AutomaticRebootManagerBasicTest::SetUp() { | 317 void AutomaticRebootManagerBasicTest::SetUp() { |
| 318 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 318 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 319 const base::FilePath& temp_dir = temp_dir_.path(); | 319 const base::FilePath& temp_dir = temp_dir_.GetPath(); |
| 320 const base::FilePath uptime_file = temp_dir.Append("uptime"); | 320 const base::FilePath uptime_file = temp_dir.Append("uptime"); |
| 321 uptime_provider()->set_uptime_file_path(uptime_file); | 321 uptime_provider()->set_uptime_file_path(uptime_file); |
| 322 ASSERT_FALSE(base::WriteFile(uptime_file, NULL, 0)); | 322 ASSERT_FALSE(base::WriteFile(uptime_file, NULL, 0)); |
| 323 update_reboot_needed_uptime_file_ = | 323 update_reboot_needed_uptime_file_ = |
| 324 temp_dir.Append("update_reboot_needed_uptime"); | 324 temp_dir.Append("update_reboot_needed_uptime"); |
| 325 ASSERT_FALSE(base::WriteFile(update_reboot_needed_uptime_file_, NULL, 0)); | 325 ASSERT_FALSE(base::WriteFile(update_reboot_needed_uptime_file_, NULL, 0)); |
| 326 ASSERT_TRUE(PathService::Override(chromeos::FILE_UPTIME, uptime_file)); | 326 ASSERT_TRUE(PathService::Override(chromeos::FILE_UPTIME, uptime_file)); |
| 327 ASSERT_TRUE(PathService::Override(chromeos::FILE_UPDATE_REBOOT_NEEDED_UPTIME, | 327 ASSERT_TRUE(PathService::Override(chromeos::FILE_UPDATE_REBOOT_NEEDED_UPTIME, |
| 328 update_reboot_needed_uptime_file_)); | 328 update_reboot_needed_uptime_file_)); |
| 329 | 329 |
| (...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2277 INSTANTIATE_TEST_CASE_P( | 2277 INSTANTIATE_TEST_CASE_P( |
| 2278 AutomaticRebootManagerTestInstance, | 2278 AutomaticRebootManagerTestInstance, |
| 2279 AutomaticRebootManagerTest, | 2279 AutomaticRebootManagerTest, |
| 2280 ::testing::Values( | 2280 ::testing::Values( |
| 2281 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, | 2281 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, |
| 2282 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, | 2282 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, |
| 2283 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); | 2283 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); |
| 2284 | 2284 |
| 2285 } // namespace system | 2285 } // namespace system |
| 2286 } // namespace chromeos | 2286 } // namespace chromeos |
| OLD | NEW |