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

Side by Side Diff: content/test/test_plugin_service.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_TEST_TEST_PLUGIN_SERVICE_H_
6 #define CONTENT_TEST_TEST_PLUGIN_SERVICE_H_
7 #pragma once
8
9 #include "content/browser/plugin_service.h"
10
11 namespace webkit {
12 namespace npapi {
13 class PluginList;
14 }
15 }
16
17 // This class can be used in tests to bypass the actual plugin loading logic. It
18 // is meant to be used in conjuction with MockPluginList and will perform a
19 // synchronous load of plugins on the thread on which the GetPlugin* methods
20 // were called. Note that the callbacks will still be run off the message loop.
21 //
22 // If you're wondering how this works in conjunction with the PluginService
23 // singleton, the answer is to refactor your component to use dependency
24 // injection to take an instance of PluginService, store it as a member, and
25 // pass in an instance of this during tests.
26 class TestPluginService : public PluginService {
27 public:
28 TestPluginService(webkit::npapi::PluginList* plugin_list);
29 virtual ~TestPluginService();
30
31 // PluginService:
32 virtual void GetPlugins(const GetPluginsCallback& cb) OVERRIDE;
33 virtual void GetPluginGroups(const GetPluginGroupsCallback& cb) OVERRIDE;
34 };
35
36 #endif // CONTENT_TEST_TEST_PLUGIN_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698