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 virtual ~TestExtensionService();
25 // ExtensionServiceInterface implementation.
26 virtual const extensions::ExtensionSet
* extensions() const OVERRIDE
;
27 virtual const extensions::ExtensionSet
* disabled_extensions() const OVERRIDE
;
28 virtual extensions::PendingExtensionManager
*
29 pending_extension_manager() OVERRIDE
;
31 virtual bool UpdateExtension(
32 const std::string
& id
,
33 const base::FilePath
& path
,
34 const GURL
& download_url
,
35 extensions::CrxInstaller
** out_crx_installer
) OVERRIDE
;
36 virtual const extensions::Extension
* GetExtensionById(
37 const std::string
& id
, bool include_disabled
) const OVERRIDE
;
38 virtual const extensions::Extension
* GetInstalledExtension(
39 const std::string
& id
) const OVERRIDE
;
40 virtual const extensions::Extension
* GetPendingExtensionUpdate(
41 const std::string
& extension_id
) const OVERRIDE
;
42 virtual void FinishDelayedInstallation(
43 const std::string
& extension_id
) OVERRIDE
;
44 virtual bool IsExtensionEnabled(
45 const std::string
& extension_id
) const OVERRIDE
;
46 virtual bool IsExternalExtensionUninstalled(
47 const std::string
& extension_id
) const OVERRIDE
;
49 virtual void CheckManagementPolicy() OVERRIDE
;
50 virtual void CheckForUpdatesSoon() OVERRIDE
;
52 virtual bool is_ready() OVERRIDE
;
54 virtual base::SequencedTaskRunner
* GetFileTaskRunner() OVERRIDE
;
56 virtual void AddExtension(const extensions::Extension
* extension
) OVERRIDE
;
57 virtual void AddComponentExtension(
58 const extensions::Extension
* extension
) OVERRIDE
;
60 virtual void UnloadExtension(
61 const std::string
& extension_id
,
62 extensions::UnloadedExtensionInfo::Reason reason
) OVERRIDE
;
63 virtual void RemoveComponentExtension(const std::string
& extension_id
)
67 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SERVICE_H_