| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/plugin_service.h" | 5 #include "chrome/browser/plugin_service.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/test/in_process_browser_test.h" | 10 #include "chrome/test/in_process_browser_test.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 plugin_service_->FindOrStartPluginProcess( | 75 plugin_service_->FindOrStartPluginProcess( |
| 76 FilePath(webkit::npapi::kDefaultPluginLibraryName)); | 76 FilePath(webkit::npapi::kDefaultPluginLibraryName)); |
| 77 | 77 |
| 78 EXPECT_EQ(default_plugin_process_host, plugin_service_->FindPluginProcess( | 78 EXPECT_EQ(default_plugin_process_host, plugin_service_->FindPluginProcess( |
| 79 FilePath(webkit::npapi::kDefaultPluginLibraryName))); | 79 FilePath(webkit::npapi::kDefaultPluginLibraryName))); |
| 80 } | 80 } |
| 81 | 81 |
| 82 IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) { | 82 IN_PROC_BROWSER_TEST_F(PluginServiceTest, OpenChannelToPlugin) { |
| 83 MockPluginProcessHostClient mock_client; | 83 MockPluginProcessHostClient mock_client; |
| 84 EXPECT_CALL(mock_client, SetPluginInfo(testing::_)).Times(1); | 84 EXPECT_CALL(mock_client, SetPluginInfo(testing::_)).Times(1); |
| 85 plugin_service_->OpenChannelToPlugin(GURL("http://google.com/"), | 85 plugin_service_->OpenChannelToPlugin(0, 0, GURL("http://google.com/"), |
| 86 "audio/mp3", | 86 "audio/mp3", |
| 87 &mock_client); | 87 &mock_client); |
| 88 message_loop_.RunAllPending(); | 88 message_loop_.RunAllPending(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 IN_PROC_BROWSER_TEST_F(PluginServiceTest, GetFirstAllowedPluginInfo) { | 91 IN_PROC_BROWSER_TEST_F(PluginServiceTest, GetFirstAllowedPluginInfo) { |
| 92 // on ChromeOS the plugin policy gets loaded on the FILE thread and the | 92 // on ChromeOS the plugin policy gets loaded on the FILE thread and the |
| 93 // GetFirstAllowedPluginInfo will fail if we don't allow it to finish. | 93 // GetFirstAllowedPluginInfo will fail if we don't allow it to finish. |
| 94 message_loop_.RunAllPending(); | 94 message_loop_.RunAllPending(); |
| 95 // We should always get a positive response no matter whether we really have | 95 // We should always get a positive response no matter whether we really have |
| 96 // a plugin to support that particular mime type because the Default plugin | 96 // a plugin to support that particular mime type because the Default plugin |
| 97 // supports all mime types. | 97 // supports all mime types. |
| 98 webkit::npapi::WebPluginInfo plugin_info; | 98 webkit::npapi::WebPluginInfo plugin_info; |
| 99 std::string plugin_mime_type; | 99 std::string plugin_mime_type; |
| 100 plugin_service_->GetFirstAllowedPluginInfo(GURL("http://google.com/"), | 100 plugin_service_->GetFirstAllowedPluginInfo(0, 0, GURL("http://google.com/"), |
| 101 "application/pdf", | 101 "application/pdf", |
| 102 &plugin_info, | 102 &plugin_info, |
| 103 &plugin_mime_type); | 103 &plugin_mime_type); |
| 104 EXPECT_EQ("application/pdf", plugin_mime_type); | 104 EXPECT_EQ("application/pdf", plugin_mime_type); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace | 107 } // namespace |
| OLD | NEW |