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

Unified Diff: content/test/test_plugin_service.cc

Issue 8493019: Refactor PluginService to take PluginList as a dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« content/browser/plugin_service.cc ('K') | « content/test/test_plugin_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
+}
« content/browser/plugin_service.cc ('K') | « content/test/test_plugin_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698