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/glue/plugins/plugin_lib.h" | 5 #include "webkit/glue/plugins/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 "build/build_config.h" | 9 #include "build/build_config.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 // Test the unloading of plugin libs. Bug http://crbug.com/46526 showed that | 12 // Test the unloading of plugin libs. Bug http://crbug.com/46526 showed that |
12 // if UnloadAllPlugins() simply iterates through the g_loaded_libs global | 13 // if UnloadAllPlugins() simply iterates through the g_loaded_libs global |
13 // variable, we can get a crash if no plugin libs were marked as always loaded. | 14 // variable, we can get a crash if no plugin libs were marked as always loaded. |
14 class PluginLibTest : public NPAPI::PluginLib { | 15 class PluginLibTest : public NPAPI::PluginLib { |
15 public: | 16 public: |
16 PluginLibTest() : NPAPI::PluginLib(WebPluginInfo(), NULL) { | 17 PluginLibTest() : NPAPI::PluginLib(WebPluginInfo(), NULL) { |
17 } | 18 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 ASSERT_EQ(12U, types.size()); | 144 ASSERT_EQ(12U, types.size()); |
144 for (size_t i = 0; i < types.size(); ++i) | 145 for (size_t i = 0; i < types.size(); ++i) |
145 EXPECT_EQ(ASCIIToUTF16("IcedTea"), types[i].description); | 146 EXPECT_EQ(ASCIIToUTF16("IcedTea"), types[i].description); |
146 | 147 |
147 // Verify that the mime types with semis are coming through ok. | 148 // Verify that the mime types with semis are coming through ok. |
148 EXPECT_TRUE(types[4].mime_type.find(';') != std::string::npos); | 149 EXPECT_TRUE(types[4].mime_type.find(';') != std::string::npos); |
149 } | 150 } |
150 | 151 |
151 #endif // defined(OS_LINUX) | 152 #endif // defined(OS_LINUX) |
OLD | NEW |