Index: mojo/public/cpp/bindings/tests/test_bindings_utils.h |
diff --git a/mojo/public/cpp/bindings/tests/test_bindings_utils.h b/mojo/public/cpp/bindings/tests/test_bindings_utils.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..344628d06dc1c1b9ef762eba04d444412b2f5622 |
--- /dev/null |
+++ b/mojo/public/cpp/bindings/tests/test_bindings_utils.h |
@@ -0,0 +1,26 @@ |
+// 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. |
+ |
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_TEST_BINDINGS_UTILS_H_ |
+#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_TEST_BINDINGS_UTILS_H_ |
+ |
+#include "mojo/public/cpp/bindings/interface_ptr.h" |
+ |
+namespace mojo { |
+namespace test { |
+ |
+template <typename InterfaceImpl, typename Interface> |
+void MakeRemote(InterfaceImpl* impl, InterfacePtr<Interface>* ptr) { |
+ MessagePipe pipe; |
+ ptr->ConfigureProxy(pipe.handle0.Pass()); |
+ |
+ InterfacePtr<Interface> server(impl); |
+ server.ConfigureStub(pipe.handle1.Pass()); |
+ server.Detach(); |
+} |
+ |
+} // namespace test |
+} // namespace mojo |
+ |
+#endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_TEST_BINDINGS_UTILS_H_ |