FileSystemBaseHandle-postMessage-windows.js (1291B)
1 'use strict'; 2 3 // This script depends on the following scripts: 4 // /fs/resources/messaging-helpers.js 5 // /fs/resources/messaging-blob-helpers.js 6 // /fs/resources/messaging-serialize-helpers.js 7 // /fs/resources/test-helpers.js 8 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.'); 15 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.'); 23 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.');