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