Index: webkit/glue/plugins/plugin_list.h |
diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h |
index 8f11a5e0e25ca3d4551ed223ec9ab707390fdfd1..1f7285f5ce1d466c8fc1527df6559ecb360206e8 100644 |
--- a/webkit/glue/plugins/plugin_list.h |
+++ b/webkit/glue/plugins/plugin_list.h |
@@ -5,8 +5,10 @@ |
#ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_ |
#define WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_ |
+#include <map> |
#include <set> |
#include <string> |
+#include <utility> |
#include <vector> |
#include "base/basictypes.h" |
@@ -26,6 +28,10 @@ struct DefaultLazyInstanceTraits; |
} // namespace base |
+namespace plugin_test_internal { |
+class TestablePluginList; |
+} |
+ |
namespace NPAPI { |
#define kDefaultPluginLibraryName FILE_PATH_LITERAL("default_plugin") |
@@ -87,6 +93,8 @@ class PluginList { |
static const PluginGroupDefinition* GetPluginGroupDefinitions(); |
static size_t GetPluginGroupDefinitionsSize(); |
+ virtual ~PluginList() { } |
+ |
// Returns true iff the plugin list has been loaded already. |
bool PluginsLoaded(); |
@@ -224,7 +232,7 @@ class PluginList { |
~PluginList(); |
private: |
- FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); |
+ friend class plugin_test_internal::TestablePluginList; |
// Constructors are private for singletons |
PluginList(); |
@@ -238,8 +246,13 @@ class PluginList { |
// Callers need to protect calls to this method by a lock themselves. |
PluginGroup* AddToPluginGroups(const WebPluginInfo& web_plugin_info); |
- // Load all plugins from the default plugins directory |
- void LoadPlugins(bool refresh); |
+ // Load all plugins from the default plugins directory. |
+ // Declared virtual so that it can be overridden for tests. |
+ virtual void LoadPlugins(bool refresh); |
+ |
+ // Allows tests to perform custom post-initialization tasks on newly created |
+ // PluginGroups. |
+ virtual void PostInitPluginGroup(PluginGroup* group) { } |
// Load all plugins from a specific directory. |
// |plugins| is updated with loaded plugin information. |