| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "chromeos/dbus/dbus_thread_manager.h" | 13 #include "chromeos/dbus/dbus_thread_manager.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "third_party/cros_system_api/dbus/service_constants.h" | 15 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 16 | 16 |
| 17 namespace ash { | 17 namespace ash { |
| 18 namespace internal { | |
| 19 | |
| 20 namespace { | 18 namespace { |
| 21 | 19 |
| 22 class TestObserver : public PowerStatus::Observer { | 20 class TestObserver : public PowerStatus::Observer { |
| 23 public: | 21 public: |
| 24 TestObserver() : power_changed_count_(0) {} | 22 TestObserver() : power_changed_count_(0) {} |
| 25 virtual ~TestObserver() {} | 23 virtual ~TestObserver() {} |
| 26 | 24 |
| 27 int power_changed_count() const { return power_changed_count_; } | 25 int power_changed_count() const { return power_changed_count_; } |
| 28 | 26 |
| 29 // PowerStatus::Observer overrides: | 27 // PowerStatus::Observer overrides: |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 30), &hours, &minutes); | 133 base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 30), &hours, &minutes); |
| 136 EXPECT_EQ(2, hours); | 134 EXPECT_EQ(2, hours); |
| 137 EXPECT_EQ(4, minutes); | 135 EXPECT_EQ(4, minutes); |
| 138 | 136 |
| 139 PowerStatus::SplitTimeIntoHoursAndMinutes( | 137 PowerStatus::SplitTimeIntoHoursAndMinutes( |
| 140 base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 29), &hours, &minutes); | 138 base::TimeDelta::FromSeconds(2 * 3600 + 3 * 60 + 29), &hours, &minutes); |
| 141 EXPECT_EQ(2, hours); | 139 EXPECT_EQ(2, hours); |
| 142 EXPECT_EQ(3, minutes); | 140 EXPECT_EQ(3, minutes); |
| 143 } | 141 } |
| 144 | 142 |
| 145 } // namespace internal | |
| 146 } // namespace ash | 143 } // namespace ash |
| OLD | NEW |