Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/extensions/test_extension_system.cc

Issue 14319002: Change AlarmManager to use ProfileKeyedAPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Got rid of kServiceIsNULLWhileTesting Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(base::Clock* clock) {
50 alarm_manager_.reset(new AlarmManager(profile_, clock));
51 }
52
53 void TestExtensionSystem::CreateSocketManager() { 49 void TestExtensionSystem::CreateSocketManager() {
54 // Note that we're intentionally creating the socket manager on the wrong 50 // Note that we're intentionally creating the socket manager on the wrong
55 // thread (not the IO thread). This is because we don't want to presume or 51 // thread (not the IO thread). This is because we don't want to presume or
56 // require that there be an IO thread in a lightweight test context. If we do 52 // require that there be an IO thread in a lightweight test context. If we do
57 // need thread-specific behavior someday, we'll probably need something like 53 // need thread-specific behavior someday, we'll probably need something like
58 // CreateSocketManagerOnThreadForTesting(thread_id). But not today. 54 // CreateSocketManagerOnThreadForTesting(thread_id). But not today.
59 BrowserThread::ID id; 55 BrowserThread::ID id;
60 CHECK(BrowserThread::GetCurrentThreadIdentifier(&id)); 56 CHECK(BrowserThread::GetCurrentThreadIdentifier(&id));
61 socket_manager_.reset(new ApiResourceManager<Socket>(id)); 57 socket_manager_.reset(new ApiResourceManager<Socket>(id));
62 } 58 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 Blacklist* TestExtensionSystem::blacklist() { 176 Blacklist* TestExtensionSystem::blacklist() {
181 return blacklist_.get(); 177 return blacklist_.get();
182 } 178 }
183 179
184 // static 180 // static
185 ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) { 181 ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) {
186 return new TestExtensionSystem(profile); 182 return new TestExtensionSystem(profile);
187 } 183 }
188 184
189 } // namespace extensions 185 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698