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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/power/power_status_unittest.cc
diff --git a/ash/system/chromeos/power/power_status_unittest.cc b/ash/system/chromeos/power/power_status_unittest.cc
index baf4997ecf419f820b25dc3294e38b6c0b0ba36c..ba9d2c11308effd7d272a4d6bc8e5c9fa4870eed 100644
--- a/ash/system/chromeos/power/power_status_unittest.cc
+++ b/ash/system/chromeos/power/power_status_unittest.cc
@@ -129,6 +129,17 @@ TEST_F(PowerStatusTest, SplitTimeIntoHoursAndMinutes) {
base::TimeDelta::FromSeconds(7 * 3600 + 23 * 60), &hours, &minutes);
EXPECT_EQ(7, hours);
EXPECT_EQ(23, minutes);
+
+ // Check that minutes are rounded.
+ PowerStatus::SplitTimeIntoHoursAndMinutes(
+ base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 30), &hours, &minutes);
+ EXPECT_EQ(2, hours);
+ EXPECT_EQ(4, minutes);
+
+ PowerStatus::SplitTimeIntoHoursAndMinutes(
+ base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 29), &hours, &minutes);
+ EXPECT_EQ(2, hours);
+ EXPECT_EQ(3, minutes);
}
} // namespace internal
« 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