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="/gen/mojo/public/js/mojo_bindings.js"></script> |
| 6 <script src="/gen/mojo/public/interfaces/bindings/tests/echo_import.mojom.js"></
script> |
| 7 <script src="/gen/mojo/public/interfaces/bindings/tests/echo_service.mojom.js"><
/script> |
| 8 <script> |
| 9 |
| 10 promise_test(async () => { |
| 11 function EchoServiceImpl() {} |
| 12 EchoServiceImpl.prototype.echoPoint = function(point) { |
| 13 return Promise.resolve({result: point}); |
| 14 }; |
| 15 |
| 16 |
| 17 var echoServicePtr = new mojo.test.echo.EchoServicePtr(); |
| 18 var echoServiceBinding = new mojoBindings.Binding( |
| 19 mojo.test.echo.EchoService, |
| 20 new EchoServiceImpl(), |
| 21 mojoBindings.makeRequest(echoServicePtr)); |
| 22 var result = (await echoServicePtr.echoPoint({x: 1, y: 2})).result; |
| 23 assert_equals(1, result.x); |
| 24 assert_equals(2, result.y); |
| 25 }, "Basics"); |
| 26 |
| 27 </script> |
OLD | NEW |