gecko-dev/testing/web-platform/tests/compression/decompression-constructor-error.tentative.any.js
rwaldron 73f17b2964 Bug 1853319 [wpt PR 41954] - Enable shadowrealm testing for compression api, a=testonly
Automatic update from web-platform-tests
Enable shadowrealm testing for compression api

--

wpt-commits: c82521cfa587505746a853a24d22589633825b10
wpt-pr: 41954
2023-09-28 14:56:49 +00:00

15 lines
569 B
JavaScript

// META: global=window,worker,shadowrealm
'use strict';
test(t => {
assert_throws_js(TypeError, () => new DecompressionStream('a'), 'constructor should throw');
}, '"a" should cause the constructor to throw');
test(t => {
assert_throws_js(TypeError, () => new DecompressionStream(), 'constructor should throw');
}, 'no input should cause the constructor to throw');
test(t => {
assert_throws_js(Error, () => new DecompressionStream({ toString() { throw Error(); } }), 'constructor should throw');
}, 'non-string input should cause the constructor to throw');