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

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

Issue 2759563004: Mojo JS bindings: change module loading solution. (Closed)
Patch Set: add test module-loading.html Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/mojo/module-loading.html
diff --git a/third_party/WebKit/LayoutTests/mojo/module-loading.html b/third_party/WebKit/LayoutTests/mojo/module-loading.html
new file mode 100644
index 0000000000000000000000000000000000000000..5026b61864e48c04d703d3b035d789a53ca7b05d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/mojo/module-loading.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>Mojo JavaScript bindings module loading tests</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="/gen/mojo/public/js/mojo_bindings.js"></script>
+<script src="/gen/mojo/public/interfaces/bindings/tests/echo_import.mojom.js"></script>
+<script src="/gen/mojo/public/interfaces/bindings/tests/echo_service.mojom.js"></script>
+<script>
+
+promise_test(async () => {
+ function EchoServiceImpl() {}
+ EchoServiceImpl.prototype.echoPoint = function(point) {
+ return Promise.resolve({result: point});
+ };
+
+
+ var echoServicePtr = new mojo.test.echo.EchoServicePtr();
+ var echoServiceBinding = new mojoBindings.Binding(
+ mojo.test.echo.EchoService,
+ new EchoServiceImpl(),
+ mojoBindings.makeRequest(echoServicePtr));
+ var result = (await echoServicePtr.echoPoint({x: 1, y: 2})).result;
+ assert_equals(1, result.x);
+ assert_equals(2, result.y);
+}, "Basics");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698