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

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

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 base::Bind( 165 base::Bind(
166 &BroadcastEventToRenderers, base::Unretained(event_router.get()), 166 &BroadcastEventToRenderers, base::Unretained(event_router.get()),
167 kEventName, url)); 167 kEventName, url));
168 168
169 // Wait for IO thread's message loop to be processed 169 // Wait for IO thread's message loop to be processed
170 scoped_refptr<base::ThreadTestHelper> helper( 170 scoped_refptr<base::ThreadTestHelper> helper(
171 new base::ThreadTestHelper( 171 new base::ThreadTestHelper(
172 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 172 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
173 ASSERT_TRUE(helper->Run()); 173 ASSERT_TRUE(helper->Run());
174 174
175 MessageLoop::current()->RunAllPending(); 175 MessageLoop::current()->RunUntilIdle();
176 } 176 }
177 177
178 TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) { 178 TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) {
179 scoped_refptr<MockEventRouterForwarder> event_router( 179 scoped_refptr<MockEventRouterForwarder> event_router(
180 new MockEventRouterForwarder); 180 new MockEventRouterForwarder);
181 using ::testing::_; 181 using ::testing::_;
182 GURL url; 182 GURL url;
183 EXPECT_CALL(*event_router, 183 EXPECT_CALL(*event_router,
184 CallEventRouter(profile1_, "", kEventName, profile1_, url)); 184 CallEventRouter(profile1_, "", kEventName, profile1_, url));
185 EXPECT_CALL(*event_router, 185 EXPECT_CALL(*event_router,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698