diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-frames.js | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-frames.js')
-rw-r--r-- | testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-frames.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-frames.js b/testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-frames.js new file mode 100644 index 0000000000..1e77b89d77 --- /dev/null +++ b/testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-frames.js @@ -0,0 +1,40 @@ +'use strict'; + +// This script depends on the following scripts: +// /fs/resources/messaging-helpers.js +// /fs/resources/messaging-blob-helpers.js +// /fs/resources/messaging-serialize-helpers.js +// /fs/resources/test-helpers.js + +directory_test(async (t, root_dir) => { + const iframe = await add_iframe(t, {src: kDocumentMessageTarget}); + await do_post_message_test( + t, root_dir, /*receiver=*/ self, /*target=*/ iframe.contentWindow, + /*target_origin=*/ '*'); +}, 'Send and receive messages using a same origin iframe.'); + +directory_test(async (t, root_dir) => { + const iframe = await add_iframe(t, { + src: kDocumentMessageTarget, + sandbox: 'allow-scripts allow-same-origin' + }); + await do_post_message_test( + t, root_dir, /*receiver=*/ self, /*target=*/ iframe.contentWindow, + /*target_origin=*/ '*'); +}, 'Send and receive messages using a sandboxed same origin iframe.'); + +directory_test(async (t, root_dir) => { + const blob_url = await create_message_target_blob_url(t); + const iframe = await add_iframe(t, {src: blob_url}); + await do_post_message_test( + t, root_dir, /*receiver=*/ self, /*target=*/ iframe.contentWindow, + /*target_origin=*/ '*'); +}, 'Send and receive messages using a blob iframe.'); + +directory_test(async (t, root_dir) => { + const iframe_html = await create_message_target_html_without_subresources(t); + const iframe = await add_iframe(t, {srcdoc: iframe_html}); + await do_post_message_test( + t, root_dir, /*receiver=*/ self, /*target=*/ iframe.contentWindow, + /*target_origin=*/ '*'); +}, 'Send and receive messages using an iframe srcdoc.'); |