Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Unified Diff: LayoutTests/fast/encoding/api/end-of-file-expected.txt

Issue 23532016: Handle odd data lengths in UTF-16 decoder (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/encoding/api/end-of-file-expected.txt
diff --git a/LayoutTests/fast/encoding/api/end-of-file-expected.txt b/LayoutTests/fast/encoding/api/end-of-file-expected.txt
index 4835cae4fb48f015ac826a877f360510de6a9034..91cbe92b5a100dd1b4f2680e3fdc2d19604105b8 100644
--- a/LayoutTests/fast/encoding/api/end-of-file-expected.txt
+++ b/LayoutTests/fast/encoding/api/end-of-file-expected.txt
@@ -5,18 +5,25 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff])) threw exception EncodingError: The encoded data was not valid..
-Should not throw or hang:
-new TextDecoder('utf-8').decode(new Uint8Array([0xff]))
+PASS new TextDecoder('utf-8').decode(new Uint8Array([0xff])) is '�'
-FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) should throw an exception. Was .
+PASS new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) threw exception EncodingError: The encoded data was not valid..
-Should not throw or hang:
-new TextDecoder('utf-16le').decode(new Uint8Array([0x00]))
+PASS new TextDecoder('utf-16le').decode(new Uint8Array([0x00])) is '�'
-FAIL new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) should throw an exception. Was .
+PASS new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) threw exception EncodingError: The encoded data was not valid..
-Should not throw or hang:
-new TextDecoder('utf-16be').decode(new Uint8Array([0x00]));
+PASS new TextDecoder('utf-16be').decode(new Uint8Array([0x00])) is '�'
+
+Streaming cases:
+decoder = new TextDecoder('utf-16le', {fatal: true})
+odd = new Uint8Array([0x00])
+even = new Uint8Array([0x00, 0x00])
+
+PASS decoder.decode(odd, {stream: true}); decoder.decode(odd) did not throw exception.
+PASS decoder.decode(even, {stream: true}); decoder.decode(odd) threw exception EncodingError: The encoded data was not valid..
+PASS decoder.decode(odd, {stream: true}); decoder.decode(even) threw exception EncodingError: The encoded data was not valid..
+PASS decoder.decode(even, {stream: true}); decoder.decode(even) did not throw exception.
PASS successfullyParsed is true
TEST COMPLETE

Powered by Google App Engine
This is Rietveld 408576698