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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 Edge cases around non-fatal errors at EOF 1 Edge cases around non-fatal errors at EOF
2 2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ". 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ".
4 4
5 5
6 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff])) thre w exception EncodingError: The encoded data was not valid.. 6 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff])) thre w exception EncodingError: The encoded data was not valid..
7 7
8 Should not throw or hang: 8 PASS new TextDecoder('utf-8').decode(new Uint8Array([0xff])) is '�'
9 new TextDecoder('utf-8').decode(new Uint8Array([0xff]))
10 9
11 FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) s hould throw an exception. Was . 10 PASS new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) t hrew exception EncodingError: The encoded data was not valid..
12 11
13 Should not throw or hang: 12 PASS new TextDecoder('utf-16le').decode(new Uint8Array([0x00])) is '�'
14 new TextDecoder('utf-16le').decode(new Uint8Array([0x00]))
15 13
16 FAIL new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) s hould throw an exception. Was . 14 PASS new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) t hrew exception EncodingError: The encoded data was not valid..
17 15
18 Should not throw or hang: 16 PASS new TextDecoder('utf-16be').decode(new Uint8Array([0x00])) is '�'
19 new TextDecoder('utf-16be').decode(new Uint8Array([0x00])); 17
18 Streaming cases:
19 decoder = new TextDecoder('utf-16le', {fatal: true})
20 odd = new Uint8Array([0x00])
21 even = new Uint8Array([0x00, 0x00])
22
23 PASS decoder.decode(odd, {stream: true}); decoder.decode(odd) did not throw exce ption.
24 PASS decoder.decode(even, {stream: true}); decoder.decode(odd) threw exception E ncodingError: The encoded data was not valid..
25 PASS decoder.decode(odd, {stream: true}); decoder.decode(even) threw exception E ncodingError: The encoded data was not valid..
26 PASS decoder.decode(even, {stream: true}); decoder.decode(even) did not throw ex ception.
20 PASS successfullyParsed is true 27 PASS successfullyParsed is true
21 28
22 TEST COMPLETE 29 TEST COMPLETE
23 30
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698