OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "webkit/plugins/npapi/plugin_lib.h" | 5 #include "webkit/plugins/npapi/plugin_lib.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Need to create it again, it should have been destroyed above. | 53 // Need to create it again, it should have been destroyed above. |
54 ASSERT_EQ(static_cast<PluginLibTest*>(NULL), | 54 ASSERT_EQ(static_cast<PluginLibTest*>(NULL), |
55 PluginLibTest::CreatePluginLib(FilePath())); | 55 PluginLibTest::CreatePluginLib(FilePath())); |
56 | 56 |
57 // Now try to manually Unload the only one and then UnloadAll. | 57 // Now try to manually Unload the only one and then UnloadAll. |
58 plugin_lib1 = new PluginLibTest(); | 58 plugin_lib1 = new PluginLibTest(); |
59 plugin_lib1->Unload(); | 59 plugin_lib1->Unload(); |
60 PluginLib::UnloadAllPlugins(); | 60 PluginLib::UnloadAllPlugins(); |
61 } | 61 } |
62 | 62 |
63 #if defined(OS_LINUX) | 63 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
64 | 64 |
65 // Test parsing a simple description: Real Audio. | 65 // Test parsing a simple description: Real Audio. |
66 TEST(MIMEDescriptionParse, Simple) { | 66 TEST(MIMEDescriptionParse, Simple) { |
67 std::vector<WebPluginMimeType> types; | 67 std::vector<WebPluginMimeType> types; |
68 PluginLib::ParseMIMEDescription( | 68 PluginLib::ParseMIMEDescription( |
69 "audio/x-pn-realaudio-plugin:rpm:RealAudio document;", | 69 "audio/x-pn-realaudio-plugin:rpm:RealAudio document;", |
70 &types); | 70 &types); |
71 ASSERT_EQ(1U, types.size()); | 71 ASSERT_EQ(1U, types.size()); |
72 const WebPluginMimeType& type = types[0]; | 72 const WebPluginMimeType& type = types[0]; |
73 EXPECT_EQ("audio/x-pn-realaudio-plugin", type.mime_type); | 73 EXPECT_EQ("audio/x-pn-realaudio-plugin", type.mime_type); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 "(using IcedTea6 1.9.2 (6b20-1.9.2-0ubuntu1~10.04.1))", | 167 "(using IcedTea6 1.9.2 (6b20-1.9.2-0ubuntu1~10.04.1))", |
168 &info); | 168 &info); |
169 EXPECT_EQ(ASCIIToUTF16("1.9.2"), info.version); | 169 EXPECT_EQ(ASCIIToUTF16("1.9.2"), info.version); |
170 PluginLib::ExtractVersionString( | 170 PluginLib::ExtractVersionString( |
171 "IcedTea NPR Web Browser Plugin " | 171 "IcedTea NPR Web Browser Plugin " |
172 "(using IcedTea6 1.9.3 (fedora-49.1.9.3.fc14-i386))`", | 172 "(using IcedTea6 1.9.3 (fedora-49.1.9.3.fc14-i386))`", |
173 &info); | 173 &info); |
174 EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version); | 174 EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version); |
175 } | 175 } |
176 | 176 |
177 #endif // defined(OS_LINUX) | 177 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
178 | 178 |
179 } // namespace npapi | 179 } // namespace npapi |
180 } // namespace webkit | 180 } // namespace webkit |
OLD | NEW |