Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The CompressionStream / DecompressionStream constructors incorrectly …
…throw when the parameter is not a String https://bugs.webkit.org/show_bug.cgi?id=244958 Reviewed by Youenn Fablet. * LayoutTests/imported/w3c/web-platform-tests/compression/decompression-constructor-error.tentative.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/compression/decompression-constructor-error.tentative.any.serviceworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/compression/decompression-constructor-error.tentative.any.sharedworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/compression/decompression-constructor-error.tentative.any.worker-expected.txt: * Source/WebCore/Modules/compression/DecompressionStream.js: (initializeDecompressionStream): Canonical link: https://commits.webkit.org/254411@main
- Loading branch information
Showing
16 changed files
with
48 additions
and
21 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...c/web-platform-tests/compression/compression-constructor-error.tentative.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
PASS non-string input should cause the constructor to throw | ||
|
1 change: 1 addition & 0 deletions
1
...orted/w3c/web-platform-tests/compression/compression-constructor-error.tentative.any.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
15 changes: 15 additions & 0 deletions
15
...mported/w3c/web-platform-tests/compression/compression-constructor-error.tentative.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// META: global=window,worker | ||
|
||
'use strict'; | ||
|
||
test(t => { | ||
assert_throws_js(TypeError, () => new CompressionStream('a'), 'constructor should throw'); | ||
}, '"a" should cause the constructor to throw'); | ||
|
||
test(t => { | ||
assert_throws_js(TypeError, () => new CompressionStream(), 'constructor should throw'); | ||
}, 'no input should cause the constructor to throw'); | ||
|
||
test(t => { | ||
assert_throws_js(Error, () => new CompressionStream({ toString() { throw Error(); } }), 'constructor should throw'); | ||
}, 'non-string input should cause the constructor to throw'); |
5 changes: 5 additions & 0 deletions
5
...-tests/compression/compression-constructor-error.tentative.any.serviceworker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
PASS non-string input should cause the constructor to throw | ||
|
1 change: 1 addition & 0 deletions
1
...platform-tests/compression/compression-constructor-error.tentative.any.serviceworker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
5 changes: 5 additions & 0 deletions
5
...m-tests/compression/compression-constructor-error.tentative.any.sharedworker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
PASS non-string input should cause the constructor to throw | ||
|
1 change: 1 addition & 0 deletions
1
...-platform-tests/compression/compression-constructor-error.tentative.any.sharedworker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
5 changes: 5 additions & 0 deletions
5
...latform-tests/compression/compression-constructor-error.tentative.any.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
PASS non-string input should cause the constructor to throw | ||
|
1 change: 1 addition & 0 deletions
1
...3c/web-platform-tests/compression/compression-constructor-error.tentative.any.worker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- This file is required for WebKit test infrastructure to run the templated test --> |
4 changes: 1 addition & 3 deletions
4
...web-platform-tests/compression/decompression-constructor-error.tentative.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
FAIL non-string input should cause the constructor to throw assert_throws_js: constructor should throw function "() => new DecompressionStream({ toString() { throw Error(); } })" threw object "TypeError: CompressionStream input must be a string." ("TypeError") expected instance of function "function Error() { | ||
[native code] | ||
}" ("Error") | ||
PASS non-string input should cause the constructor to throw | ||
|
4 changes: 1 addition & 3 deletions
4
...ests/compression/decompression-constructor-error.tentative.any.serviceworker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
FAIL non-string input should cause the constructor to throw assert_throws_js: constructor should throw function "() => new DecompressionStream({ toString() { throw Error(); } })" threw object "TypeError: CompressionStream input must be a string." ("TypeError") expected instance of function "function Error() { | ||
[native code] | ||
}" ("Error") | ||
PASS non-string input should cause the constructor to throw | ||
|
4 changes: 1 addition & 3 deletions
4
...tests/compression/decompression-constructor-error.tentative.any.sharedworker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
FAIL non-string input should cause the constructor to throw assert_throws_js: constructor should throw function "() => new DecompressionStream({ toString() { throw Error(); } })" threw object "TypeError: CompressionStream input must be a string." ("TypeError") expected instance of function "function Error() { | ||
[native code] | ||
}" ("Error") | ||
PASS non-string input should cause the constructor to throw | ||
|
4 changes: 1 addition & 3 deletions
4
...tform-tests/compression/decompression-constructor-error.tentative.any.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
|
||
PASS "a" should cause the constructor to throw | ||
PASS no input should cause the constructor to throw | ||
FAIL non-string input should cause the constructor to throw assert_throws_js: constructor should throw function "() => new DecompressionStream({ toString() { throw Error(); } })" threw object "TypeError: CompressionStream input must be a string." ("TypeError") expected instance of function "function Error() { | ||
[native code] | ||
}" ("Error") | ||
PASS non-string input should cause the constructor to throw | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters