summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fs/script-tests/FileSystemBaseHandle-postMessage-MessagePort-windows.js
blob: dceb250ebbf9e8760cddd5f8c870418e88d79444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'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 child_window = await open_window(t, kDocumentMessageTarget);
      await do_message_port_test(
          t, root_dir, /*target=*/ child_window, /*target_origin=*/ '*');
    },
    'Send and receive messages using a message port in a same origin ' +
        'window.');

directory_test(async (t, root_dir) => {
  const blob_url = await create_message_target_blob_url(t);
  const child_window = await open_window(t, blob_url);
  await do_message_port_test(
      t, root_dir, /*target=*/ child_window, /*target_origin=*/ '*');
}, 'Send and receive messages using a message port in a blob window.');

directory_test(
    async (t, root_dir) => {
      const url =
          `${kDocumentMessageTarget}?pipe=header(Content-Security-Policy` +
          ', sandbox allow-scripts allow-same-origin)';
      const child_window = await open_window(t, url);
      await do_message_port_test(
          t, root_dir, /*target=*/ child_window, /*target_origin=*/ '*');
    },
    'Send and receive messages using a message port in a sandboxed same ' +
        'origin window.');