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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 define("mojo/public/js/bindings/connector", [ 5 define("mojo/public/js/bindings/connector", [
6 "mojo/public/js/bindings/buffer", 6 "mojo/public/js/bindings/buffer",
7 "mojo/public/js/bindings/codec", 7 "mojo/public/js/bindings/codec",
8 "mojo/public/js/bindings/core", 8 "mojo/public/js/bindings/core",
9 "mojo/public/js/bindings/support", 9 "mojo/public/js/bindings/support",
10 ], function(buffer, codec, core, support) { 10 ], function(buffer, codec, core, support) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return; 97 return;
98 } 98 }
99 var messageBuffer = new buffer.Buffer(read.buffer); 99 var messageBuffer = new buffer.Buffer(read.buffer);
100 var message = new codec.Message(messageBuffer, read.handles); 100 var message = new codec.Message(messageBuffer, read.handles);
101 if (this.incomingReceiver_) { 101 if (this.incomingReceiver_) {
102 this.incomingReceiver_.accept(message); 102 this.incomingReceiver_.accept(message);
103 } 103 }
104 } 104 }
105 }; 105 };
106 106
107 // The TestConnector subclass is only intended to be used in unit tests. It
108 // enables delivering a message to the pipe's handle without an async wait.
109
110 function TestConnector(handle) {
111 Connector.call(this, handle);
112 }
113
114 TestConnector.prototype = Object.create(Connector.prototype);
115
116 TestConnector.prototype.waitToReadMore_ = function() {
117 };
118
119 TestConnector.prototype.deliverMessage = function() {
120 this.readMore_(core.RESULT_OK);
121 }
122
107 var exports = {}; 123 var exports = {};
108 exports.Connector = Connector; 124 exports.Connector = Connector;
125 exports.TestConnector = TestConnector;
109 return exports; 126 return exports;
110 }); 127 });
OLDNEW
« 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