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.h" | 8 #include "base/message_loop.h" |
9 #include "base/system_monitor/system_monitor.h" | 9 #include "base/system_monitor/system_monitor.h" |
10 #include "base/test/thread_test_helper.h" | 10 #include "base/test/thread_test_helper.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 } // namespace | 85 } // namespace |
86 | 86 |
87 class EventRouterForwarderTest : public testing::Test { | 87 class EventRouterForwarderTest : public testing::Test { |
88 protected: | 88 protected: |
89 EventRouterForwarderTest() | 89 EventRouterForwarderTest() |
90 : ui_thread_(BrowserThread::UI, &message_loop_), | 90 : ui_thread_(BrowserThread::UI, &message_loop_), |
91 io_thread_(BrowserThread::IO), | 91 io_thread_(BrowserThread::IO), |
92 profile_manager_( | 92 profile_manager_( |
93 static_cast<TestingBrowserProcess*>(g_browser_process)) { | 93 TestingBrowserProcess::GetGlobal()) { |
94 #if defined(OS_MACOSX) | 94 #if defined(OS_MACOSX) |
95 base::SystemMonitor::AllocateSystemIOPorts(); | 95 base::SystemMonitor::AllocateSystemIOPorts(); |
96 #endif | 96 #endif |
97 dummy.reset(new base::SystemMonitor); | 97 dummy.reset(new base::SystemMonitor); |
98 } | 98 } |
99 | 99 |
100 virtual void SetUp() { | 100 virtual void SetUp() { |
101 ASSERT_TRUE(profile_manager_.SetUp()); | 101 ASSERT_TRUE(profile_manager_.SetUp()); |
102 | 102 |
103 // Inject a BrowserProcess with a ProfileManager. | 103 // Inject a BrowserProcess with a ProfileManager. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 GURL url; | 280 GURL url; |
281 EXPECT_CALL(*event_router, | 281 EXPECT_CALL(*event_router, |
282 CallEventRouter(profile1_, kExt, kEventName, NULL, url)); | 282 CallEventRouter(profile1_, kExt, kEventName, NULL, url)); |
283 EXPECT_CALL(*event_router, | 283 EXPECT_CALL(*event_router, |
284 CallEventRouter(profile2_, _, _, _, _)).Times(0); | 284 CallEventRouter(profile2_, _, _, _, _)).Times(0); |
285 DispatchEventToExtension(event_router.get(), kExt, kEventName, profile1_, | 285 DispatchEventToExtension(event_router.get(), kExt, kEventName, profile1_, |
286 false, url); | 286 false, url); |
287 } | 287 } |
288 | 288 |
289 } // namespace extensions | 289 } // namespace extensions |
OLD | NEW |