Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update encoding web-platform tests #48320

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: update encoding web-platform tests
  • Loading branch information
anonrig committed Jun 5, 2023
commit 14b7844b4c1180a914d19f00ba5691ada51d7895
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,7 @@ Last update:
- console: https://github.com/web-platform-tests/wpt/tree/767ae35464/console
- dom/abort: https://github.com/web-platform-tests/wpt/tree/d1f1ecbd52/dom/abort
- dom/events: https://github.com/web-platform-tests/wpt/tree/ab8999891c/dom/events
- encoding: https://github.com/web-platform-tests/wpt/tree/0c1b9d1622/encoding
- encoding: https://github.com/web-platform-tests/wpt/tree/a58bbf6d8c/encoding
- fetch/data-urls/resources: https://github.com/web-platform-tests/wpt/tree/7c79d998ff/fetch/data-urls/resources
- FileAPI: https://github.com/web-platform-tests/wpt/tree/1e432c4550/FileAPI
- hr-time: https://github.com/web-platform-tests/wpt/tree/34cafd797e/hr-time
Expand Down
20 changes: 20 additions & 0 deletions test/fixtures/wpt/encoding/streams/stringification-crash.html
Original file line number Diff line number Diff line change
@@ -0,0 1,20 @@
<!DOCTYPE html>
<html class="test-wait">
<script id="workerScript" type="text/worker">
// Blob will pass a huge Uint8Array object whose stringification will take long
const encoder = new TextEncoderStream()
const blob = new Blob([new ArrayBuffer(1338720)])
const writable = new WritableStream()
blob.stream().pipeThrough(encoder).pipeTo(writable)
// Wait a bit for the piping to start
Promise.resolve().then(() => postMessage('started'));
</script>
<script>
const worker = new Worker(URL.createObjectURL(new Blob([
document.getElementById("workerScript").textContent
])))
worker.onmessage = () => {
worker.terminate();
document.documentElement.classList.remove("test-wait");
};
</script>
10 changes: 6 additions & 4 deletions test/fixtures/wpt/encoding/unsupported-labels.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 167,13 @@
t.add_cleanup(() => {
frame.remove();
});
frame.src = "resources/text-plain-charset.py?label=" label;
// Intentionally use <meta> as Content-Type results in browser differences
// See /html/syntax/charset/inheritance-bogus-meta.html
frame.src = "resources/text-html-meta-charset.py?label=" label;
frame.onload = t.step_func_done(() => {
// If we ever change this default this needs adjusting accordingly.
assert_equals(frame.contentDocument.characterSet, "windows-1252");
assert_equals(frame.contentDocument.inputEncoding, "windows-1252");
// UTF-8 as it inherits from the parent document when unrecognized
assert_equals(frame.contentDocument.characterSet, "UTF-8");
assert_equals(frame.contentDocument.inputEncoding, "UTF-8");
});
document.body.append(frame);
}, `${label} is not supported by the Encoding Standard`);
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 16,7 @@
"path": "dom/events"
},
"encoding": {
"commit": "0c1b9d1622ae0f27f82d7f7d7a1e9e69d410a3ca",
"commit": "a58bbf6d8c0db1f1fd5352e846acb0754ee55567",
"path": "encoding"
},
"fetch/data-urls/resources": {
Expand Down