| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 &types); | 145 &types); |
| 146 | 146 |
| 147 ASSERT_EQ(12U, types.size()); | 147 ASSERT_EQ(12U, types.size()); |
| 148 for (size_t i = 0; i < types.size(); ++i) | 148 for (size_t i = 0; i < types.size(); ++i) |
| 149 EXPECT_EQ(ASCIIToUTF16("IcedTea"), types[i].description); | 149 EXPECT_EQ(ASCIIToUTF16("IcedTea"), types[i].description); |
| 150 | 150 |
| 151 // Verify that the mime types with semis are coming through ok. | 151 // Verify that the mime types with semis are coming through ok. |
| 152 EXPECT_TRUE(types[4].mime_type.find(';') != std::string::npos); | 152 EXPECT_TRUE(types[4].mime_type.find(';') != std::string::npos); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Make sure we understand how to get the version numbers for common Linux |
| 156 // plug-ins. |
| 157 TEST(PluginDescriptionParse, ExtractVersion) { |
| 158 WebPluginInfo info; |
| 159 PluginLib::ExtractVersionString("Shockwave Flash 10.1 r102", &info); |
| 160 EXPECT_EQ(ASCIIToUTF16("10.1 r102"), info.version); |
| 161 PluginLib::ExtractVersionString("Java(TM) Plug-in 1.6.0_22", &info); |
| 162 EXPECT_EQ(ASCIIToUTF16("1.6.0_22"), info.version); |
| 163 // It's actually much more likely for a modern Linux distribution to have |
| 164 // IcedTea. |
| 165 PluginLib::ExtractVersionString( |
| 166 "IcedTea NPR Web Browser Plugin " |
| 167 "(using IcedTea6 1.9.2 (6b20-1.9.2-0ubuntu1~10.04.1))", |
| 168 &info); |
| 169 EXPECT_EQ(ASCIIToUTF16("1.9.2"), info.version); |
| 170 PluginLib::ExtractVersionString( |
| 171 "IcedTea NPR Web Browser Plugin " |
| 172 "(using IcedTea6 1.9.3 (fedora-49.1.9.3.fc14-i386))`", |
| 173 &info); |
| 174 EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version); |
| 175 } |
| 176 |
| 155 #endif // defined(OS_LINUX) | 177 #endif // defined(OS_LINUX) |
| 156 | 178 |
| 157 } // namespace npapi | 179 } // namespace npapi |
| 158 } // namespace webkit | 180 } // namespace webkit |
| OLD | NEW |