3 // This script depends on the following scripts:
4 // /native-file-system/resources/messaging-helpers.js
5 // /native-file-system/resources/messaging-blob-helpers.js
6 // /native-file-system/resources/messaging-serialize-helpers.js
7 // /native-file-system/resources/test-helpers.js
9 directory_test(async (t, root_dir) => {
10 const child_window = await open_window(t, kDocumentMessageTarget);
11 await do_post_message_test(
12 t, root_dir, /*receiver=*/ self, /*target=*/ child_window,
13 /*target_origin=*/ '*');
14 }, 'Send and receive messages using a same origin window.');
16 directory_test(async (t, root_dir) => {
17 const blob_url = await create_message_target_blob_url(t);
18 const child_window = await open_window(t, blob_url);
19 await do_post_message_test(
20 t, root_dir, /*receiver=*/ self, /*target=*/ child_window,
21 /*target_origin=*/ '*');
22 }, 'Send and receive messages using a blob window.');
24 directory_test(async (t, root_dir) => {
25 const url = `${kDocumentMessageTarget}?pipe=header(Content-Security-Policy` +
26 ', sandbox allow-scripts allow-same-origin)';
27 const child_window = await open_window(t, url);
28 await do_post_message_test(
29 t, root_dir, /*receiver=*/ self, /*target=*/ child_window,
30 /*target_origin=*/ '*');
31 }, 'Send and receive messages using a sandboxed same origin window.');