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

Side by Side Diff: chrome/browser/chromeos/system/automatic_reboot_manager_unittest.cc

Issue 385263004: Get rid of some uses of CreateIntegerValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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
OLDNEW
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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 void AutomaticRebootManagerBasicTest::SetUptimeLimit( 403 void AutomaticRebootManagerBasicTest::SetUptimeLimit(
404 const base::TimeDelta& limit, 404 const base::TimeDelta& limit,
405 bool expect_reboot) { 405 bool expect_reboot) {
406 uptime_limit_ = limit; 406 uptime_limit_ = limit;
407 if (limit == base::TimeDelta()) { 407 if (limit == base::TimeDelta()) {
408 local_state_.RemoveManagedPref(prefs::kUptimeLimit); 408 local_state_.RemoveManagedPref(prefs::kUptimeLimit);
409 } else { 409 } else {
410 local_state_.SetManagedPref( 410 local_state_.SetManagedPref(
411 prefs::kUptimeLimit, 411 prefs::kUptimeLimit,
412 base::Value::CreateIntegerValue(limit.InSeconds())); 412 new base::FundamentalValue(static_cast<int>(limit.InSeconds())));
413 } 413 }
414 task_runner_->RunUntilIdle(); 414 task_runner_->RunUntilIdle();
415 EXPECT_EQ(expect_reboot ? 1 : 0, 415 EXPECT_EQ(expect_reboot ? 1 : 0,
416 power_manager_client_->num_request_restart_calls()); 416 power_manager_client_->num_request_restart_calls());
417 } 417 }
418 418
419 void AutomaticRebootManagerBasicTest::NotifyUpdateRebootNeeded() { 419 void AutomaticRebootManagerBasicTest::NotifyUpdateRebootNeeded() {
420 SetUpdateStatusNeedReboot(); 420 SetUpdateStatusNeedReboot();
421 automatic_reboot_manager_->UpdateStatusChanged( 421 automatic_reboot_manager_->UpdateStatusChanged(
422 update_engine_client_->GetLastStatus()); 422 update_engine_client_->GetLastStatus());
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 INSTANTIATE_TEST_CASE_P( 2053 INSTANTIATE_TEST_CASE_P(
2054 AutomaticRebootManagerTestInstance, 2054 AutomaticRebootManagerTestInstance,
2055 AutomaticRebootManagerTest, 2055 AutomaticRebootManagerTest,
2056 ::testing::Values( 2056 ::testing::Values(
2057 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN, 2057 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_LOGIN_SCREEN,
2058 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION, 2058 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_KIOSK_APP_SESSION,
2059 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION)); 2059 AUTOMATIC_REBOOT_MANAGER_TEST_SCENARIO_NON_KIOSK_APP_SESSION));
2060 2060
2061 } // namespace system 2061 } // namespace system
2062 } // namespace chromeos 2062 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698