| Index: LayoutTests/fast/encoding/api/latin-1.html
|
| diff --git a/LayoutTests/fast/encoding/api/latin-1.html b/LayoutTests/fast/encoding/api/latin-1.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b40ad37d335cffebc770c29b901d9835c9190ab6
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/encoding/api/latin-1.html
|
| @@ -0,0 +1,38 @@
|
| +B<!DOCTYPE html>
|
| +<script src="../../js/resources/js-test-pre.js"></script>
|
| +<script src="resources/shared.js"></script>
|
| +<script>
|
| +
|
| +description("Verify that Latin-1 decoders (windows-1252, iso-8859-1, us-ascii, etc) decode identically.");
|
| +
|
| +// Blink uses separate decoder object intances for these encoding aliases,
|
| +// so test that they are behaving identically.
|
| +
|
| +var labels;
|
| +encodings_table.forEach(function(section) {
|
| + section.encodings.forEach(function(encoding) {
|
| + if (encoding.name === "windows-1252")
|
| + labels = encoding.labels;
|
| + });
|
| +});
|
| +labels = labels.filter(function(label) { return label !== 'windows-1252'; });
|
| +
|
| +evalAndLog("array = new Uint8Array(256)");
|
| +debug("initialize array to 0...255");
|
| +for (var cp = 0; cp <= 255; ++cp) {
|
| + array[cp] = cp;
|
| +}
|
| +
|
| +evalAndLog("windows1252 = new TextDecoder('windows-1252')");
|
| +
|
| +labels.forEach(function(label) {
|
| + decoder = null;
|
| + evalAndLog("decoder = new TextDecoder(" + JSON.stringify(label) + ")");
|
| + // Above may throw if encoding unsupported.
|
| + if (decoder) {
|
| + shouldBe("decoder.decode(array)", "windows1252.decode(array)");
|
| + }
|
| +});
|
| +
|
| +</script>
|
| +<script src="../../js/resources/js-test-post.js"></script>
|
|
|