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

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

Issue 1196733003: Remove duplicate Encoding API tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
(Empty)
1 <!DOCTYPE html>
2 <title>Encoding API: Legacy encodings</title>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="resources/shared.js"></script>
6 <script>
7
8 encodings_table.forEach(function(section) {
9 section.encodings.filter(function(encoding) {
10 return encoding.name !== 'replacement';
11 }).forEach(function(encoding) {
12 if (utf_encodings.indexOf(encoding.name) !== -1) {
13 test(function() {
14 assert_equals(new TextDecoder(encoding.name).encoding, encoding. name);
15 assert_equals(new TextEncoder(encoding.name).encoding, encoding. name);
16 }, 'UTF encodings are supported for encode and decode: ' + encoding. name);
17 } else {
18 test(function() {
19 assert_equals(new TextDecoder(encoding.name).encoding, encoding. name);
20 assert_throws({name: 'RangeError'}, function() { new TextEncoder (encoding.name); });
21 }, 'Non-UTF encodings supported only for decode, not encode: ' + enc oding.name);
22 }
23 });
24 });
25
26 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/encoding/api/latin-1.html ('k') | LayoutTests/fast/encoding/api/replacement-encoding.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698