// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_ #define EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_ #include "base/memory/raw_ptr.h" #include "base/one_shot_event.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "extensions/browser/extension_registry_factory.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system_provider.h" #include "extensions/common/extension_id.h" namespace extensions { // An empty ExtensionSystem for testing. Tests that need only specific // parts of ExtensionSystem should derive from this class and override // functions as needed. To use this, use // TestExtensionsBrowserClient::set_extension_system_factory // with the MockExtensionSystemFactory below. class MockExtensionSystem : public ExtensionSystem { … }; // A factory to create a MockExtensionSystem. Sample use: // // MockExtensionSystemFactory<MockExtensionSystemSubclass> factory; // TestExtensionsBrowserClient::set_extension_system_factory(factory); template <typename T> class MockExtensionSystemFactory : public ExtensionSystemProvider { … }; } // namespace extensions #endif // EXTENSIONS_BROWSER_MOCK_EXTENSION_SYSTEM_H_