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

Side by Side Diff: extensions/test/service_registration_manager_test_api.cc

Issue 652313002: Enable the mojo-based serial API in the renderer behind a flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-js-natives-registration
Patch Set: rebase Created 6 years, 2 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
(Empty)
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.
4
5 #include "extensions/test/service_registration_manager_test_api.h"
6
7 namespace extensions {
8 namespace internal {
9
10 TestServiceRegistrationManager::TestServiceRegistrationManager() {
11 }
12
13 TestServiceRegistrationManager::~TestServiceRegistrationManager() {
14 }
15
16 void TestServiceRegistrationManager::AddServiceToServiceRegistry(
17 content::ServiceRegistry* service_registry,
18 ServiceFactoryBase* factory) {
19 auto test_factory = test_factories_.find(factory->GetName());
20 if (test_factory != test_factories_.end()) {
21 test_factory->second->Register(service_registry);
22 } else {
23 ServiceRegistrationManager::AddServiceToServiceRegistry(service_registry,
24 factory);
25 }
26 }
27
28 } // namespace internal
29
30 ServiceRegistrationManagerTestApi::ServiceRegistrationManagerTestApi() {
31 ServiceRegistrationManager::SetServiceRegistrationManagerForTest(
32 &service_registration_manager_);
33 }
34
35 ServiceRegistrationManagerTestApi::~ServiceRegistrationManagerTestApi() {
36 ServiceRegistrationManager::ClearServiceRegistrationManagerForTest();
37 }
38
39 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698