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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: extensions/test/service_registration_manager_test_api.cc
diff --git a/extensions/test/service_registration_manager_test_api.cc b/extensions/test/service_registration_manager_test_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d660f2c4560d996bb397125c4c06d0294beae066
--- /dev/null
+++ b/extensions/test/service_registration_manager_test_api.cc
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/test/service_registration_manager_test_api.h"
+
+namespace extensions {
+namespace internal {
+
+TestServiceRegistrationManager::TestServiceRegistrationManager() {
+}
+
+TestServiceRegistrationManager::~TestServiceRegistrationManager() {
+}
+
+void TestServiceRegistrationManager::AddServiceToServiceRegistry(
+ content::ServiceRegistry* service_registry,
+ ServiceFactoryBase* factory) {
+ auto test_factory = test_factories_.find(factory->GetName());
+ if (test_factory != test_factories_.end()) {
+ test_factory->second->Register(service_registry);
+ } else {
+ ServiceRegistrationManager::AddServiceToServiceRegistry(service_registry,
+ factory);
+ }
+}
+
+} // namespace internal
+
+ServiceRegistrationManagerTestApi::ServiceRegistrationManagerTestApi() {
+ ServiceRegistrationManager::SetServiceRegistrationManagerForTest(
+ &service_registration_manager_);
+}
+
+ServiceRegistrationManagerTestApi::~ServiceRegistrationManagerTestApi() {
+ ServiceRegistrationManager::ClearServiceRegistrationManagerForTest();
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698