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

Side by Side Diff: LayoutTests/fast/encoding/api/streaming-decode.html

Issue 58533003: Move fast/js/resources files to resources. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../js/resources/js-test-pre.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/shared.js"></script> 3 <script src="resources/shared.js"></script>
4 <script> 4 <script>
5 5
6 description("Test streaming decoding using the Encoding API."); 6 description("Test streaming decoding using the Encoding API.");
7 7
8 evalAndLog("string = '\\x00123ABCabc\\x80\\xFF\\u0100\\u1000\\uFFFD\\uD800\\uDC0 0\\uDBFF\\uDFFF'"); 8 evalAndLog("string = '\\x00123ABCabc\\x80\\xFF\\u0100\\u1000\\uFFFD\\uD800\\uDC0 0\\uDBFF\\uDFFF'");
9 9
10 utf_encodings.forEach(function (encoding) { 10 utf_encodings.forEach(function (encoding) {
11 debug(""); 11 debug("");
12 evalAndLog("encoded = new TextEncoder('" + encoding + "').encode(string)"); 12 evalAndLog("encoded = new TextEncoder('" + encoding + "').encode(string)");
13 13
14 for (var len = 1; len <= 5; ++len) { 14 for (var len = 1; len <= 5; ++len) {
15 evalAndLog("out = ''"); 15 evalAndLog("out = ''");
16 evalAndLog("decoder = new TextDecoder('" + encoding + "')"); 16 evalAndLog("decoder = new TextDecoder('" + encoding + "')");
17 for (var i = 0; i < encoded.length; i += len) { 17 for (var i = 0; i < encoded.length; i += len) {
18 var sub = []; 18 var sub = [];
19 for (var j = i; j < encoded.length && j < i + len; ++j) { 19 for (var j = i; j < encoded.length && j < i + len; ++j) {
20 sub.push(encoded[j]); 20 sub.push(encoded[j]);
21 } 21 }
22 evalAndLog("out += decoder.decode(new Uint8Array(" + JSON.stringify( sub) + "), {stream: true})"); 22 evalAndLog("out += decoder.decode(new Uint8Array(" + JSON.stringify( sub) + "), {stream: true})");
23 } 23 }
24 evalAndLog("out += decoder.decode()"); 24 evalAndLog("out += decoder.decode()");
25 shouldBeEqualToString("out", string); 25 shouldBeEqualToString("out", string);
26 } 26 }
27 }); 27 });
28 28
29 </script> 29 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/encoding/api/legacy-encode.html ('k') | LayoutTests/fast/encoding/api/surrogate-pairs.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698