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

Side by Side Diff: LayoutTests/fast/encoding/api/fatal-flag.html

Issue 15901002: Implement Encoding API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline webexposed global constructor tests Created 7 years, 4 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
(Empty)
1 <!DOCTYPE html>
2 <script src="../../js/resources/js-test-pre.js"></script>
3 <script>
4
5 description("Test the Encoding API's 'fatal' flag");
6
7 var bad = [
8 { encoding: 'utf-8', input: "[0xC0]" }, // ends early
9 { encoding: 'utf-8', input: "[0xC0, 0x00]" }, // invalid trail
10 { encoding: 'utf-8', input: "[0xC0, 0xC0]" }, // invalid trail
11 { encoding: 'utf-8', input: "[0xE0]" }, // ends early
12 { encoding: 'utf-8', input: "[0xE0, 0x00]" }, // invalid trail
13 { encoding: 'utf-8', input: "[0xE0, 0xC0]" }, // invalid trail
14 { encoding: 'utf-8', input: "[0xE0, 0x80, 0x00]" }, // invalid trail
15 { encoding: 'utf-8', input: "[0xE0, 0x80, 0xC0]" }, // invalid trail
16 { encoding: 'utf-8', input: "[0xFC, 0x80, 0x80, 0x80, 0x80, 0x80]" }, // > 0 x10FFFF
17 { encoding: 'utf-16', input: "[0x00]" }, // truncated code unit
18 { encoding: 'utf-16', input: "[0x00, 0xd8]" }, // surrogate half
19 { encoding: 'utf-16', input: "[0x00, 0xd8, 0x00, 0x00]" }, // surrogate half
20 { encoding: 'utf-16', input: "[0x00, 0xdc, 0x00, 0x00]" }, // trail surrogat e
21 { encoding: 'utf-16', input: "[0x00, 0xdc, 0x00, 0xd8]" } // swapped surrog ates
22 // FIXME: Legacy encoding cases
23 ];
24
25 bad.forEach(function(t) {
26 shouldThrow("new TextDecoder('" + t.encoding + "', {fatal: true}).decode(new Uint8Array(" + t.input + "))");
27 });
28
29 </script>
30 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/encoding/api/end-of-file-expected.txt ('k') | LayoutTests/fast/encoding/api/fatal-flag-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698