| Index: content/test/test_plugin_service.cc
|
| diff --git a/content/test/test_plugin_service.cc b/content/test/test_plugin_service.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7d753a5fb56bfc8bdfd0539a44f499d1b9c913bb
|
| --- /dev/null
|
| +++ b/content/test/test_plugin_service.cc
|
| @@ -0,0 +1,33 @@
|
| +// 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.
|
| +
|
| +#include "content/test/test_plugin_service.h"
|
| +
|
| +#include "base/bind.h"
|
| +#include "base/message_loop.h"
|
| +#include "webkit/plugins/npapi/plugin_group.h"
|
| +#include "webkit/plugins/npapi/plugin_list.h"
|
| +#include "webkit/plugins/webplugininfo.h"
|
| +
|
| +TestPluginService::TestPluginService(webkit::npapi::PluginList* plugin_list)
|
| + : PluginService(plugin_list) {
|
| + // Reset the callback so that tests don't trip the assertion set by the
|
| + // base class.
|
| + plugin_list->set_will_load_plugins_callback(base::Closure());
|
| +}
|
| +
|
| +TestPluginService::~TestPluginService() {
|
| +}
|
| +
|
| +void TestPluginService::GetPlugins(const GetPluginsCallback& cb) {
|
| + std::vector<webkit::WebPluginInfo> plugins;
|
| + plugin_list()->GetPlugins(&plugins);
|
| + MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, plugins));
|
| +}
|
| +
|
| +void TestPluginService::GetPluginGroups(const GetPluginGroupsCallback& cb) {
|
| + std::vector<webkit::npapi::PluginGroup> groups;
|
| + plugin_list()->GetPluginGroups(true, &groups);
|
| + MessageLoop::current()->PostTask(FROM_HERE, base::Bind(cb, groups));
|
| +}
|
|
|