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 "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 Loading... |
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 |
OLD | NEW |