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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/wasm/wasm_remote_postMessage_test.https.html

Issue 2847063002: [wasm] Ensure postMessage doesn't work cross process. (Closed)
Patch Set: Renames/fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/wasm/resources/remote_frame.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/wasm/resources/remote_frame.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698