OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/event_router_forwarder.h" | 5 #include "chrome/browser/extensions/event_router_forwarder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/power_monitor/power_monitor.h" | 9 #include "base/power_monitor/power_monitor.h" |
10 #include "base/power_monitor/power_monitor_device_source.h" | 10 #include "base/power_monitor/power_monitor_device_source.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 EventRouterForwarderTest() | 90 EventRouterForwarderTest() |
91 : ui_thread_(BrowserThread::UI, &message_loop_), | 91 : ui_thread_(BrowserThread::UI, &message_loop_), |
92 io_thread_(BrowserThread::IO), | 92 io_thread_(BrowserThread::IO), |
93 profile_manager_( | 93 profile_manager_( |
94 TestingBrowserProcess::GetGlobal()) { | 94 TestingBrowserProcess::GetGlobal()) { |
95 #if defined(OS_MACOSX) | 95 #if defined(OS_MACOSX) |
96 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); | 96 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); |
97 #endif | 97 #endif |
98 scoped_ptr<base::PowerMonitorSource> power_monitor_source( | 98 scoped_ptr<base::PowerMonitorSource> power_monitor_source( |
99 new base::PowerMonitorDeviceSource()); | 99 new base::PowerMonitorDeviceSource()); |
100 dummy.reset(new base::PowerMonitor(power_monitor_source.Pass())); | 100 dummy.reset(base::PowerMonitor::Create(power_monitor_source.Pass())); |
101 } | 101 } |
102 | 102 |
103 virtual void SetUp() { | 103 virtual void SetUp() { |
104 ASSERT_TRUE(profile_manager_.SetUp()); | 104 ASSERT_TRUE(profile_manager_.SetUp()); |
105 | 105 |
106 // Inject a BrowserProcess with a ProfileManager. | 106 // Inject a BrowserProcess with a ProfileManager. |
107 ASSERT_TRUE(io_thread_.Start()); | 107 ASSERT_TRUE(io_thread_.Start()); |
108 | 108 |
109 profile1_ = profile_manager_.CreateTestingProfile("one"); | 109 profile1_ = profile_manager_.CreateTestingProfile("one"); |
110 profile2_ = profile_manager_.CreateTestingProfile("two"); | 110 profile2_ = profile_manager_.CreateTestingProfile("two"); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 GURL url; | 285 GURL url; |
286 EXPECT_CALL(*event_router.get(), | 286 EXPECT_CALL(*event_router.get(), |
287 CallEventRouter(profile1_, kExt, kEventName, NULL, url)); | 287 CallEventRouter(profile1_, kExt, kEventName, NULL, url)); |
288 EXPECT_CALL(*event_router.get(), CallEventRouter(profile2_, _, _, _, _)) | 288 EXPECT_CALL(*event_router.get(), CallEventRouter(profile2_, _, _, _, _)) |
289 .Times(0); | 289 .Times(0); |
290 DispatchEventToExtension(event_router.get(), kExt, kEventName, profile1_, | 290 DispatchEventToExtension(event_router.get(), kExt, kEventName, profile1_, |
291 false, url); | 291 false, url); |
292 } | 292 } |
293 | 293 |
294 } // namespace extensions | 294 } // namespace extensions |
OLD | NEW |