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

Unified Diff: base/timer/hi_res_timer_manager_unittest.cc

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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 | « base/time/time_win_unittest.cc ('k') | base/timer/hi_res_timer_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/hi_res_timer_manager_unittest.cc
diff --git a/base/timer/hi_res_timer_manager_unittest.cc b/base/timer/hi_res_timer_manager_unittest.cc
index 5475a91446bdef369b8d2974cbb17b48f170499e..7304f89e7e3080e1c36375d5b8b9fe29dc586a17 100644
--- a/base/timer/hi_res_timer_manager_unittest.cc
+++ b/base/timer/hi_res_timer_manager_unittest.cc
@@ -13,46 +13,7 @@
namespace base {
-#if defined(OS_WIN)
TEST(HiResTimerManagerTest, ToggleOnOff) {
- // The power monitor creates Window to receive power notifications from
- // Windows, which makes this test flaky if you run while the machine
- // goes in or out of AC power.
- base::MessageLoop loop(base::MessageLoop::TYPE_UI);
- scoped_ptr<base::PowerMonitorSource> power_monitor_source(
- new base::PowerMonitorDeviceSource());
- scoped_ptr<base::PowerMonitor> power_monitor(
- new base::PowerMonitor(power_monitor_source.Pass()));
-
- HighResolutionTimerManager manager;
- // Simulate a on-AC power event to get to a known initial state.
- manager.OnPowerStateChange(false);
-
- // Loop a few times to test power toggling.
- for (int times = 0; times != 3; ++times) {
- // The manager has the high resolution clock enabled now.
- EXPECT_TRUE(manager.hi_res_clock_available());
- // But the Time class has it off, because it hasn't been activated.
- EXPECT_FALSE(base::Time::IsHighResolutionTimerInUse());
-
- // Activate the high resolution timer.
- base::Time::ActivateHighResolutionTimer(true);
- EXPECT_TRUE(base::Time::IsHighResolutionTimerInUse());
-
- // Simulate a on-battery power event.
- manager.OnPowerStateChange(true);
- EXPECT_FALSE(manager.hi_res_clock_available());
- EXPECT_FALSE(base::Time::IsHighResolutionTimerInUse());
-
- // Back to on-AC power.
- manager.OnPowerStateChange(false);
- EXPECT_TRUE(manager.hi_res_clock_available());
- EXPECT_TRUE(base::Time::IsHighResolutionTimerInUse());
-
- // De-activate the high resolution timer.
- base::Time::ActivateHighResolutionTimer(false);
- }
}
-#endif // defined(OS_WIN)
} // namespace base
« no previous file with comments | « base/time/time_win_unittest.cc ('k') | base/timer/hi_res_timer_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698