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

Unified Diff: third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.js

Issue 901843003: Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Partial revert of https://codereview.chromium.org/899993002/ Created 5 years, 10 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
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 140ad4c0802b60ffc719523a22263e4a99c88768..ddecc4b14b4c513f3a0feb815891b6291a8f9c3f 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,11 +5,13 @@
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, connection, connector, core) {
- var retainedConnection;
+], function (console, jsToCpp, bindings, connection, connector, core) {
+ var retainedJsSide;
+ var retainedJsSideStub;
var sampleData;
var sampleMessage;
var BAD_VALUE = 13;
@@ -25,6 +27,11 @@ 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();
};
@@ -203,13 +210,7 @@ define('mojo/edk/js/tests/js_to_cpp_tests', [
}, null);
}
- function createCppSideConnection(handle, stubClass, proxyClass) {
- var c = new connection.Connection(handle, stubClass, proxyClass);
- c.local.cppSide_ = c.remote;
- return c;
- }
-
- return function(handle) {
+ return function(jsSideRequestHandle) {
var i;
sampleData = new Uint8Array(DATA_PIPE_PARAMS.capacityNumBytes);
for (i = 0; i < sampleData.length; ++i) {
@@ -219,8 +220,9 @@ define('mojo/edk/js/tests/js_to_cpp_tests', [
for (i = 0; i < sampleMessage.length; ++i) {
sampleMessage[i] = 255 - i;
}
- retainedConnection = createCppSideConnection(
- handle, JsSideConnection,jsToCpp.CppSide.proxyClass);
- retainedConnection.remote.startTest();
+ retainedJsSideStub =
+ connection.bindHandleToStub(jsSideRequestHandle, jsToCpp.JsSide);
+ retainedJsSide = new JsSideConnection;
+ bindings.StubBindings(retainedJsSideStub).delegate = retainedJsSide;
};
});
« no previous file with comments | « third_party/mojo/src/mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | third_party/mojo/src/mojo/edk/system/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698