Extract a MockExtensionSystem to be used with TestExtensionsBrowserClient.
The default implementation provides no subservices. Its purpose is to fulfill a dependency (in unit tests)
when other BrowserContextKeyedServices depend on an ExtensionSystem. Tests that actually need subservices
can override the necessary methods to provide them.
Also, this defines a MockExtensionSystemFactory template for ease of use with MockExtensionSystem subclasses.
BUG=348066
Review URL: https://codereview.chromium.org/460203002
Cr-Commit-Position: refs/heads/master@{#289235}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289235 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc
index 284f5491..5efe9dc 100644
--- a/chrome/browser/extensions/menu_manager_unittest.cc
+++ b/chrome/browser/extensions/menu_manager_unittest.cc
@@ -453,6 +453,8 @@
ASSERT_TRUE(manager_.GetItemById(item2->id()) != NULL);
}
+namespace {
+
// A mock message service for tests of MenuManager::ExecuteCommand.
class MockEventRouter : public EventRouter {
public:
@@ -502,6 +504,8 @@
return new MockExtensionSystem(static_cast<Profile*>(profile));
}
+} // namespace
+
// Tests the RemoveAll functionality.
TEST_F(MenuManagerTest, RemoveAll) {
// Try removing all items for an extension id that doesn't have any items.