| Index: LayoutTests/fast/encoding/api/end-of-file.html
|
| diff --git a/LayoutTests/fast/encoding/api/end-of-file.html b/LayoutTests/fast/encoding/api/end-of-file.html
|
| index 4c2fc59a70cad2929e06c6accda5d2b698d32266..9e375248126ed7453e5e70cf2168bebf6831b869 100644
|
| --- a/LayoutTests/fast/encoding/api/end-of-file.html
|
| +++ b/LayoutTests/fast/encoding/api/end-of-file.html
|
| @@ -7,22 +7,31 @@ description("Edge cases around non-fatal errors at EOF");
|
| shouldThrow("new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff]))");
|
|
|
| debug("");
|
| -debug("Should not throw or hang:");
|
| -evalAndLog("new TextDecoder('utf-8').decode(new Uint8Array([0xff]))");
|
| +shouldBe("new TextDecoder('utf-8').decode(new Uint8Array([0xff]))", "'\uFFFD'");
|
|
|
| debug("");
|
| shouldThrow("new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00]))");
|
|
|
| debug("");
|
| -debug("Should not throw or hang:");
|
| -evalAndLog("new TextDecoder('utf-16le').decode(new Uint8Array([0x00]))");
|
| +shouldBe("new TextDecoder('utf-16le').decode(new Uint8Array([0x00]))", "'\uFFFD'");
|
|
|
| debug("");
|
| shouldThrow("new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00]))");
|
|
|
| debug("");
|
| -debug("Should not throw or hang:");
|
| -evalAndLog("new TextDecoder('utf-16be').decode(new Uint8Array([0x00]));");
|
| +shouldBe("new TextDecoder('utf-16be').decode(new Uint8Array([0x00]))", "'\uFFFD'");
|
| +
|
| +debug("");
|
| +debug("Streaming cases:");
|
| +evalAndLog("decoder = new TextDecoder('utf-16le', {fatal: true})");
|
| +evalAndLog("odd = new Uint8Array([0x00])");
|
| +evalAndLog("even = new Uint8Array([0x00, 0x00])");
|
| +
|
| +debug("");
|
| +shouldNotThrow("decoder.decode(odd, {stream: true}); decoder.decode(odd)");
|
| +shouldThrow("decoder.decode(even, {stream: true}); decoder.decode(odd)");
|
| +shouldThrow("decoder.decode(odd, {stream: true}); decoder.decode(even)");
|
| +shouldNotThrow("decoder.decode(even, {stream: true}); decoder.decode(even)");
|
|
|
| </script>
|
| <script src="../../js/resources/js-test-post.js"></script>
|
|
|