Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Side by Side Diff: third_party/WebKit/LayoutTests/mojo/module-loading.html

Issue 2779493002: Mojo JS bindings: support auto-loading mojom.js deps. (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Mojo JavaScript bindings module loading tests</title> 2 <title>Mojo JavaScript bindings module loading tests</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 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> 6 <script src="file:///gen/mojo/public/interfaces/bindings/tests/echo.mojom.js"></ script>
8 <script> 7 <script>
9 8
10 promise_test(async () => { 9 promise_test(async () => {
11 function EchoImpl() {} 10 function EchoImpl() {}
12 EchoImpl.prototype.echoPoint = function(point) { 11 EchoImpl.prototype.echoPoint = function(point) {
13 return Promise.resolve({result: point}); 12 return Promise.resolve({result: point});
14 }; 13 };
15 14
16 var echoServicePtr = new test.echo.mojom.EchoPtr(); 15 var echoServicePtr = new test.echo.mojom.EchoPtr();
17 var echoServiceBinding = new mojo.Binding(test.echo.mojom.Echo, 16 var echoServiceBinding = new mojo.Binding(test.echo.mojom.Echo,
18 new EchoImpl(), 17 new EchoImpl(),
19 mojo.makeRequest(echoServicePtr)); 18 mojo.makeRequest(echoServicePtr));
20 var result = (await echoServicePtr.echoPoint({x: 1, y: 2})).result; 19 var result = (await echoServicePtr.echoPoint({x: 1, y: 2})).result;
21 assert_equals(1, result.x); 20 assert_equals(1, result.x);
22 assert_equals(2, result.y); 21 assert_equals(2, result.y);
23 }, 'Basics'); 22 }, 'Basics');
24 23
25 </script> 24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698