| Index: third_party/WebKit/LayoutTests/http/tests/wasm/wasm_remote_postMessage_test.https.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_remote_postMessage_test.https.html b/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_remote_postMessage_test.https.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d648ebe6f3dc30a769547c48598ab4eef7c88ebf
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_remote_postMessage_test.https.html
|
| @@ -0,0 +1,40 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<script src="../resources/get-host-info.js"></script>
|
| +<script src="resources/load_wasm.js"></script>
|
| +<script>
|
| +promise_test(async function() {
|
| + var remote_loc = get_host_info().AUTHENTICATED_ORIGIN + "/wasm/resources/remote_frame.html";
|
| + var mod = await createWasmModule();
|
| + assert_true(mod instanceof WebAssembly.Module);
|
| + var remote;
|
| + await new Promise((resolve, reject) => {
|
| + var i = setInterval(()=>{
|
| + try {
|
| + remote.document;
|
| + } catch(e) {
|
| + clearInterval(i);
|
| + resolve();
|
| + }
|
| + }, 100);
|
| + remote = window.open("about:blank");
|
| + remote.opener = null;
|
| + remote.location = remote_loc;
|
| + });
|
| + var ans = await new Promise((resolve, reject) => {
|
| + remote.postMessage(mod, '*');
|
| + window.addEventListener("message",
|
| + function f(reply) {
|
| + resolve(reply.data);
|
| + window.removeEventListener("message", f);
|
| + }, false);
|
| + });
|
| + assert_equals(ans, "didn't make it");
|
| + ans = await new Promise((resolve, reject) => {
|
| + remote.postMessage("hi!", '*');
|
| + window.addEventListener("message", (reply) => resolve(reply.data), false);
|
| + });
|
| + assert_equals(ans, "hi!");
|
| +}, "cannot send wasm module to remote iframe");
|
| +</script>
|
|
|