OLD | NEW |
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" |
11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
13 #include "chrome/test/base/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
14 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
15 #include "content/browser/resource_context.h" | 15 #include "content/browser/resource_context.h" |
16 #include "content/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "webkit/plugins/npapi/plugin_list.h" | 18 #include "webkit/plugins/npapi/plugin_list.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const char kNPAPITestPluginMimeType[] = "application/vnd.npapi-test"; | 22 const char kNPAPITestPluginMimeType[] = "application/vnd.npapi-test"; |
23 | 23 |
24 // Mock up of the Client and the Listener classes that would supply the | 24 // Mock up of the Client and the Listener classes that would supply the |
25 // communication channel with the plugin. | 25 // communication channel with the plugin. |
26 class MockPluginProcessHostClient : public PluginProcessHost::Client, | 26 class MockPluginProcessHostClient : public PluginProcessHost::Client, |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 BrowserThread::IO, FROM_HERE, | 300 BrowserThread::IO, FROM_HERE, |
301 base::Bind(OpenChannel, &mock_client)); | 301 base::Bind(OpenChannel, &mock_client)); |
302 ui_test_utils::RunMessageLoop(); | 302 ui_test_utils::RunMessageLoop(); |
303 EXPECT_TRUE(mock_client.get_resource_context_called()); | 303 EXPECT_TRUE(mock_client.get_resource_context_called()); |
304 EXPECT_TRUE(mock_client.set_plugin_info_called()); | 304 EXPECT_TRUE(mock_client.set_plugin_info_called()); |
305 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); | 305 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); |
306 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); | 306 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); |
307 } | 307 } |
308 | 308 |
309 } // namespace | 309 } // namespace |
OLD | NEW |