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

Unified Diff: LayoutTests/fast/encoding/api/streaming-decode.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, 5 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/streaming-decode.html
diff --git a/LayoutTests/fast/encoding/api/streaming-decode.html b/LayoutTests/fast/encoding/api/streaming-decode.html
new file mode 100644
index 0000000000000000000000000000000000000000..fea886458aa1a1f77eb8fc0b2a191eb72a3f2f45
--- /dev/null
+++ b/LayoutTests/fast/encoding/api/streaming-decode.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/shared.js"></script>
+<script>
+
+description("Test streaming decoding using the Encoding API.");
+
+evalAndLog("string = '\\x00123ABCabc\\x80\\xFF\\u0100\\u1000\\uFFFD\\uD800\\uDC00\\uDBFF\\uDFFF'");
+
+utf_encodings.forEach(function (encoding) {
+ debug("");
+ evalAndLog("encoded = new TextEncoder('" + encoding + "').encode(string)");
+
+ for (var len = 1; len <= 5; ++len) {
+ evalAndLog("out = ''");
+ evalAndLog("decoder = new TextDecoder('" + encoding + "')");
+ for (var i = 0; i < encoded.length; i += len) {
+ var sub = [];
+ for (var j = i; j < encoded.length && j < i + len; ++j) {
+ sub.push(encoded[j]);
+ }
+ evalAndLog("out += decoder.decode(new Uint8Array(" + JSON.stringify(sub) + "), {stream: true})");
+ }
+ evalAndLog("out += decoder.decode()");
+ shouldBeEqualToString("out", string);
+ }
+});
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
« no previous file with comments | « LayoutTests/fast/encoding/api/resources/shared.js ('k') | LayoutTests/fast/encoding/api/streaming-decode-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698