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

Unified Diff: extensions/test/test_service_registration_manager.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: fix windows build 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
« no previous file with comments | « extensions/test/test_service_registration_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/test_service_registration_manager.cc
diff --git a/extensions/test/test_service_registration_manager.cc b/extensions/test/test_service_registration_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b70457337ddf370a1dcf907e3e2da8a85feb5691
--- /dev/null
+++ b/extensions/test/test_service_registration_manager.cc
@@ -0,0 +1,29 @@
+// 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/test_service_registration_manager.h"
+
+namespace extensions {
+
+TestServiceRegistrationManager::TestServiceRegistrationManager() {
+ ServiceRegistrationManager::SetServiceRegistrationManagerForTest(this);
+}
+
+TestServiceRegistrationManager::~TestServiceRegistrationManager() {
+ ServiceRegistrationManager::SetServiceRegistrationManagerForTest(nullptr);
+}
+
+void TestServiceRegistrationManager::AddServiceToServiceRegistry(
+ content::ServiceRegistry* service_registry,
+ internal::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 extensions
« no previous file with comments | « extensions/test/test_service_registration_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698