OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Mojo JavaScript bindings module loading tests</title> |
| 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="file:///gen/mojo/public/js/mojo_bindings.js"></script> |
| 6 <script src="file:///gen/mojo/public/interfaces/bindings/tests/echo_import.mojom
.js"></script> |
| 7 <script src="file:///gen/mojo/public/interfaces/bindings/tests/echo.mojom.js"></
script> |
| 8 <script> |
| 9 |
| 10 promise_test(async () => { |
| 11 function EchoImpl() {} |
| 12 EchoImpl.prototype.echoPoint = function(point) { |
| 13 return Promise.resolve({result: point}); |
| 14 }; |
| 15 |
| 16 var echoServicePtr = new test.echo.mojom.EchoPtr(); |
| 17 var echoServiceBinding = new mojoBindings.Binding( |
| 18 test.echo.mojom.Echo, |
| 19 new EchoImpl(), |
| 20 mojoBindings.makeRequest(echoServicePtr)); |
| 21 var result = (await echoServicePtr.echoPoint({x: 1, y: 2})).result; |
| 22 assert_equals(1, result.x); |
| 23 assert_equals(2, result.y); |
| 24 }, 'Basics'); |
| 25 |
| 26 </script> |
OLD | NEW |