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

Side by Side Diff: ash/system/chromeos/power/power_status_unittest.cc

Issue 32443004: ash: Improve low-battery notification thresholds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apply review feedback: update comment Created 7 years, 2 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 "ash/system/chromeos/power/power_status.h" 5 #include "ash/system/chromeos/power/power_status.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 PowerStatus::SplitTimeIntoHoursAndMinutes( 123 PowerStatus::SplitTimeIntoHoursAndMinutes(
124 base::TimeDelta::FromSeconds(3600 + 60), &hours, &minutes); 124 base::TimeDelta::FromSeconds(3600 + 60), &hours, &minutes);
125 EXPECT_EQ(1, hours); 125 EXPECT_EQ(1, hours);
126 EXPECT_EQ(1, minutes); 126 EXPECT_EQ(1, minutes);
127 127
128 PowerStatus::SplitTimeIntoHoursAndMinutes( 128 PowerStatus::SplitTimeIntoHoursAndMinutes(
129 base::TimeDelta::FromSeconds(7 * 3600 + 23 * 60), &hours, &minutes); 129 base::TimeDelta::FromSeconds(7 * 3600 + 23 * 60), &hours, &minutes);
130 EXPECT_EQ(7, hours); 130 EXPECT_EQ(7, hours);
131 EXPECT_EQ(23, minutes); 131 EXPECT_EQ(23, minutes);
132
133 // Check that minutes are rounded.
134 PowerStatus::SplitTimeIntoHoursAndMinutes(
135 base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 30), &hours, &minutes);
136 EXPECT_EQ(2, hours);
137 EXPECT_EQ(4, minutes);
138
139 PowerStatus::SplitTimeIntoHoursAndMinutes(
140 base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 29), &hours, &minutes);
141 EXPECT_EQ(2, hours);
142 EXPECT_EQ(3, minutes);
132 } 143 }
133 144
134 } // namespace internal 145 } // namespace internal
135 } // namespace ash 146 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/chromeos/power/power_status_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698