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

Unified Diff: content/child/power_monitor_broadcast_source_unittest.cc

Issue 226263008: Revert of Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « content/child/child_thread.cc ('k') | content/gpu/gpu_watchdog_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/power_monitor_broadcast_source_unittest.cc
diff --git a/content/child/power_monitor_broadcast_source_unittest.cc b/content/child/power_monitor_broadcast_source_unittest.cc
index 5b472afdee2f724df3a3bd60ce0540bc4115a3cc..b665e90bbb05a4494e2782ec78f261e3c2edebad 100644
--- a/content/child/power_monitor_broadcast_source_unittest.cc
+++ b/content/child/power_monitor_broadcast_source_unittest.cc
@@ -14,19 +14,19 @@
protected:
PowerMonitorBroadcastSourceTest() {
power_monitor_source_ = new PowerMonitorBroadcastSource();
- base::PowerMonitor::Initialize(
- scoped_ptr<base::PowerMonitorSource>(power_monitor_source_));
+ power_monitor_.reset(new base::PowerMonitor(
+ scoped_ptr<base::PowerMonitorSource>(power_monitor_source_)));
}
- virtual ~PowerMonitorBroadcastSourceTest() {
- base::PowerMonitor::ShutdownForTesting();
- }
+ virtual ~PowerMonitorBroadcastSourceTest() {}
PowerMonitorBroadcastSource* source() { return power_monitor_source_; }
+ base::PowerMonitor* monitor() { return power_monitor_.get(); }
base::MessageLoop message_loop_;
private:
PowerMonitorBroadcastSource* power_monitor_source_;
+ scoped_ptr<base::PowerMonitor> power_monitor_;
DISALLOW_COPY_AND_ASSIGN(PowerMonitorBroadcastSourceTest);
};
@@ -36,7 +36,7 @@
source()->GetMessageFilter();
base::PowerMonitorTestObserver observer;
- base::PowerMonitor::AddObserver(&observer);
+ monitor()->AddObserver(&observer);
PowerMonitorMsg_Suspend suspend_msg;
PowerMonitorMsg_Resume resume_msg;
« no previous file with comments | « content/child/child_thread.cc ('k') | content/gpu/gpu_watchdog_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698