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 StateStore* state_store() override; | 62 StateStore* state_store() override; |
67 StateStore* rules_store() override; | 63 StateStore* rules_store() override; |
68 TestingValueStore* value_store() { return value_store_; } | 64 TestingValueStore* value_store() { return value_store_; } |
69 InfoMap* info_map() override; | 65 InfoMap* info_map() override; |
70 LazyBackgroundTaskQueue* lazy_background_task_queue() override; | |
71 void SetEventRouter(scoped_ptr<EventRouter> event_router); | 66 void SetEventRouter(scoped_ptr<EventRouter> event_router); |
72 EventRouter* event_router() override; | 67 EventRouter* event_router() override; |
73 QuotaService* quota_service() override; | 68 QuotaService* quota_service() override; |
74 const OneShotEvent& ready() const override; | 69 const OneShotEvent& ready() const override; |
75 ContentVerifier* content_verifier() override; | 70 ContentVerifier* content_verifier() override; |
76 scoped_ptr<ExtensionSet> GetDependentExtensions( | 71 scoped_ptr<ExtensionSet> GetDependentExtensions( |
77 const Extension* extension) override; | 72 const Extension* extension) override; |
78 | 73 |
79 // Note that you probably want to use base::RunLoop().RunUntilIdle() right | 74 // Note that you probably want to use base::RunLoop().RunUntilIdle() right |
80 // after this to run all the accumulated tasks. | 75 // after this to run all the accumulated tasks. |
81 void SetReady() { ready_.Signal(); } | 76 void SetReady() { ready_.Signal(); } |
82 | 77 |
83 // Factory method for tests to use with SetTestingProfile. | 78 // Factory method for tests to use with SetTestingProfile. |
84 static KeyedService* Build(content::BrowserContext* profile); | 79 static KeyedService* Build(content::BrowserContext* profile); |
85 | 80 |
86 protected: | 81 protected: |
87 Profile* profile_; | 82 Profile* profile_; |
88 | 83 |
89 private: | 84 private: |
90 scoped_ptr<StateStore> state_store_; | 85 scoped_ptr<StateStore> state_store_; |
91 // A pointer to the TestingValueStore owned by |state_store_|. | 86 // A pointer to the TestingValueStore owned by |state_store_|. |
92 TestingValueStore* value_store_; | 87 TestingValueStore* value_store_; |
93 scoped_ptr<ManagementPolicy> management_policy_; | 88 scoped_ptr<ManagementPolicy> management_policy_; |
94 scoped_ptr<RuntimeData> runtime_data_; | 89 scoped_ptr<RuntimeData> runtime_data_; |
95 scoped_ptr<ExtensionService> extension_service_; | 90 scoped_ptr<ExtensionService> extension_service_; |
96 scoped_refptr<InfoMap> info_map_; | 91 scoped_refptr<InfoMap> info_map_; |
97 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | |
98 scoped_ptr<EventRouter> event_router_; | 92 scoped_ptr<EventRouter> event_router_; |
99 scoped_ptr<QuotaService> quota_service_; | 93 scoped_ptr<QuotaService> quota_service_; |
100 OneShotEvent ready_; | 94 OneShotEvent ready_; |
101 }; | 95 }; |
102 | 96 |
103 } // namespace extensions | 97 } // namespace extensions |
104 | 98 |
105 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ | 99 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_SYSTEM_H_ |
OLD | NEW |