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

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

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/power_monitor/power_monitor.h" 10 #include "base/power_monitor/power_monitor.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 EXPECT_CALL(*event_router.get(), 178 EXPECT_CALL(*event_router.get(),
179 CallEventRouter(profile2_, "", kHistogramValue, kEventName, 179 CallEventRouter(profile2_, "", kHistogramValue, kEventName,
180 profile2_, url)); 180 profile2_, url));
181 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 181 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
182 base::Bind(&BroadcastEventToRenderers, 182 base::Bind(&BroadcastEventToRenderers,
183 base::Unretained(event_router.get()), 183 base::Unretained(event_router.get()),
184 kHistogramValue, kEventName, url)); 184 kHistogramValue, kEventName, url));
185 185
186 // Wait for IO thread's message loop to be processed 186 // Wait for IO thread's message loop to be processed
187 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( 187 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
188 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); 188 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get()));
189 ASSERT_TRUE(helper->Run()); 189 ASSERT_TRUE(helper->Run());
190 190
191 base::RunLoop().RunUntilIdle(); 191 base::RunLoop().RunUntilIdle();
192 } 192 }
193 193
194 TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) { 194 TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) {
195 scoped_refptr<MockEventRouterForwarder> event_router( 195 scoped_refptr<MockEventRouterForwarder> event_router(
196 new MockEventRouterForwarder); 196 new MockEventRouterForwarder);
197 using ::testing::_; 197 using ::testing::_;
198 GURL url; 198 GURL url;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 EXPECT_CALL( 306 EXPECT_CALL(
307 *event_router.get(), 307 *event_router.get(),
308 CallEventRouter(profile1_, kExt, kHistogramValue, kEventName, NULL, url)); 308 CallEventRouter(profile1_, kExt, kHistogramValue, kEventName, NULL, url));
309 EXPECT_CALL(*event_router.get(), CallEventRouter(profile2_, _, _, _, _, _)) 309 EXPECT_CALL(*event_router.get(), CallEventRouter(profile2_, _, _, _, _, _))
310 .Times(0); 310 .Times(0);
311 DispatchEventToExtension(event_router.get(), kExt, kHistogramValue, 311 DispatchEventToExtension(event_router.get(), kExt, kHistogramValue,
312 kEventName, profile1_, false, url); 312 kEventName, profile1_, false, url);
313 } 313 }
314 314
315 } // namespace extensions 315 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698