Commit 265f3a34 authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Add fast test for whether transferable streams are enabled

Add a minimal test for whether transferable streams are functioning or
not. This can be used to determine whether they have been shipped or
not. The test is in its own directory so that it can be added to the
virtual/stable test suite without any other tests.

This will ensure we don't accidentally ship transferable streams.

BUG=894838

Change-Id: I2de66a55fc1c72ddd742f1d192a152a9264064df
Reviewed-on: https://chromium-review.googlesource.com/c/1356723
Commit-Queue: Adam Rice <ricea@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613060}
parent bc505b9f
......@@ -210,6 +210,11 @@
"base": "web-animations-api",
"args": ["--stable-release-mode"]
},
{
"prefix": "stable",
"base": "http/tests/streams/transferable/enabled",
"args": ["--stable-release-mode"]
},
{
"prefix": "linux-subpixel",
"base": "platform/linux/fast/text/subpixel",
......
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// Quick test for whether transferable streams are enabled or not, since it
// doesn't affect the symbols visible on the global object. When not enabled,
// all the tests should fail. This will help prevent accidentally shipping the
// feature.
test(() => {
const rs = new ReadableStream();
postMessage(rs, '*', [rs]);
}, 'postMessage of a ReadableStream should work');
test(() => {
const ws = new WritableStream();
postMessage(ws, '*', [ws]);
}, 'postMessage of a WritableStream should work');
test(() => {
const ts = new TransformStream();
postMessage(ts, '*', [ts]);
}, 'postMessage of a TransformStream should work');
</script>
This test exists to ensure that transferable streams are not shipped by
accident. If all three subtests are failing, then transferable streams are not
enabled.
This is a testharness.js-based test.
FAIL postMessage of a ReadableStream should work Failed to execute 'postMessage' on 'Window': Value at index 0 does not have a transferable type.
FAIL postMessage of a WritableStream should work Failed to execute 'postMessage' on 'Window': Value at index 0 does not have a transferable type.
FAIL postMessage of a TransformStream should work Failed to execute 'postMessage' on 'Window': Value at index 0 does not have a transferable type.
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment