1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/test/test_service_registration_manager.h"
9 TestServiceRegistrationManager::TestServiceRegistrationManager() {
10 ServiceRegistrationManager::SetServiceRegistrationManagerForTest(this);
13 TestServiceRegistrationManager::~TestServiceRegistrationManager() {
14 ServiceRegistrationManager::SetServiceRegistrationManagerForTest(nullptr);
17 void TestServiceRegistrationManager::AddServiceToServiceRegistry(
18 content::ServiceRegistry
* service_registry
,
19 internal::ServiceFactoryBase
* factory
) {
20 auto test_factory
= test_factories_
.find(factory
->GetName());
21 if (test_factory
!= test_factories_
.end()) {
22 test_factory
->second
->Register(service_registry
);
24 ServiceRegistrationManager::AddServiceToServiceRegistry(service_registry
,
29 } // namespace extensions