gecko-dev/testing/web-platform/tests/native-file-system/script-tests/FileSystemBaseHandle-postMessage-windows.js
Steve Becker cc70f1c415 Bug 1612783 [wpt PR 21544] - Split up Native File System postmessage() tests, a=testonly
Automatic update from web-platform-tests
Split up Native File System postmessage() tests

Splits each of the following tests into 3 separate tests to avoid
timeouts:

native_FileSystemBaseHandle-postMessage-manual.https.tentative.html
native_FileSystemBaseHandle-postMessage-MessagePort-manual.https.tentative.html

These tests take 5 to 7 seconds to pass, which is dangerously close to
the 7 second timeout.  A previous attempt added <meta timeout=long> to
address the timeouts.  However, wpt.py does not respect
<meta timeout=long> for tests with filenames that contain "manual".
The following bug requests a fix for wpt.py:

https://github.com/web-platform-tests/wpt/issues/21527

This change solves the timeout by splitting  each test into 3 groups:
iframe tests, window.open() tests and worker tests.  The change adds the
following 12 test files since each test runs twice, once for the native
file system and once for the virtual file system:

Native file system tests:

native_FileSystemBaseHandle-postMessage-frames-manual.https.tentative.html
native_FileSystemBaseHandle-postMessage-windows-manual.https.tentative.html
native_FileSystemBaseHandle-postMessage-workers-manual.https.tentative.html

native_FileSystemBaseHandle-postMessage-MessagePort-frames-manual.https.tentative.html
native_FileSystemBaseHandle-postMessage-MessagePort-windows-manual.https.tentative.html
native_FileSystemBaseHandle-postMessage-MessagePort-workers-manual.https.tentative.html

Virtual file system tests:

sandboxed_FileSystemBaseHandle-postMessage-frames.tentative.https.window.js
sandboxed_FileSystemBaseHandle-postMessage-windows.tentative.https.window.js
sandboxed_FileSystemBaseHandle-postMessage-workers.tentative.https.window.js

sandboxed_FileSystemBaseHandle-postMessage-MessagePort-frames.tentative.https.window.js
sandboxed_FileSystemBaseHandle-postMessage-MessagePort-windows.tentative.https.window.js
sandboxed_FileSystemBaseHandle-postMessage-MessagePort-workers.tentative.https.window.js

Bug: 1046634
Bug: 1044519
Change-Id: Ide552f708d7514e299a68887b91659ac2226018d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035055
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Steve Becker <stevebe@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#739069}

--

wpt-commits: b3be46db70265c5da74dff78ec057ade6036ef67
wpt-pr: 21544
2020-02-14 19:08:58 +00:00

31 lines
1.3 KiB
JavaScript

'use strict';
// This script depends on the following scripts:
// /native-file-system/resources/messaging-helpers.js
// /native-file-system/resources/messaging-blob-helpers.js
// /native-file-system/resources/messaging-serialize-helpers.js
// /native-file-system/resources/test-helpers.js
directory_test(async (t, root_dir) => {
const child_window = await open_window(t, kDocumentMessageTarget);
await do_post_message_test(
t, root_dir, /*receiver=*/ self, /*target=*/ child_window,
/*target_origin=*/ '*');
}, 'Send and receive messages using 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_post_message_test(
t, root_dir, /*receiver=*/ self, /*target=*/ child_window,
/*target_origin=*/ '*');
}, 'Send and receive messages using 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_post_message_test(
t, root_dir, /*receiver=*/ self, /*target=*/ child_window,
/*target_origin=*/ '*');
}, 'Send and receive messages using a sandboxed same origin window.');