1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_
11 #include "chrome/browser/extensions/extension_service.h"
13 namespace extensions {
18 // Implemention of ExtensionServiceInterface with default
19 // implementations for methods that add failures. You should subclass
20 // this and override the methods you care about.
21 class TestExtensionService : public ExtensionServiceInterface {
23 ~TestExtensionService() override;
25 // ExtensionServiceInterface implementation.
26 const extensions::ExtensionSet* extensions() const override;
27 extensions::PendingExtensionManager* pending_extension_manager() override;
29 bool UpdateExtension(const std::string& id,
30 const base::FilePath& path,
31 bool file_ownership_passed,
32 extensions::CrxInstaller** out_crx_installer) override;
33 const extensions::Extension* GetExtensionById(
34 const std::string& id,
35 bool include_disabled) const override;
36 const extensions::Extension* GetInstalledExtension(
37 const std::string& id) const override;
38 const extensions::Extension* GetPendingExtensionUpdate(
39 const std::string& extension_id) const override;
40 void FinishDelayedInstallation(const std::string& extension_id) override;
41 bool IsExtensionEnabled(const std::string& extension_id) const override;
43 void CheckManagementPolicy() override;
44 void CheckForUpdatesSoon() override;
46 bool is_ready() override;
48 base::SequencedTaskRunner* GetFileTaskRunner() override;
50 void AddExtension(const extensions::Extension* extension) override;
51 void AddComponentExtension(const extensions::Extension* extension) override;
54 const std::string& extension_id,
55 extensions::UnloadedExtensionInfo::Reason reason) override;
56 void RemoveComponentExtension(const std::string& extension_id) override;
59 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_