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 #include "chrome/browser/extensions/test_extension_system.h" | 5 #include "chrome/browser/extensions/test_extension_system.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "extensions/browser/extension_registry.h" | 21 #include "extensions/browser/extension_registry.h" |
22 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
23 #include "extensions/browser/extensions_browser_client.h" | 23 #include "extensions/browser/extensions_browser_client.h" |
24 #include "extensions/browser/info_map.h" | 24 #include "extensions/browser/info_map.h" |
25 #include "extensions/browser/management_policy.h" | 25 #include "extensions/browser/management_policy.h" |
26 #include "extensions/browser/quota_service.h" | 26 #include "extensions/browser/quota_service.h" |
27 #include "extensions/browser/runtime_data.h" | 27 #include "extensions/browser/runtime_data.h" |
28 #include "extensions/browser/state_store.h" | 28 #include "extensions/browser/state_store.h" |
29 #include "extensions/browser/value_store/test_value_store_factory.h" | 29 #include "extensions/browser/value_store/test_value_store_factory.h" |
30 #include "extensions/browser/value_store/testing_value_store.h" | 30 #include "extensions/browser/value_store/testing_value_store.h" |
| 31 #if defined(OS_CHROMEOS) |
| 32 #include "components/user_manager/user_manager.h" |
| 33 #endif |
31 | 34 |
32 using content::BrowserThread; | 35 using content::BrowserThread; |
33 | 36 |
34 namespace extensions { | 37 namespace extensions { |
35 | 38 |
36 TestExtensionSystem::TestExtensionSystem(Profile* profile) | 39 TestExtensionSystem::TestExtensionSystem(Profile* profile) |
37 : profile_(profile), | 40 : profile_(profile), |
38 store_factory_(new TestValueStoreFactory()), | 41 store_factory_(new TestValueStoreFactory()), |
39 info_map_(new InfoMap()), | 42 info_map_(new InfoMap()), |
40 quota_service_(new QuotaService()), | 43 quota_service_(new QuotaService()), |
41 app_sorting_(new ChromeAppSorting(profile_)) {} | 44 app_sorting_(new ChromeAppSorting(profile_)) { |
| 45 #if defined(OS_CHROMEOS) |
| 46 if (!user_manager::UserManager::IsInitialized()) |
| 47 test_user_manager_.reset(new chromeos::ScopedTestUserManager); |
| 48 #endif |
| 49 } |
42 | 50 |
43 TestExtensionSystem::~TestExtensionSystem() { | 51 TestExtensionSystem::~TestExtensionSystem() { |
44 } | 52 } |
45 | 53 |
46 void TestExtensionSystem::Shutdown() { | 54 void TestExtensionSystem::Shutdown() { |
47 if (extension_service_) | 55 if (extension_service_) |
48 extension_service_->Shutdown(); | 56 extension_service_->Shutdown(); |
49 } | 57 } |
50 | 58 |
51 ExtensionService* TestExtensionSystem::CreateExtensionService( | 59 ExtensionService* TestExtensionSystem::CreateExtensionService( |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 content::BrowserContext* profile) { | 152 content::BrowserContext* profile) { |
145 return base::WrapUnique( | 153 return base::WrapUnique( |
146 new TestExtensionSystem(static_cast<Profile*>(profile))); | 154 new TestExtensionSystem(static_cast<Profile*>(profile))); |
147 } | 155 } |
148 | 156 |
149 void TestExtensionSystem::RecreateAppSorting() { | 157 void TestExtensionSystem::RecreateAppSorting() { |
150 app_sorting_.reset(new ChromeAppSorting(profile_)); | 158 app_sorting_.reset(new ChromeAppSorting(profile_)); |
151 } | 159 } |
152 | 160 |
153 } // namespace extensions | 161 } // namespace extensions |
OLD | NEW |