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

Unified Diff: base/hi_res_timer_manager_unittest.cc

Issue 18063004: Move timing files into base/time, install forwarding headers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios Created 7 years, 6 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 | « base/hi_res_timer_manager_posix.cc ('k') | base/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/hi_res_timer_manager_unittest.cc
diff --git a/base/hi_res_timer_manager_unittest.cc b/base/hi_res_timer_manager_unittest.cc
deleted file mode 100644
index b523284ed9261c417239c90e5ce631ddb085ef9b..0000000000000000000000000000000000000000
--- a/base/hi_res_timer_manager_unittest.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/hi_res_timer_manager.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "base/message_loop.h"
-#include "base/power_monitor/power_monitor.h"
-#include "base/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(OS_WIN)
-// http://crbug.com/114048
-TEST(HiResTimerManagerTest, DISABLED_ToggleOnOff) {
- base::MessageLoop loop;
- scoped_ptr<base::PowerMonitor> power_monitor(new base::PowerMonitor());
- HighResolutionTimerManager manager;
-
- // At this point, we don't know if the high resolution timers are on or off,
- // it depends on what system the tests are running on (for example, if this
- // test is running on a laptop/battery, then the PowerMonitor would have
- // already set the PowerState to battery power; but if we're running on a
- // desktop, then the PowerState will be non-battery power). Simulate a power
- // level change to get to a deterministic state.
- manager.OnPowerStateChange(/* on_battery */ false);
-
- // Loop a few times to test power toggling.
- for (int loop = 2; loop >= 0; --loop) {
- // 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(/* on_battery */ true);
- EXPECT_FALSE(manager.hi_res_clock_available());
- EXPECT_FALSE(base::Time::IsHighResolutionTimerInUse());
-
- // Simulate a off-battery power event.
- manager.OnPowerStateChange(/* on_battery */ 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)
« no previous file with comments | « base/hi_res_timer_manager_posix.cc ('k') | base/hi_res_timer_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698