Files
sousa-gecko/testing/web-platform/tests/encoding/single-byte-decoder-iframe.window.js
Ms2ger d153290d34 Bug 2052131 [wpt PR 60055] - Split single-byte-decoder.window.js, a=testonly
Automatic update from web-platform-tests
Split single-byte-decoder.window.js (#60055)

The tests that don't require an iframe are moved to a new .any.js test.
This is only running in the window scope for now, because it doesn't seem likely that running it in workers would catch more issues.
However, this change makes it easier to run the test against non-web runtimes.
--

wpt-commits: 82dd4748f275b50e8b0507c5ccb2725d972ec8a4
wpt-pr: 60055
2026-07-10 09:25:05 +00:00

22 lines
890 B
JavaScript

// META: timeout=long
// META: script=resources/encodings.js
// META: script=resources/single-byte-decoder.js
for (var i = 0, l = singleByteEncodings.length; i < l; i++) {
var encoding = singleByteEncodings[i]
for (var ii = 0, ll = encoding.labels.length; ii < ll; ii++) {
var label = encoding.labels[ii]
async_test(function(t) {
var frame = document.createElement("iframe"),
name = encoding.name;
frame.src = "resources/text-plain-charset.py?label=" + label
frame.onload = t.step_func_done(function() {
assert_equals(frame.contentDocument.characterSet, name)
assert_equals(frame.contentDocument.inputEncoding, name)
})
t.add_cleanup(function() { document.body.removeChild(frame) })
document.body.appendChild(frame)
}, encoding.name + ": " + label + " (document.characterSet and document.inputEncoding)")
}
}