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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/extensions/api/alarms/alarm_manager.h" | 9 #include "chrome/browser/extensions/api/alarms/alarm_manager.h" |
10 #include "chrome/browser/extensions/api/messaging/message_service.h" | 10 #include "chrome/browser/extensions/api/messaging/message_service.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 void TestExtensionSystem::Shutdown() { | 41 void TestExtensionSystem::Shutdown() { |
42 extension_process_manager_.reset(); | 42 extension_process_manager_.reset(); |
43 } | 43 } |
44 | 44 |
45 void TestExtensionSystem::CreateExtensionProcessManager() { | 45 void TestExtensionSystem::CreateExtensionProcessManager() { |
46 extension_process_manager_.reset(ExtensionProcessManager::Create(profile_)); | 46 extension_process_manager_.reset(ExtensionProcessManager::Create(profile_)); |
47 } | 47 } |
48 | 48 |
49 void TestExtensionSystem::CreateAlarmManager( | 49 void TestExtensionSystem::CreateAlarmManager(base::Clock* clock) { |
50 AlarmManager::TimeProvider now) { | 50 alarm_manager_.reset(new AlarmManager(profile_, clock)); |
51 alarm_manager_.reset(new AlarmManager(profile_, now)); | |
52 } | 51 } |
53 | 52 |
54 void TestExtensionSystem::CreateSocketManager() { | 53 void TestExtensionSystem::CreateSocketManager() { |
55 // Note that we're intentionally creating the socket manager on the wrong | 54 // Note that we're intentionally creating the socket manager on the wrong |
56 // thread (not the IO thread). This is because we don't want to presume or | 55 // thread (not the IO thread). This is because we don't want to presume or |
57 // require that there be an IO thread in a lightweight test context. If we do | 56 // require that there be an IO thread in a lightweight test context. If we do |
58 // need thread-specific behavior someday, we'll probably need something like | 57 // need thread-specific behavior someday, we'll probably need something like |
59 // CreateSocketManagerOnThreadForTesting(thread_id). But not today. | 58 // CreateSocketManagerOnThreadForTesting(thread_id). But not today. |
60 BrowserThread::ID id; | 59 BrowserThread::ID id; |
61 CHECK(BrowserThread::GetCurrentThreadIdentifier(&id)); | 60 CHECK(BrowserThread::GetCurrentThreadIdentifier(&id)); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 Blacklist* TestExtensionSystem::blacklist() { | 180 Blacklist* TestExtensionSystem::blacklist() { |
182 return blacklist_.get(); | 181 return blacklist_.get(); |
183 } | 182 } |
184 | 183 |
185 // static | 184 // static |
186 ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) { | 185 ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) { |
187 return new TestExtensionSystem(profile); | 186 return new TestExtensionSystem(profile); |
188 } | 187 } |
189 | 188 |
190 } // namespace extensions | 189 } // namespace extensions |
OLD | NEW |