| 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>
|
|
|