Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / extensions / test_extension_system.h
blobad5375a8f5979fd58a04f01a60dacca405a47a49
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_SYSTEM_H_
6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_
8 #include "extensions/browser/extension_system.h"
9 #include "extensions/common/one_shot_event.h"
11 class Profile;
12 class TestingValueStore;
14 namespace base {
15 class CommandLine;
16 class FilePath;
17 class Time;
20 namespace content {
21 class BrowserContext;
24 namespace extensions {
25 class ExtensionPrefs;
26 class RuntimeData;
27 class StandardManagementPolicyProvider;
29 // Test ExtensionSystem, for use with TestingProfile.
30 class TestExtensionSystem : public ExtensionSystem {
31 public:
32 explicit TestExtensionSystem(Profile* profile);
33 virtual ~TestExtensionSystem();
35 // KeyedService implementation.
36 virtual void Shutdown() OVERRIDE;
38 // Creates an ExtensionPrefs with the testing profile and returns it.
39 // Useful for tests that need to modify prefs before creating the
40 // ExtensionService.
41 ExtensionPrefs* CreateExtensionPrefs(const base::CommandLine* command_line,
42 const base::FilePath& install_directory);
44 // Creates an ExtensionService initialized with the testing profile and
45 // returns it, and creates ExtensionPrefs if it hasn't been created yet.
46 ExtensionService* CreateExtensionService(
47 const base::CommandLine* command_line,
48 const base::FilePath& install_directory,
49 bool autoupdate_enabled);
51 // Creates a ProcessManager. If not invoked, the ProcessManager is NULL.
52 void CreateProcessManager();
54 // Allows the ProcessManager to be overriden, for example by a stub
55 // implementation. Takes ownership of |manager|.
56 void SetProcessManager(ProcessManager* manager);
58 void CreateSocketManager();
60 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE {}
61 void SetExtensionService(ExtensionService* service);
62 virtual ExtensionService* extension_service() OVERRIDE;
63 virtual RuntimeData* runtime_data() OVERRIDE;
64 virtual ManagementPolicy* management_policy() OVERRIDE;
65 virtual UserScriptMaster* user_script_master() OVERRIDE;
66 virtual ProcessManager* process_manager() OVERRIDE;
67 virtual StateStore* state_store() OVERRIDE;
68 virtual StateStore* rules_store() OVERRIDE;
69 TestingValueStore* value_store() { return value_store_; }
70 virtual InfoMap* info_map() OVERRIDE;
71 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() OVERRIDE;
72 void SetEventRouter(scoped_ptr<EventRouter> event_router);
73 virtual EventRouter* event_router() OVERRIDE;
74 virtual ExtensionWarningService* warning_service() OVERRIDE;
75 virtual Blacklist* blacklist() OVERRIDE;
76 virtual ErrorConsole* error_console() OVERRIDE;
77 virtual InstallVerifier* install_verifier() OVERRIDE;
78 virtual QuotaService* quota_service() OVERRIDE;
79 virtual const OneShotEvent& ready() const OVERRIDE;
81 void SetReady() {
82 LOG(INFO) << "SetReady()";
83 ready_.Signal();
86 // Factory method for tests to use with SetTestingProfile.
87 static KeyedService* Build(content::BrowserContext* profile);
89 protected:
90 Profile* profile_;
92 private:
93 scoped_ptr<StateStore> state_store_;
94 // A pointer to the TestingValueStore owned by |state_store_|.
95 TestingValueStore* value_store_;
96 scoped_ptr<Blacklist> blacklist_;
97 scoped_ptr<StandardManagementPolicyProvider>
98 standard_management_policy_provider_;
99 scoped_ptr<ManagementPolicy> management_policy_;
100 scoped_ptr<RuntimeData> runtime_data_;
101 scoped_ptr<ExtensionService> extension_service_;
102 scoped_ptr<ProcessManager> process_manager_;
103 scoped_refptr<InfoMap> info_map_;
104 scoped_ptr<EventRouter> event_router_;
105 scoped_ptr<ErrorConsole> error_console_;
106 scoped_ptr<InstallVerifier> install_verifier_;
107 scoped_ptr<QuotaService> quota_service_;
108 OneShotEvent ready_;
111 } // namespace extensions
113 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_