diff options
Diffstat (limited to 'webkit/plugins/npapi/mock_plugin_list.h')
-rw-r--r-- | webkit/plugins/npapi/mock_plugin_list.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/webkit/plugins/npapi/mock_plugin_list.h b/webkit/plugins/npapi/mock_plugin_list.h new file mode 100644 index 0000000..15c11c9 --- /dev/null +++ b/webkit/plugins/npapi/mock_plugin_list.h @@ -0,0 +1,35 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_PLUGINS_NPAPI_MOCK_PLUGIN_LIST_H_ +#define WEBKIT_PLUGINS_NPAPI_MOCK_PLUGIN_LIST_H_ + +#include "webkit/plugins/npapi/plugin_list.h" + +namespace webkit { +namespace npapi { + +// A PluginList for tests that avoids file system IO. There is also no reason +// to use |lock_| (but it doesn't hurt either). +class MockPluginList : public PluginList { + public: + MockPluginList(const PluginGroupDefinition* group_definitions, + size_t num_group_definitions); + virtual ~MockPluginList(); + + void AddPluginToLoad(const WebPluginInfo& plugin); + void ClearPluginsToLoad(); + + private: + std::vector<WebPluginInfo> plugins_to_load_; + + // PluginList methods: + virtual void LoadPluginsInternal( + ScopedVector<PluginGroup>* plugin_groups) OVERRIDE; +}; + +} // npapi +} // webkit + +#endif // WEBKIT_PLUGINS_NPAPI_MOCK_PLUGIN_LIST_H_ |