OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
7 | 7 |
8 #include "extensions/browser/extension_system.h" | 8 #include "extensions/browser/extension_system.h" |
9 #include "extensions/common/one_shot_event.h" | 9 #include "extensions/common/one_shot_event.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class ExtensionPrefs; | 25 class ExtensionPrefs; |
26 class RuntimeData; | 26 class RuntimeData; |
27 class StandardManagementPolicyProvider; | 27 class StandardManagementPolicyProvider; |
28 | 28 |
29 // Test ExtensionSystem, for use with TestingProfile. | 29 // Test ExtensionSystem, for use with TestingProfile. |
30 class TestExtensionSystem : public ExtensionSystem { | 30 class TestExtensionSystem : public ExtensionSystem { |
31 public: | 31 public: |
32 explicit TestExtensionSystem(Profile* profile); | 32 explicit TestExtensionSystem(Profile* profile); |
33 virtual ~TestExtensionSystem(); | 33 virtual ~TestExtensionSystem(); |
34 | 34 |
35 // BrowserContextKeyedService implementation. | 35 // KeyedService implementation. |
36 virtual void Shutdown() OVERRIDE; | 36 virtual void Shutdown() OVERRIDE; |
37 | 37 |
38 // Creates an ExtensionPrefs with the testing profile and returns it. | 38 // Creates an ExtensionPrefs with the testing profile and returns it. |
39 // Useful for tests that need to modify prefs before creating the | 39 // Useful for tests that need to modify prefs before creating the |
40 // ExtensionService. | 40 // ExtensionService. |
41 ExtensionPrefs* CreateExtensionPrefs(const CommandLine* command_line, | 41 ExtensionPrefs* CreateExtensionPrefs(const CommandLine* command_line, |
42 const base::FilePath& install_directory); | 42 const base::FilePath& install_directory); |
43 | 43 |
44 // Creates an ExtensionService initialized with the testing profile and | 44 // Creates an ExtensionService initialized with the testing profile and |
45 // returns it, and creates ExtensionPrefs if it hasn't been created yet. | 45 // returns it, and creates ExtensionPrefs if it hasn't been created yet. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual InstallVerifier* install_verifier() OVERRIDE; | 77 virtual InstallVerifier* install_verifier() OVERRIDE; |
78 virtual QuotaService* quota_service() OVERRIDE; | 78 virtual QuotaService* quota_service() OVERRIDE; |
79 virtual const OneShotEvent& ready() const OVERRIDE; | 79 virtual const OneShotEvent& ready() const OVERRIDE; |
80 | 80 |
81 void SetReady() { | 81 void SetReady() { |
82 LOG(INFO) << "SetReady()"; | 82 LOG(INFO) << "SetReady()"; |
83 ready_.Signal(); | 83 ready_.Signal(); |
84 } | 84 } |
85 | 85 |
86 // Factory method for tests to use with SetTestingProfile. | 86 // Factory method for tests to use with SetTestingProfile. |
87 static BrowserContextKeyedService* Build(content::BrowserContext* profile); | 87 static KeyedService* Build(content::BrowserContext* profile); |
88 | 88 |
89 protected: | 89 protected: |
90 Profile* profile_; | 90 Profile* profile_; |
91 | 91 |
92 private: | 92 private: |
93 scoped_ptr<StateStore> state_store_; | 93 scoped_ptr<StateStore> state_store_; |
94 // A pointer to the TestingValueStore owned by |state_store_|. | 94 // A pointer to the TestingValueStore owned by |state_store_|. |
95 TestingValueStore* value_store_; | 95 TestingValueStore* value_store_; |
96 scoped_ptr<Blacklist> blacklist_; | 96 scoped_ptr<Blacklist> blacklist_; |
97 scoped_ptr<StandardManagementPolicyProvider> | 97 scoped_ptr<StandardManagementPolicyProvider> |
98 standard_management_policy_provider_; | 98 standard_management_policy_provider_; |
99 scoped_ptr<ManagementPolicy> management_policy_; | 99 scoped_ptr<ManagementPolicy> management_policy_; |
100 scoped_ptr<RuntimeData> runtime_data_; | 100 scoped_ptr<RuntimeData> runtime_data_; |
101 scoped_ptr<ExtensionService> extension_service_; | 101 scoped_ptr<ExtensionService> extension_service_; |
102 scoped_ptr<ProcessManager> process_manager_; | 102 scoped_ptr<ProcessManager> process_manager_; |
103 scoped_refptr<InfoMap> info_map_; | 103 scoped_refptr<InfoMap> info_map_; |
104 scoped_ptr<EventRouter> event_router_; | 104 scoped_ptr<EventRouter> event_router_; |
105 scoped_ptr<ErrorConsole> error_console_; | 105 scoped_ptr<ErrorConsole> error_console_; |
106 scoped_ptr<InstallVerifier> install_verifier_; | 106 scoped_ptr<InstallVerifier> install_verifier_; |
107 scoped_ptr<QuotaService> quota_service_; | 107 scoped_ptr<QuotaService> quota_service_; |
108 OneShotEvent ready_; | 108 OneShotEvent ready_; |
109 }; | 109 }; |
110 | 110 |
111 } // namespace extensions | 111 } // namespace extensions |
112 | 112 |
113 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |