FileSystemBaseHandle-postMessage-MessagePort-windows.js (1361B)
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( 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.'); 17 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.'); 24 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.');