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

Unified Diff: third_party/WebKit/LayoutTests/fast/encoding/utf-16-lone-surrogates.html

Issue 2379333003: UTF-16 Decoder: Convert unpaired surrogates to replacement characters (Closed)
Patch Set: Rebase, switch test to testharness Created 4 years, 2 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: third_party/WebKit/LayoutTests/fast/encoding/utf-16-lone-surrogates.html
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/utf-16-lone-surrogates.html b/third_party/WebKit/LayoutTests/fast/encoding/utf-16-lone-surrogates.html
new file mode 100644
index 0000000000000000000000000000000000000000..5728b44e86f0c8e27581df291cb3150b2cf59212
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/encoding/utf-16-lone-surrogates.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<title>UTF-16 Decoding: Lone Surrogates</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="resources/char-decoding-utils.js"></script>
+<script>
+
+// Trailing U+0000 is used to force the encoder to process a buffered
+// lead surrogate since flushing does not occur at the end of streams.
+
+testDecode('utf-16', '%69%D8%D6%DE%00%00', 'U+D869/U+DED6/U+0000');
+testDecode('utf-16', '%D6%DE%69%D8%00%00', 'U+FFFD/U+FFFD/U+0000');
+testDecode('utf-16', '%69%D8%00%00', 'U+FFFD/U+0000');
+testDecode('utf-16', '%D6%DE%00%00', 'U+FFFD/U+0000');
+
+testDecode('utf-16be', '%D8%69%DE%D6%00%00', 'U+D869/U+DED6/U+0000');
+testDecode('utf-16be', '%DE%D6%D8%69%00%00', 'U+FFFD/U+FFFD/U+0000');
+testDecode('utf-16be', '%D8%69%00%00', 'U+FFFD/U+0000');
+testDecode('utf-16be', '%DE%D6%00%00', 'U+FFFD/U+0000');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698