Index: third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.js |
diff --git a/third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.js b/third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.js |
index ddecc4b14b4c513f3a0feb815891b6291a8f9c3f..140ad4c0802b60ffc719523a22263e4a99c88768 100644 |
--- a/third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.js |
+++ b/third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.js |
@@ -5,13 +5,11 @@ |
define('mojo/edk/js/tests/js_to_cpp_tests', [ |
'console', |
'mojo/edk/js/tests/js_to_cpp.mojom', |
- 'mojo/public/js/bindings', |
'mojo/public/js/connection', |
'mojo/public/js/connector', |
'mojo/public/js/core', |
-], function (console, jsToCpp, bindings, connection, connector, core) { |
- var retainedJsSide; |
- var retainedJsSideStub; |
+], function (console, jsToCpp, connection, connector, core) { |
+ var retainedConnection; |
var sampleData; |
var sampleMessage; |
var BAD_VALUE = 13; |
@@ -27,11 +25,6 @@ define('mojo/edk/js/tests/js_to_cpp_tests', [ |
JsSideConnection.prototype = |
Object.create(jsToCpp.JsSide.stubClass.prototype); |
- JsSideConnection.prototype.setCppSide = function(cppSide) { |
- this.cppSide_ = cppSide; |
- this.cppSide_.startTest(); |
- }; |
- |
JsSideConnection.prototype.ping = function (arg) { |
this.cppSide_.pingResponse(); |
}; |
@@ -210,7 +203,13 @@ define('mojo/edk/js/tests/js_to_cpp_tests', [ |
}, null); |
} |
- return function(jsSideRequestHandle) { |
+ function createCppSideConnection(handle, stubClass, proxyClass) { |
+ var c = new connection.Connection(handle, stubClass, proxyClass); |
+ c.local.cppSide_ = c.remote; |
+ return c; |
+ } |
+ |
+ return function(handle) { |
var i; |
sampleData = new Uint8Array(DATA_PIPE_PARAMS.capacityNumBytes); |
for (i = 0; i < sampleData.length; ++i) { |
@@ -220,9 +219,8 @@ define('mojo/edk/js/tests/js_to_cpp_tests', [ |
for (i = 0; i < sampleMessage.length; ++i) { |
sampleMessage[i] = 255 - i; |
} |
- retainedJsSideStub = |
- connection.bindHandleToStub(jsSideRequestHandle, jsToCpp.JsSide); |
- retainedJsSide = new JsSideConnection; |
- bindings.StubBindings(retainedJsSideStub).delegate = retainedJsSide; |
+ retainedConnection = createCppSideConnection( |
+ handle, JsSideConnection,jsToCpp.CppSide.proxyClass); |
+ retainedConnection.remote.startTest(); |
}; |
}); |