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

Unified Diff: content/public/common/service_registry.h

Issue 1806843005: Promote {Add,Clear}ServiceOverrideForTesting to ServiceRegistry public interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nit. Created 4 years, 9 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 | « content/common/mojo/service_registry_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/service_registry.h
diff --git a/content/public/common/service_registry.h b/content/public/common/service_registry.h
index ad8aaf0dadac407f61959539f6341c6e49e6980f..41edc199ce7a78992a03e9e732b8f0e452a811f5 100644
--- a/content/public/common/service_registry.h
+++ b/content/public/common/service_registry.h
@@ -60,6 +60,18 @@ class CONTENT_EXPORT ServiceRegistry {
virtual void ConnectToRemoteService(const base::StringPiece& name,
mojo::ScopedMessagePipeHandle handle) = 0;
+ // Registers a local service factory to intercept ConnectToRemoteService
+ // requests instead of actually connecting to the remote registry. Used only
+ // for testing.
+ virtual void AddServiceOverrideForTesting(
+ const std::string& service_name,
+ const base::Callback<void(mojo::ScopedMessagePipeHandle)>&
+ service_factory) = 0;
+
+ // Removes all local service factories registered
+ // by AddServiceOverrideForTesting. Used only for testing.
+ virtual void ClearServiceOverridesForTesting() = 0;
+
private:
template <typename Interface>
static void ForwardToServiceFactory(
« no previous file with comments | « content/common/mojo/service_registry_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698