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

Side by Side Diff: mojo/apps/js/bindings/connection_unittests.js

Issue 278093003: Break dependency on core from generated mojom.js files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Specialize Converter<gin::Handle<gin::HandleWrapper> > Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/bindings/js/core.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Mock out the support module to avoid depending on the message loop. 5 // Mock out the support module to avoid depending on the message loop.
6 define("mojo/public/js/bindings/support", ["timer"], function(timer) { 6 define("mojo/public/js/bindings/support", ["timer"], function(timer) {
7 var waitingCallbacks = []; 7 var waitingCallbacks = [];
8 8
9 function WaitCookie(id) { 9 function WaitCookie(id) {
10 this.id = id; 10 this.id = id;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 // Close the other end of the pipe. 168 // Close the other end of the pipe.
169 core.close(pipe.handle0); 169 core.close(pipe.handle0);
170 170
171 // Not observed yet because we haven't pumped events yet. 171 // Not observed yet because we haven't pumped events yet.
172 expect(connection1.encounteredError()).toBeFalsy(); 172 expect(connection1.encounteredError()).toBeFalsy();
173 173
174 var foo = new sample_service.Foo(); 174 var foo = new sample_service.Foo();
175 foo.bar = new sample_service.Bar(); 175 foo.bar = new sample_service.Bar();
176 // TODO(darin): crbug.com/357043: pass null in place of |foo| here. 176 // TODO(darin): crbug.com/357043: pass null in place of |foo| here.
177 connection1.remote.frobinate(foo, true, core.kInvalidHandle); 177 connection1.remote.frobinate(foo, true, null);
178 178
179 // Write failures are not reported. 179 // Write failures are not reported.
180 expect(connection1.encounteredError()).toBeFalsy(); 180 expect(connection1.encounteredError()).toBeFalsy();
181 181
182 // Pump events, and then we should start observing the closed pipe. 182 // Pump events, and then we should start observing the closed pipe.
183 mockSupport.pumpOnce(core.RESULT_OK); 183 mockSupport.pumpOnce(core.RESULT_OK);
184 184
185 expect(connection1.encounteredError()).toBeTruthy(); 185 expect(connection1.encounteredError()).toBeTruthy();
186 186
187 connection1.close(); 187 connection1.close();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 }).then(function() { 247 }).then(function() {
248 throw Error("Expected echoString to fail."); 248 throw Error("Expected echoString to fail.");
249 }, function(error) { 249 }, function(error) {
250 expect(error.message).toBe("Connection error: " + core.RESULT_UNKNOWN); 250 expect(error.message).toBe("Connection error: " + core.RESULT_UNKNOWN);
251 251
252 // Clean up. 252 // Clean up.
253 core.readMessage = origReadMessage; 253 core.readMessage = origReadMessage;
254 }); 254 });
255 } 255 }
256 }); 256 });
OLDNEW
« no previous file with comments | « no previous file | mojo/bindings/js/core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698