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

Side by Side Diff: LayoutTests/fast/encoding/api/ascii-supersets.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
« no previous file with comments | « no previous file | LayoutTests/fast/encoding/api/ascii-supersets-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../js/resources/js-test-pre.js"></script>
3 <script src="resources/shared.js"></script>
4 <script>
5
6 description("Supersets of ASCII decode ASCII correctly");
7
8 encodings = legacy_encodings.slice();
9 encodings.unshift('utf-8');
10
11 // Encodings that have escape codes in 0x00-0x7F
12 var escape_codes = {
13 "hz-gb-2312": [ 0x7E ],
14 "iso-2022-jp": [ 0x1B ],
15 "iso-2022-kr": [ 0x0E, 0x0F, 0x1B ]
16 };
17
18 encodings.forEach(function (encoding) {
19 string = '';
20 decoded = null;
21 bytes = [];
22 for (var i = 0; i < 128; ++i) {
23 if (encoding in escape_codes && escape_codes[encoding].indexOf(i) !== -1 )
24 continue;
25 string += String.fromCharCode(i);
26 bytes.push(i);
27 }
28 evalAndLog("decoder = new TextDecoder('"+encoding+"')");
29 evalAndLog("decoded = decoder.decode(new Uint8Array(bytes))");
30 // encodeURIComponent ensures output is printable
31 shouldBe("encodeURIComponent(string)", "encodeURIComponent(decoded)");
32 });
33
34
35 </script>
36 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/encoding/api/ascii-supersets-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698