Index: mojo/public/cpp/bindings/associated_interface_ptr.h |
diff --git a/mojo/public/cpp/bindings/associated_interface_ptr.h b/mojo/public/cpp/bindings/associated_interface_ptr.h |
index e8e455ae3cc9e6df81099fc0c552d2c076a9f6f2..70ee75e9ab7e12d2713597aa4b85df014c6ee232 100644 |
--- a/mojo/public/cpp/bindings/associated_interface_ptr.h |
+++ b/mojo/public/cpp/bindings/associated_interface_ptr.h |
@@ -18,6 +18,8 @@ |
#include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" |
#include "mojo/public/cpp/bindings/associated_interface_request.h" |
#include "mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h" |
+#include "mojo/public/cpp/bindings/lib/multiplex_router.h" |
+#include "mojo/public/cpp/system/message_pipe.h" |
namespace mojo { |
@@ -209,6 +211,17 @@ AssociatedInterfaceRequest<Interface> GetProxy( |
return request; |
} |
+// Creates an associated interface proxy which casts its messages into the void. |
+template <typename Interface> |
+void GetDummyProxyForTesting(AssociatedInterfacePtr<Interface>* proxy) { |
+ MessagePipe pipe; |
+ scoped_refptr<internal::MultiplexRouter> router = |
+ new internal::MultiplexRouter(false, std::move(pipe.handle0), |
+ base::ThreadTaskRunnerHandle::Get()); |
+ std::unique_ptr<AssociatedGroup> group = router->CreateAssociatedGroup(); |
+ GetProxy(proxy, group.get()); |
+} |
+ |
} // namespace mojo |
#endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |