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