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

Unified Diff: chrome/browser/extensions/settings/settings_test_util.h

Issue 11232066: Remove GetExtensionEventRouter from Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rerebase Created 8 years, 2 months 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
Index: chrome/browser/extensions/settings/settings_test_util.h
diff --git a/chrome/browser/extensions/settings/settings_test_util.h b/chrome/browser/extensions/settings/settings_test_util.h
index 0acb66930e83821ca1ba7d0da6b2639e566fa25d..f38d8819bf22743e68636d1aecf84fc90985a154 100644
--- a/chrome/browser/extensions/settings/settings_test_util.h
+++ b/chrome/browser/extensions/settings/settings_test_util.h
@@ -17,6 +17,7 @@
#include "chrome/browser/extensions/settings/settings_namespace.h"
#include "chrome/browser/extensions/settings/settings_storage_factory.h"
#include "chrome/browser/extensions/test_extension_service.h"
+#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/test/base/testing_profile.h"
@@ -63,8 +64,22 @@ class MockExtensionService : public TestExtensionService {
std::map<std::string, scoped_refptr<Extension> > extensions_;
};
-// A Profile which returns ExtensionService and EventRouters with
-// enough functionality for the tests.
+// A mock ExtensionSystem to serve an EventRouter.
+class MockExtensionSystem : public TestExtensionSystem {
+ public:
+ explicit MockExtensionSystem(Profile* profile);
+ virtual ~MockExtensionSystem();
+
+ virtual EventRouter* event_router() OVERRIDE;
+
+ private:
+ scoped_ptr<EventRouter> event_router_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem);
+};
+
+// A Profile which returns an ExtensionService with enough functionality for
+// the tests.
class MockProfile : public TestingProfile {
public:
explicit MockProfile(const FilePath& file_path);
@@ -73,13 +88,10 @@ class MockProfile : public TestingProfile {
// Returns the same object as GetExtensionService, but not coaxed into an
// ExtensionService; use this method from tests.
MockExtensionService* GetMockExtensionService();
-
virtual ExtensionService* GetExtensionService() OVERRIDE;
- virtual EventRouter* GetExtensionEventRouter() OVERRIDE;
private:
MockExtensionService extension_service_;
- scoped_ptr<EventRouter> event_router_;
};
// SettingsStorageFactory which acts as a wrapper for other factories.
« no previous file with comments | « chrome/browser/extensions/settings/settings_frontend.cc ('k') | chrome/browser/extensions/settings/settings_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698