Bug 1689708 [wpt PR 27396] - Refactor native_file_system -> file_system_access in...
[gecko.git] / testing / web-platform / tests / file-system-access / script-tests / FileSystemBaseHandle-postMessage-MessagePort-windows.js
blob78b3176bf813d037ed71fad75281ca8cf3e3e191
1 'use strict';
3 // This script depends on the following scripts:
4 //    /file-system-access/resources/messaging-helpers.js
5 //    /file-system-access/resources/messaging-blob-helpers.js
6 //    /file-system-access/resources/messaging-serialize-helpers.js
7 //    /file-system-access/resources/test-helpers.js
9 directory_test(
10     async (t, root_dir) => {
11       const child_window = await open_window(t, kDocumentMessageTarget);
12       await do_message_port_test(
13           t, root_dir, /*target=*/ child_window, /*target_origin=*/ '*');
14     },
15     'Send and receive messages using a message port in a same origin ' +
16         'window.');
18 directory_test(async (t, root_dir) => {
19   const blob_url = await create_message_target_blob_url(t);
20   const child_window = await open_window(t, blob_url);
21   await do_message_port_test(
22       t, root_dir, /*target=*/ child_window, /*target_origin=*/ '*');
23 }, 'Send and receive messages using a message port in a blob window.');
25 directory_test(
26     async (t, root_dir) => {
27       const url =
28           `${kDocumentMessageTarget}?pipe=header(Content-Security-Policy` +
29           ', sandbox allow-scripts allow-same-origin)';
30       const child_window = await open_window(t, url);
31       await do_message_port_test(
32           t, root_dir, /*target=*/ child_window, /*target_origin=*/ '*');
33     },
34     'Send and receive messages using a message port in a sandboxed same ' +
35         'origin window.');