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 "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "extensions/browser/extension_system.h" | 9 #include "extensions/browser/extension_system.h" |
10 #include "extensions/common/one_shot_event.h" | 10 #include "extensions/common/one_shot_event.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // Creates an ExtensionService initialized with the testing profile and | 47 // Creates an ExtensionService initialized with the testing profile and |
48 // returns it, and creates ExtensionPrefs if it hasn't been created yet. | 48 // returns it, and creates ExtensionPrefs if it hasn't been created yet. |
49 ExtensionService* CreateExtensionService( | 49 ExtensionService* CreateExtensionService( |
50 const base::CommandLine* command_line, | 50 const base::CommandLine* command_line, |
51 const base::FilePath& install_directory, | 51 const base::FilePath& install_directory, |
52 bool autoupdate_enabled); | 52 bool autoupdate_enabled); |
53 | 53 |
54 void CreateSocketManager(); | 54 void CreateSocketManager(); |
55 | 55 |
56 // Creates a LazyBackgroundTaskQueue. If not invoked, the | |
57 // LazyBackgroundTaskQueue is NULL. | |
58 void CreateLazyBackgroundTaskQueue(); | |
59 | |
60 void InitForRegularProfile(bool extensions_enabled) override {} | 56 void InitForRegularProfile(bool extensions_enabled) override {} |
61 void SetExtensionService(ExtensionService* service); | 57 void SetExtensionService(ExtensionService* service); |
62 ExtensionService* extension_service() override; | 58 ExtensionService* extension_service() override; |
63 RuntimeData* runtime_data() override; | 59 RuntimeData* runtime_data() override; |
64 ManagementPolicy* management_policy() override; | 60 ManagementPolicy* management_policy() override; |
65 SharedUserScriptMaster* shared_user_script_master() override; | 61 SharedUserScriptMaster* shared_user_script_master() override; |
66 DeclarativeUserScriptManager* declarative_user_script_manager() override; | 62 DeclarativeUserScriptManager* declarative_user_script_manager() override; |
67 StateStore* state_store() override; | 63 StateStore* state_store() override; |
68 StateStore* rules_store() override; | 64 StateStore* rules_store() override; |
69 TestingValueStore* value_store() { return value_store_; } | 65 TestingValueStore* value_store() { return value_store_; } |
70 InfoMap* info_map() override; | 66 InfoMap* info_map() override; |
71 LazyBackgroundTaskQueue* lazy_background_task_queue() override; | |
72 void SetEventRouter(scoped_ptr<EventRouter> event_router); | 67 void SetEventRouter(scoped_ptr<EventRouter> event_router); |
73 EventRouter* event_router() override; | 68 EventRouter* event_router() override; |
74 InstallVerifier* install_verifier() override; | 69 InstallVerifier* install_verifier() override; |
75 QuotaService* quota_service() override; | 70 QuotaService* quota_service() override; |
76 const OneShotEvent& ready() const override; | 71 const OneShotEvent& ready() const override; |
77 ContentVerifier* content_verifier() override; | 72 ContentVerifier* content_verifier() override; |
78 scoped_ptr<ExtensionSet> GetDependentExtensions( | 73 scoped_ptr<ExtensionSet> GetDependentExtensions( |
79 const Extension* extension) override; | 74 const Extension* extension) override; |
80 | 75 |
81 // Note that you probably want to use base::RunLoop().RunUntilIdle() right | 76 // Note that you probably want to use base::RunLoop().RunUntilIdle() right |
82 // after this to run all the accumulated tasks. | 77 // after this to run all the accumulated tasks. |
83 void SetReady() { ready_.Signal(); } | 78 void SetReady() { ready_.Signal(); } |
84 | 79 |
85 // Factory method for tests to use with SetTestingProfile. | 80 // Factory method for tests to use with SetTestingProfile. |
86 static KeyedService* Build(content::BrowserContext* profile); | 81 static KeyedService* Build(content::BrowserContext* profile); |
87 | 82 |
88 protected: | 83 protected: |
89 Profile* profile_; | 84 Profile* profile_; |
90 | 85 |
91 private: | 86 private: |
92 scoped_ptr<StateStore> state_store_; | 87 scoped_ptr<StateStore> state_store_; |
93 // A pointer to the TestingValueStore owned by |state_store_|. | 88 // A pointer to the TestingValueStore owned by |state_store_|. |
94 TestingValueStore* value_store_; | 89 TestingValueStore* value_store_; |
95 scoped_ptr<DeclarativeUserScriptManager> declarative_user_script_manager_; | 90 scoped_ptr<DeclarativeUserScriptManager> declarative_user_script_manager_; |
96 scoped_ptr<ManagementPolicy> management_policy_; | 91 scoped_ptr<ManagementPolicy> management_policy_; |
97 scoped_ptr<RuntimeData> runtime_data_; | 92 scoped_ptr<RuntimeData> runtime_data_; |
98 scoped_ptr<ExtensionService> extension_service_; | 93 scoped_ptr<ExtensionService> extension_service_; |
99 scoped_refptr<InfoMap> info_map_; | 94 scoped_refptr<InfoMap> info_map_; |
100 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | |
101 scoped_ptr<EventRouter> event_router_; | 95 scoped_ptr<EventRouter> event_router_; |
102 scoped_ptr<InstallVerifier> install_verifier_; | 96 scoped_ptr<InstallVerifier> install_verifier_; |
103 scoped_ptr<QuotaService> quota_service_; | 97 scoped_ptr<QuotaService> quota_service_; |
104 OneShotEvent ready_; | 98 OneShotEvent ready_; |
105 }; | 99 }; |
106 | 100 |
107 } // namespace extensions | 101 } // namespace extensions |
108 | 102 |
109 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 103 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |