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

Side by Side Diff: chrome/browser/extensions/event_router_forwarder_unittest.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Killing Nits Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.h" 8 #include "base/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/test/thread_test_helper.h" 11 #include "base/test/thread_test_helper.h"
11 #include "chrome/browser/profiles/profile_manager.h" 12 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/test/base/testing_browser_process.h" 13 #include "chrome/test/base/testing_browser_process.h"
13 #include "chrome/test/base/testing_profile.h" 14 #include "chrome/test/base/testing_profile.h"
14 #include "chrome/test/base/testing_profile_manager.h" 15 #include "chrome/test/base/testing_profile_manager.h"
15 #include "content/public/test/test_browser_thread.h" 16 #include "content/public/test/test_browser_thread.h"
16 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 #include "url/gurl.h" 19 #include "url/gurl.h"
19 20
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } // namespace 86 } // namespace
86 87
87 class EventRouterForwarderTest : public testing::Test { 88 class EventRouterForwarderTest : public testing::Test {
88 protected: 89 protected:
89 EventRouterForwarderTest() 90 EventRouterForwarderTest()
90 : ui_thread_(BrowserThread::UI, &message_loop_), 91 : ui_thread_(BrowserThread::UI, &message_loop_),
91 io_thread_(BrowserThread::IO), 92 io_thread_(BrowserThread::IO),
92 profile_manager_( 93 profile_manager_(
93 TestingBrowserProcess::GetGlobal()) { 94 TestingBrowserProcess::GetGlobal()) {
94 #if defined(OS_MACOSX) 95 #if defined(OS_MACOSX)
95 base::PowerMonitor::AllocateSystemIOPorts(); 96 base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
96 #endif 97 #endif
97 dummy.reset(new base::PowerMonitor); 98 dummy.reset(new base::PowerMonitor);
98 } 99 }
99 100
100 virtual void SetUp() { 101 virtual void SetUp() {
101 ASSERT_TRUE(profile_manager_.SetUp()); 102 ASSERT_TRUE(profile_manager_.SetUp());
102 103
103 // Inject a BrowserProcess with a ProfileManager. 104 // Inject a BrowserProcess with a ProfileManager.
104 ASSERT_TRUE(io_thread_.Start()); 105 ASSERT_TRUE(io_thread_.Start());
105 106
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 GURL url; 280 GURL url;
280 EXPECT_CALL(*event_router.get(), 281 EXPECT_CALL(*event_router.get(),
281 CallEventRouter(profile1_, kExt, kEventName, NULL, url)); 282 CallEventRouter(profile1_, kExt, kEventName, NULL, url));
282 EXPECT_CALL(*event_router.get(), CallEventRouter(profile2_, _, _, _, _)) 283 EXPECT_CALL(*event_router.get(), CallEventRouter(profile2_, _, _, _, _))
283 .Times(0); 284 .Times(0);
284 DispatchEventToExtension(event_router.get(), kExt, kEventName, profile1_, 285 DispatchEventToExtension(event_router.get(), kExt, kEventName, profile1_,
285 false, url); 286 false, url);
286 } 287 }
287 288
288 } // namespace extensions 289 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698