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

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

Issue 2825963003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/extensions (Closed)
Patch Set: Created 3 years, 8 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // EventRouterForwarder would not increase coverage. 166 // EventRouterForwarder would not increase coverage.
167 TEST_F(EventRouterForwarderTest, BroadcastRendererIO) { 167 TEST_F(EventRouterForwarderTest, BroadcastRendererIO) {
168 scoped_refptr<MockEventRouterForwarder> event_router( 168 scoped_refptr<MockEventRouterForwarder> event_router(
169 new MockEventRouterForwarder); 169 new MockEventRouterForwarder);
170 GURL url; 170 GURL url;
171 EXPECT_CALL(*event_router, CallEventRouter(profile1_, "", kHistogramValue, 171 EXPECT_CALL(*event_router, CallEventRouter(profile1_, "", kHistogramValue,
172 kEventName, profile1_, url)); 172 kEventName, profile1_, url));
173 EXPECT_CALL(*event_router, CallEventRouter(profile2_, "", kHistogramValue, 173 EXPECT_CALL(*event_router, CallEventRouter(profile2_, "", kHistogramValue,
174 kEventName, profile2_, url)); 174 kEventName, profile2_, url));
175 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 175 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
176 base::Bind(&BroadcastEventToRenderers, 176 base::BindOnce(&BroadcastEventToRenderers,
177 base::Unretained(event_router.get()), 177 base::Unretained(event_router.get()),
178 kHistogramValue, kEventName, url)); 178 kHistogramValue, kEventName, url));
179 179
180 // Wait for IO thread's message loop to be processed 180 // Wait for IO thread's message loop to be processed
181 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( 181 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
182 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get())); 182 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get()));
183 ASSERT_TRUE(helper->Run()); 183 ASSERT_TRUE(helper->Run());
184 184
185 base::RunLoop().RunUntilIdle(); 185 base::RunLoop().RunUntilIdle();
186 } 186 }
187 187
188 TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) { 188 TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 GURL url; 291 GURL url;
292 EXPECT_CALL(*event_router, CallEventRouter(profile1_, kExt, kHistogramValue, 292 EXPECT_CALL(*event_router, CallEventRouter(profile1_, kExt, kHistogramValue,
293 kEventName, NULL, url)); 293 kEventName, NULL, url));
294 EXPECT_CALL(*event_router, CallEventRouter(profile2_, _, _, _, _, _)) 294 EXPECT_CALL(*event_router, CallEventRouter(profile2_, _, _, _, _, _))
295 .Times(0); 295 .Times(0);
296 DispatchEventToExtension(event_router.get(), kExt, kHistogramValue, 296 DispatchEventToExtension(event_router.get(), kExt, kHistogramValue,
297 kEventName, profile1_, false, url); 297 kEventName, profile1_, false, url);
298 } 298 }
299 299
300 } // namespace extensions 300 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/event_router_forwarder.cc ('k') | chrome/browser/extensions/extension_action_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698