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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/chrome_switches.h" | |
11 #include "chrome/test/in_process_browser_test.h" | 10 #include "chrome/test/in_process_browser_test.h" |
12 #include "chrome/test/ui_test_utils.h" | 11 #include "chrome/test/ui_test_utils.h" |
13 #include "content/browser/browser_thread.h" | 12 #include "content/browser/browser_thread.h" |
| 13 #include "content/common/content_switches.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "webkit/plugins/npapi/plugin_list.h" | 15 #include "webkit/plugins/npapi/plugin_list.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const char* kNPAPITestPluginMimeType = "application/vnd.npapi-test"; | 19 const char* kNPAPITestPluginMimeType = "application/vnd.npapi-test"; |
20 | 20 |
21 // Mock up of the Client and the Listener classes that would supply the | 21 // Mock up of the Client and the Listener classes that would supply the |
22 // communication channel with the plugin. | 22 // communication channel with the plugin. |
23 class MockPluginProcessHostClient : public PluginProcessHost::Client, | 23 class MockPluginProcessHostClient : public PluginProcessHost::Client, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 }; | 86 }; |
87 | 87 |
88 // Try to open a channel to the test plugin. Minimal plugin process spawning | 88 // Try to open a channel to the test plugin. Minimal plugin process spawning |
89 // test for the PluginService interface. | 89 // test for the PluginService interface. |
90 IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) { | 90 IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) { |
91 MockPluginProcessHostClient mock_client; | 91 MockPluginProcessHostClient mock_client; |
92 PluginService::GetInstance()->OpenChannelToNpapiPlugin( | 92 PluginService::GetInstance()->OpenChannelToNpapiPlugin( |
93 0, 0, GURL(), kNPAPITestPluginMimeType, &mock_client); | 93 0, 0, GURL(), kNPAPITestPluginMimeType, &mock_client); |
94 ui_test_utils::RunMessageLoop(); | 94 ui_test_utils::RunMessageLoop(); |
95 } | 95 } |
OLD | NEW |