| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |