| OLD | NEW |
| 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 "content/browser/plugin_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 virtual ResourceContext* GetResourceContext() OVERRIDE { | 53 virtual ResourceContext* GetResourceContext() OVERRIDE { |
| 54 return context_; | 54 return context_; |
| 55 } | 55 } |
| 56 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE {} | 56 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE {} |
| 57 virtual void OnSentPluginChannelRequest() OVERRIDE {} | 57 virtual void OnSentPluginChannelRequest() OVERRIDE {} |
| 58 | 58 |
| 59 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE { | 59 virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE { |
| 60 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 60 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 61 ASSERT_TRUE(set_plugin_info_called_); | 61 ASSERT_TRUE(set_plugin_info_called_); |
| 62 ASSERT_TRUE(!channel_); | 62 ASSERT_TRUE(!channel_); |
| 63 channel_ = new IPC::Channel(handle, IPC::Channel::MODE_CLIENT, this); | 63 channel_ = IPC::Channel::CreateClient(handle, this).release(); |
| 64 ASSERT_TRUE(channel_->Connect()); | 64 ASSERT_TRUE(channel_->Connect()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual void SetPluginInfo(const WebPluginInfo& info) OVERRIDE { | 67 virtual void SetPluginInfo(const WebPluginInfo& info) OVERRIDE { |
| 68 ASSERT_TRUE(info.mime_types.size()); | 68 ASSERT_TRUE(info.mime_types.size()); |
| 69 ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); | 69 ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); |
| 70 set_plugin_info_called_ = true; | 70 set_plugin_info_called_ = true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual void OnError() OVERRIDE { | 73 virtual void OnError() OVERRIDE { |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 BrowserThread::IO, FROM_HERE, | 368 BrowserThread::IO, FROM_HERE, |
| 369 base::Bind(&OpenChannel, &mock_client)); | 369 base::Bind(&OpenChannel, &mock_client)); |
| 370 RunMessageLoop(); | 370 RunMessageLoop(); |
| 371 EXPECT_TRUE(mock_client.get_resource_context_called()); | 371 EXPECT_TRUE(mock_client.get_resource_context_called()); |
| 372 EXPECT_TRUE(mock_client.set_plugin_info_called()); | 372 EXPECT_TRUE(mock_client.set_plugin_info_called()); |
| 373 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); | 373 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); |
| 374 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); | 374 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace content | 377 } // namespace content |
| OLD | NEW |