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

Side by Side Diff: LayoutTests/fast/encoding/api/encoding-names.html

Issue 240283013: Convert Encoding API tests to W3C testharness.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move UTF-16 surrogate tests to separate file Created 6 years, 7 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script> 2 <title>Encoding API: Encoding names</title>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="resources/shared.js"></script>
3 <script> 6 <script>
4 7
5 description("Test the Encoding API's use of encoding names"); 8 test(function() {
6 9
7 debug("Encoding names are case insensitive"); 10 var encodings = [
8 var encodings = [ 11 { label: 'utf-8', encoding: 'utf-8' },
9 { label: 'utf-8', encoding: 'utf-8' }, 12 { label: 'utf-16', encoding: 'utf-16le' },
10 { label: 'utf-16', encoding: 'utf-16le' }, 13 { label: 'utf-16le', encoding: 'utf-16le' },
11 { label: 'utf-16le', encoding: 'utf-16le' }, 14 { label: 'utf-16be', encoding: 'utf-16be' },
12 { label: 'utf-16be', encoding: 'utf-16be' }, 15 { label: 'ascii', encoding: 'windows-1252' },
13 { label: 'ascii', encoding: 'windows-1252' }, 16 { label: 'iso-8859-1', encoding: 'windows-1252' }
14 { label: 'iso-8859-1', encoding: 'windows-1252' } 17 ];
15 ];
16 18
17 // encoding-labels.html tests the full set of names/labels; this test just 19 // encoding-labels.html tests the full set of names/labels; this test just
18 // exercises some common cases and case-insensitivity. 20 // exercises some common cases and case-insensitivity.
19 21
20 encodings.forEach(function(test) { 22 encodings.forEach(function(t) {
21 shouldBeEqualToString("new TextDecoder('" + test.label.toLowerCase() + "').e ncoding", test.encoding); 23 assert_equals(new TextDecoder(t.label.toLowerCase()).encoding, t.encodin g);
22 shouldBeEqualToString("new TextDecoder('" + test.label.toUpperCase() + "').e ncoding", test.encoding); 24 assert_equals(new TextDecoder(t.label.toUpperCase()).encoding, t.encodin g);
23 }); 25 });
26
27 }, 'Encoding labels are case-insensitive');
24 28
25 </script> 29 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/encoding/api/encoding-labels-expected.txt ('k') | LayoutTests/fast/encoding/api/encoding-names-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698