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

Side by Side Diff: content/browser/plugin_service_browsertest.cc

Issue 8536037: base::Bind: Low-hanging fruit conversions of NewRunnableFunction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix 4. Created 9 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
« no previous file with comments | « content/browser/plugin_process_host_mac.cc ('k') | content/browser/user_metrics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/plugin_service.h" 5 #include "content/browser/plugin_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 BrowserThread::PostTaskAndReply( 161 BrowserThread::PostTaskAndReply(
162 BrowserThread::FILE, FROM_HERE, 162 BrowserThread::FILE, FROM_HERE,
163 base::Bind(&DoNothing), 163 base::Bind(&DoNothing),
164 base::Bind(&QuitUIMessageLoopFromIOThread)); 164 base::Bind(&QuitUIMessageLoopFromIOThread));
165 } 165 }
166 166
167 // Should not attempt to open a channel, since it should be canceled early on. 167 // Should not attempt to open a channel, since it should be canceled early on.
168 IN_PROC_BROWSER_TEST_F(PluginServiceTest, CancelOpenChannelToPluginService) { 168 IN_PROC_BROWSER_TEST_F(PluginServiceTest, CancelOpenChannelToPluginService) {
169 ::testing::StrictMock<MockCanceledPluginServiceClient> mock_client( 169 ::testing::StrictMock<MockCanceledPluginServiceClient> mock_client(
170 browser()->profile()->GetResourceContext()); 170 browser()->profile()->GetResourceContext());
171 BrowserThread::PostTask( 171 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
172 BrowserThread::IO, FROM_HERE, 172 base::Bind(OpenChannelAndThenCancel, &mock_client));
173 NewRunnableFunction(OpenChannelAndThenCancel, &mock_client));
174 ui_test_utils::RunMessageLoop(); 173 ui_test_utils::RunMessageLoop();
175 EXPECT_TRUE(mock_client.get_resource_context_called()); 174 EXPECT_TRUE(mock_client.get_resource_context_called());
176 } 175 }
177 176
178 class MockCanceledBeforeSentPluginProcessHostClient 177 class MockCanceledBeforeSentPluginProcessHostClient
179 : public MockCanceledPluginServiceClient { 178 : public MockCanceledPluginServiceClient {
180 public: 179 public:
181 MockCanceledBeforeSentPluginProcessHostClient( 180 MockCanceledBeforeSentPluginProcessHostClient(
182 const content::ResourceContext& context) 181 const content::ResourceContext& context)
183 : MockCanceledPluginServiceClient(context), 182 : MockCanceledPluginServiceClient(context),
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 BrowserThread::IO, FROM_HERE, 301 BrowserThread::IO, FROM_HERE,
303 base::Bind(OpenChannel, &mock_client)); 302 base::Bind(OpenChannel, &mock_client));
304 ui_test_utils::RunMessageLoop(); 303 ui_test_utils::RunMessageLoop();
305 EXPECT_TRUE(mock_client.get_resource_context_called()); 304 EXPECT_TRUE(mock_client.get_resource_context_called());
306 EXPECT_TRUE(mock_client.set_plugin_info_called()); 305 EXPECT_TRUE(mock_client.set_plugin_info_called());
307 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); 306 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called());
308 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); 307 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called());
309 } 308 }
310 309
311 } // namespace 310 } // namespace
OLDNEW
« no previous file with comments | « content/browser/plugin_process_host_mac.cc ('k') | content/browser/user_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698