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

Unified Diff: content/child/power_monitor_broadcast_source_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 | « 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 b665e90bbb05a4494e2782ec78f261e3c2edebad..5b472afdee2f724df3a3bd60ce0540bc4115a3cc 100644
--- a/content/child/power_monitor_broadcast_source_unittest.cc
+++ b/content/child/power_monitor_broadcast_source_unittest.cc
@@ -14,19 +14,19 @@ class PowerMonitorBroadcastSourceTest : public testing::Test {
protected:
PowerMonitorBroadcastSourceTest() {
power_monitor_source_ = new PowerMonitorBroadcastSource();
- power_monitor_.reset(new base::PowerMonitor(
- scoped_ptr<base::PowerMonitorSource>(power_monitor_source_)));
+ base::PowerMonitor::Initialize(
+ 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 @@ TEST_F(PowerMonitorBroadcastSourceTest, PowerMessageReceiveBroadcast) {
source()->GetMessageFilter();
base::PowerMonitorTestObserver observer;
- monitor()->AddObserver(&observer);
+ base::PowerMonitor::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