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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/bindings/js/connection", |
54 "mojo/public/bindings/tests/sample_interfaces.mojom", | 54 "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom", |
55 "mojo/public/bindings/tests/sample_service.mojom", | 55 "mojo/public/interfaces/bindings/tests/sample_service.mojom", |
56 ], function(expect, | 56 ], function(expect, |
57 mockSupport, | 57 mockSupport, |
58 core, | 58 core, |
59 connection, | 59 connection, |
60 sample_interfaces, | 60 sample_interfaces, |
61 sample_service) { | 61 sample_service) { |
62 testClientServer(); | 62 testClientServer(); |
63 testWriteToClosedPipe(); | 63 testWriteToClosedPipe(); |
64 testRequestResponse(); | 64 testRequestResponse(); |
65 this.result = "PASS"; | 65 this.result = "PASS"; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 connection1.remote.echoStrings("hello", "world", function(a, b) { | 229 connection1.remote.echoStrings("hello", "world", function(a, b) { |
230 echoedString = a + " " + b; | 230 echoedString = a + " " + b; |
231 }); | 231 }); |
232 | 232 |
233 mockSupport.pumpOnce(core.RESULT_OK); | 233 mockSupport.pumpOnce(core.RESULT_OK); |
234 | 234 |
235 expect(echoedString).toBe("hello world"); | 235 expect(echoedString).toBe("hello world"); |
236 } | 236 } |
237 }); | 237 }); |
OLD | NEW |