OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/timer/hi_res_timer_manager.h" | 5 #include "base/timer/hi_res_timer_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/power_monitor/power_monitor.h" | 11 #include "base/power_monitor/power_monitor.h" |
12 #include "base/power_monitor/power_monitor_device_source.h" | 12 #include "base/power_monitor/power_monitor_device_source.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "build/build_config.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 | 18 |
18 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
19 TEST(HiResTimerManagerTest, ToggleOnOff) { | 20 TEST(HiResTimerManagerTest, ToggleOnOff) { |
20 // The power monitor creates Window to receive power notifications from | 21 // The power monitor creates Window to receive power notifications from |
21 // Windows, which makes this test flaky if you run while the machine | 22 // Windows, which makes this test flaky if you run while the machine |
22 // goes in or out of AC power. | 23 // goes in or out of AC power. |
23 base::MessageLoop loop(base::MessageLoop::TYPE_UI); | 24 base::MessageLoop loop(base::MessageLoop::TYPE_UI); |
(...skipping 27 matching lines...) Expand all Loading... |
51 EXPECT_TRUE(manager.hi_res_clock_available()); | 52 EXPECT_TRUE(manager.hi_res_clock_available()); |
52 EXPECT_TRUE(base::Time::IsHighResolutionTimerInUse()); | 53 EXPECT_TRUE(base::Time::IsHighResolutionTimerInUse()); |
53 | 54 |
54 // De-activate the high resolution timer. | 55 // De-activate the high resolution timer. |
55 base::Time::ActivateHighResolutionTimer(false); | 56 base::Time::ActivateHighResolutionTimer(false); |
56 } | 57 } |
57 } | 58 } |
58 #endif // defined(OS_WIN) | 59 #endif // defined(OS_WIN) |
59 | 60 |
60 } // namespace base | 61 } // namespace base |
OLD | NEW |