Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: webkit/plugins/npapi/plugin_lib_unittest.cc

Issue 10066044: RefCounted types should not have public destructors, webkit/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation ordering Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/buffered_data_source_unittest.cc ('k') | webkit/plugins/npapi/plugin_stream_url.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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"
11 11
12 namespace webkit { 12 namespace webkit {
13 namespace npapi { 13 namespace npapi {
14 14
15 // Test the unloading of plugin libs. Bug http://crbug.com/46526 showed that 15 // Test the unloading of plugin libs. Bug http://crbug.com/46526 showed that
16 // if UnloadAllPlugins() simply iterates through the g_loaded_libs global 16 // if UnloadAllPlugins() simply iterates through the g_loaded_libs global
17 // variable, we can get a crash if no plugin libs were marked as always loaded. 17 // variable, we can get a crash if no plugin libs were marked as always loaded.
18 class PluginLibTest : public PluginLib { 18 class PluginLibTest : public PluginLib {
19 public: 19 public:
20 PluginLibTest() : PluginLib(WebPluginInfo(), NULL) { 20 PluginLibTest() : PluginLib(WebPluginInfo(), NULL) {}
21 }
22 using PluginLib::Unload; 21 using PluginLib::Unload;
22
23 protected:
24 virtual ~PluginLibTest() {}
23 }; 25 };
24 26
25 TEST(PluginLibLoading, UnloadAllPlugins) { 27 TEST(PluginLibLoading, UnloadAllPlugins) {
26 // For the creation of the g_loaded_libs global variable. 28 // For the creation of the g_loaded_libs global variable.
27 ASSERT_EQ(static_cast<PluginLibTest*>(NULL), 29 ASSERT_EQ(static_cast<PluginLibTest*>(NULL),
28 PluginLibTest::CreatePluginLib(FilePath())); 30 PluginLibTest::CreatePluginLib(FilePath()));
29 31
30 // Try with a single plugin lib. 32 // Try with a single plugin lib.
31 scoped_refptr<PluginLibTest> plugin_lib1(new PluginLibTest()); 33 scoped_refptr<PluginLibTest> plugin_lib1(new PluginLibTest());
32 PluginLib::UnloadAllPlugins(); 34 PluginLib::UnloadAllPlugins();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 "IcedTea NPR Web Browser Plugin " 173 "IcedTea NPR Web Browser Plugin "
172 "(using IcedTea6 1.9.3 (fedora-49.1.9.3.fc14-i386))`", 174 "(using IcedTea6 1.9.3 (fedora-49.1.9.3.fc14-i386))`",
173 &info); 175 &info);
174 EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version); 176 EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version);
175 } 177 }
176 178
177 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 179 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
178 180
179 } // namespace npapi 181 } // namespace npapi
180 } // namespace webkit 182 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/media/buffered_data_source_unittest.cc ('k') | webkit/plugins/npapi/plugin_stream_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698