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/location.h" | 10 #include "base/location.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 int ID() override { return 42; } | 54 int ID() override { return 42; } |
55 bool OffTheRecord() override { return false; } | 55 bool OffTheRecord() override { return false; } |
56 ResourceContext* GetResourceContext() override { return context_; } | 56 ResourceContext* GetResourceContext() override { return context_; } |
57 void OnFoundPluginProcessHost(PluginProcessHost* host) override {} | 57 void OnFoundPluginProcessHost(PluginProcessHost* host) override {} |
58 void OnSentPluginChannelRequest() override {} | 58 void OnSentPluginChannelRequest() override {} |
59 | 59 |
60 void OnChannelOpened(const IPC::ChannelHandle& handle) override { | 60 void OnChannelOpened(const IPC::ChannelHandle& handle) override { |
61 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 61 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
62 ASSERT_TRUE(set_plugin_info_called_); | 62 ASSERT_TRUE(set_plugin_info_called_); |
63 ASSERT_TRUE(!channel_); | 63 ASSERT_TRUE(!channel_); |
64 channel_ = IPC::Channel::CreateClient(handle, this).release(); | 64 channel_ = IPC::Channel::CreateClient(handle, this, nullptr).release(); |
65 ASSERT_TRUE(channel_->Connect()); | 65 ASSERT_TRUE(channel_->Connect()); |
66 } | 66 } |
67 | 67 |
68 void SetPluginInfo(const WebPluginInfo& info) override { | 68 void SetPluginInfo(const WebPluginInfo& info) override { |
69 ASSERT_TRUE(info.mime_types.size()); | 69 ASSERT_TRUE(info.mime_types.size()); |
70 ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); | 70 ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); |
71 set_plugin_info_called_ = true; | 71 set_plugin_info_called_ = true; |
72 } | 72 } |
73 | 73 |
74 void OnError() override { Fail(); } | 74 void OnError() override { Fail(); } |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 BrowserThread::IO, FROM_HERE, | 361 BrowserThread::IO, FROM_HERE, |
362 base::Bind(&OpenChannel, &mock_client)); | 362 base::Bind(&OpenChannel, &mock_client)); |
363 RunMessageLoop(); | 363 RunMessageLoop(); |
364 EXPECT_TRUE(mock_client.get_resource_context_called()); | 364 EXPECT_TRUE(mock_client.get_resource_context_called()); |
365 EXPECT_TRUE(mock_client.set_plugin_info_called()); | 365 EXPECT_TRUE(mock_client.set_plugin_info_called()); |
366 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); | 366 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); |
367 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); | 367 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); |
368 } | 368 } |
369 | 369 |
370 } // namespace content | 370 } // namespace content |
OLD | NEW |