| 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/bindings/js/support", function() { | 6 define("mojo/bindings/js/support", function() { |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 exports.cancelWait = cancelWait; | 43 exports.cancelWait = cancelWait; |
| 44 exports.numberOfWaitingCallbacks = numberOfWaitingCallbacks; | 44 exports.numberOfWaitingCallbacks = numberOfWaitingCallbacks; |
| 45 exports.pumpOnce = pumpOnce; | 45 exports.pumpOnce = pumpOnce; |
| 46 return exports; | 46 return exports; |
| 47 }); | 47 }); |
| 48 | 48 |
| 49 define([ | 49 define([ |
| 50 "gin/test/expect", | 50 "gin/test/expect", |
| 51 "mojo/bindings/js/support", | 51 "mojo/bindings/js/support", |
| 52 "mojo/bindings/js/core", | 52 "mojo/bindings/js/core", |
| 53 "mojo/public/bindings/js/connection", | 53 "mojo/public/js/bindings/connection", |
| 54 "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom", | 54 "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom", |
| 55 "mojo/public/interfaces/bindings/tests/sample_service.mojom", | 55 "mojo/public/interfaces/bindings/tests/sample_service.mojom", |
| 56 "gc", | 56 "gc", |
| 57 ], function(expect, | 57 ], function(expect, |
| 58 mockSupport, | 58 mockSupport, |
| 59 core, | 59 core, |
| 60 connection, | 60 connection, |
| 61 sample_interfaces, | 61 sample_interfaces, |
| 62 sample_service, | 62 sample_service, |
| 63 gc) { | 63 gc) { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 connection1.remote.echoStrings("hello", "world", function(a, b) { | 232 connection1.remote.echoStrings("hello", "world", function(a, b) { |
| 233 echoedString = a + " " + b; | 233 echoedString = a + " " + b; |
| 234 }); | 234 }); |
| 235 | 235 |
| 236 mockSupport.pumpOnce(core.RESULT_OK); | 236 mockSupport.pumpOnce(core.RESULT_OK); |
| 237 | 237 |
| 238 expect(echoedString).toBe("hello world"); | 238 expect(echoedString).toBe("hello world"); |
| 239 } | 239 } |
| 240 }); | 240 }); |
| OLD | NEW |