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

Side by Side Diff: LayoutTests/fast/encoding/api/utf16-surrogates-encode.html

Issue 644473006: Rename 'ScalarValueString' to 'USVString' to match Web IDL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/js/webidl-type-mapping.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Encoding API: ScalarValueString surrogate handling when encoding</title> 2 <title>Encoding API: USVString surrogate handling when 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 src="resources/shared.js"></script> 5 <script src="resources/shared.js"></script>
6 <script> 6 <script>
7 7
8 var bad = [ 8 var bad = [
9 { 9 {
10 input: '\uD800', 10 input: '\uD800',
11 expected: '\uFFFD', 11 expected: '\uFFFD',
12 name: 'lone surrogate lead' 12 name: 'lone surrogate lead'
(...skipping 25 matching lines...) Expand all
38 } 38 }
39 ]; 39 ];
40 40
41 var encoding = 'utf-8'; 41 var encoding = 'utf-8';
42 42
43 bad.forEach(function(t) { 43 bad.forEach(function(t) {
44 test(function() { 44 test(function() {
45 var encoded = new TextEncoder(encoding).encode(t.input); 45 var encoded = new TextEncoder(encoding).encode(t.input);
46 var decoded = new TextDecoder(encoding).decode(encoded); 46 var decoded = new TextDecoder(encoding).decode(encoded);
47 assert_equals(decoded, t.expected); 47 assert_equals(decoded, t.expected);
48 }, 'ScalarValueString handling: ' + t.name); 48 }, 'USVString handling: ' + t.name);
49 }); 49 });
50 50
51 test(function() { 51 test(function() {
52 assert_equals(new TextEncoder(encoding).encode().length, 0, 'Should default to empty string'); 52 assert_equals(new TextEncoder(encoding).encode().length, 0, 'Should default to empty string');
53 }, 'ScalarValueString default'); 53 }, 'USVString default');
54 54
55 </script> 55 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/js/webidl-type-mapping.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698