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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/encoding/api-surrogates-utf8.html

Issue 2086283003: Update web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into wpt_import Created 4 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Encoding API: Invalid UTF-16 surrogates with UTF-8 encoding</title> 2 <title>Encoding API: Invalid UTF-16 surrogates with UTF-8 encoding</title>
3 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 6
7 var badStrings = [ 7 var badStrings = [
8 { 8 {
9 input: 'abc123', 9 input: 'abc123',
10 expected: [0x61, 0x62, 0x63, 0x31, 0x32, 0x33], 10 expected: [0x61, 0x62, 0x63, 0x31, 0x32, 0x33],
(...skipping 27 matching lines...) Expand all
38 { 38 {
39 input: '\uDC00\uD800', 39 input: '\uDC00\uD800',
40 expected: [0xef, 0xbf, 0xbd, 0xef, 0xbf, 0xbd], 40 expected: [0xef, 0xbf, 0xbd, 0xef, 0xbf, 0xbd],
41 decoded: '\uFFFD\uFFFD', 41 decoded: '\uFFFD\uFFFD',
42 name: 'Wrong order' 42 name: 'Wrong order'
43 } 43 }
44 ]; 44 ];
45 45
46 badStrings.forEach(function(t) { 46 badStrings.forEach(function(t) {
47 test(function() { 47 test(function() {
48 var encoded = new TextEncoder('utf-8').encode(t.input); 48 var encoded = new TextEncoder().encode(t.input);
49 assert_array_equals([].slice.call(encoded), t.expected); 49 assert_array_equals([].slice.call(encoded), t.expected);
50 assert_equals(new TextDecoder('utf-8').decode(encoded), t.decoded); 50 assert_equals(new TextDecoder('utf-8').decode(encoded), t.decoded);
51 }, 'Invalid surrogates encoded into UTF-8: ' + t.name); 51 }, 'Invalid surrogates encoded into UTF-8: ' + t.name);
52 }); 52 });
53 53
54 </script> 54 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698