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

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

Issue 8483003: Callback API Change: Reimplement Bind(); support IgnoreResult, full currying, and use less types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years 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) 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 PluginService::GetInstance()->OpenChannelToNpapiPlugin( 240 PluginService::GetInstance()->OpenChannelToNpapiPlugin(
241 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, client); 241 0, 0, GURL(), GURL(), kNPAPITestPluginMimeType, client);
242 } 242 }
243 243
244 IN_PROC_BROWSER_TEST_F( 244 IN_PROC_BROWSER_TEST_F(
245 PluginServiceTest, CancelBeforeSentOpenChannelToPluginProcessHost) { 245 PluginServiceTest, CancelBeforeSentOpenChannelToPluginProcessHost) {
246 ::testing::StrictMock<MockCanceledBeforeSentPluginProcessHostClient> 246 ::testing::StrictMock<MockCanceledBeforeSentPluginProcessHostClient>
247 mock_client(browser()->profile()->GetResourceContext()); 247 mock_client(browser()->profile()->GetResourceContext());
248 BrowserThread::PostTask( 248 BrowserThread::PostTask(
249 BrowserThread::IO, FROM_HERE, 249 BrowserThread::IO, FROM_HERE,
250 base::Bind(OpenChannel, &mock_client)); 250 base::Bind(&OpenChannel, &mock_client));
251 ui_test_utils::RunMessageLoop(); 251 ui_test_utils::RunMessageLoop();
252 EXPECT_TRUE(mock_client.get_resource_context_called()); 252 EXPECT_TRUE(mock_client.get_resource_context_called());
253 EXPECT_TRUE(mock_client.set_plugin_info_called()); 253 EXPECT_TRUE(mock_client.set_plugin_info_called());
254 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); 254 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called());
255 } 255 }
256 256
257 class MockCanceledAfterSentPluginProcessHostClient 257 class MockCanceledAfterSentPluginProcessHostClient
258 : public MockCanceledBeforeSentPluginProcessHostClient { 258 : public MockCanceledBeforeSentPluginProcessHostClient {
259 public: 259 public:
260 MockCanceledAfterSentPluginProcessHostClient( 260 MockCanceledAfterSentPluginProcessHostClient(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 DISALLOW_COPY_AND_ASSIGN(MockCanceledAfterSentPluginProcessHostClient); 292 DISALLOW_COPY_AND_ASSIGN(MockCanceledAfterSentPluginProcessHostClient);
293 }; 293 };
294 294
295 // Should not attempt to open a channel, since it should be canceled early on. 295 // Should not attempt to open a channel, since it should be canceled early on.
296 IN_PROC_BROWSER_TEST_F( 296 IN_PROC_BROWSER_TEST_F(
297 PluginServiceTest, CancelAfterSentOpenChannelToPluginProcessHost) { 297 PluginServiceTest, CancelAfterSentOpenChannelToPluginProcessHost) {
298 ::testing::StrictMock<MockCanceledAfterSentPluginProcessHostClient> 298 ::testing::StrictMock<MockCanceledAfterSentPluginProcessHostClient>
299 mock_client(browser()->profile()->GetResourceContext()); 299 mock_client(browser()->profile()->GetResourceContext());
300 BrowserThread::PostTask( 300 BrowserThread::PostTask(
301 BrowserThread::IO, FROM_HERE, 301 BrowserThread::IO, FROM_HERE,
302 base::Bind(OpenChannel, &mock_client)); 302 base::Bind(&OpenChannel, &mock_client));
303 ui_test_utils::RunMessageLoop(); 303 ui_test_utils::RunMessageLoop();
304 EXPECT_TRUE(mock_client.get_resource_context_called()); 304 EXPECT_TRUE(mock_client.get_resource_context_called());
305 EXPECT_TRUE(mock_client.set_plugin_info_called()); 305 EXPECT_TRUE(mock_client.set_plugin_info_called());
306 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); 306 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called());
307 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); 307 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called());
308 } 308 }
309 309
310 } // namespace 310 } // namespace
OLDNEW
« no previous file with comments | « content/browser/debugger/worker_devtools_manager.cc ('k') | content/renderer/render_widget_fullscreen_pepper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698