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

Unified Diff: base/power_monitor/power_monitor_unittest.cc

Issue 179923006: Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win64 fixes Created 6 years, 9 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/power_monitor/power_monitor_source.cc ('k') | base/timer/hi_res_timer_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/power_monitor/power_monitor_unittest.cc
diff --git a/base/power_monitor/power_monitor_unittest.cc b/base/power_monitor/power_monitor_unittest.cc
index 5f7b531206f2adcea05f91ffea8db81782f8a9c1..4f95fc7f8e980bd8a95a2bb7e0057fb9b3e528ad 100644
--- a/base/power_monitor/power_monitor_unittest.cc
+++ b/base/power_monitor/power_monitor_unittest.cc
@@ -12,17 +12,17 @@ class PowerMonitorTest : public testing::Test {
protected:
PowerMonitorTest() {
power_monitor_source_ = new PowerMonitorTestSource();
- power_monitor_.reset(new PowerMonitor(
- scoped_ptr<PowerMonitorSource>(power_monitor_source_)));
+ PowerMonitor::Initialize(
+ scoped_ptr<PowerMonitorSource>(power_monitor_source_));
}
- virtual ~PowerMonitorTest() {};
+ virtual ~PowerMonitorTest() {
+ PowerMonitor::ShutdownForTesting();
+ };
PowerMonitorTestSource* source() { return power_monitor_source_; }
- PowerMonitor* monitor() { return power_monitor_.get(); }
private:
PowerMonitorTestSource* power_monitor_source_;
- scoped_ptr<PowerMonitor> power_monitor_;
DISALLOW_COPY_AND_ASSIGN(PowerMonitorTest);
};
@@ -34,7 +34,7 @@ TEST_F(PowerMonitorTest, PowerNotifications) {
PowerMonitorTestObserver observers[kObservers];
for (int index = 0; index < kObservers; ++index)
- monitor()->AddObserver(&observers[index]);
+ PowerMonitor::AddObserver(&observers[index]);
// Sending resume when not suspended should have no effect.
source()->GenerateResumeEvent();
« no previous file with comments | « base/power_monitor/power_monitor_source.cc ('k') | base/timer/hi_res_timer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698