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

Unified Diff: mojo/public/js/bindings/connector.js

Issue 551293004: Mojo JS validation unit test should check Connection et al (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed GN build Created 6 years, 3 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 | « mojo/public/js/bindings/connection.js ('k') | mojo/public/js/bindings/router.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/bindings/connector.js
diff --git a/mojo/public/js/bindings/connector.js b/mojo/public/js/bindings/connector.js
index cf7c93b8773e0345bdf36d3646d31a8443f7a2df..495896d3b2a59200c28b86c3c4163a891035f523 100644
--- a/mojo/public/js/bindings/connector.js
+++ b/mojo/public/js/bindings/connector.js
@@ -104,7 +104,24 @@ define("mojo/public/js/bindings/connector", [
}
};
+ // The TestConnector subclass is only intended to be used in unit tests. It
+ // enables delivering a message to the pipe's handle without an async wait.
+
+ function TestConnector(handle) {
+ Connector.call(this, handle);
+ }
+
+ TestConnector.prototype = Object.create(Connector.prototype);
+
+ TestConnector.prototype.waitToReadMore_ = function() {
+ };
+
+ TestConnector.prototype.deliverMessage = function() {
+ this.readMore_(core.RESULT_OK);
+ }
+
var exports = {};
exports.Connector = Connector;
+ exports.TestConnector = TestConnector;
return exports;
});
« no previous file with comments | « mojo/public/js/bindings/connection.js ('k') | mojo/public/js/bindings/router.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698