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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding/api-replacement-encodings.html

Issue 1899623002: Import latest web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle new failures Created 4 years, 8 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: replacement encoding</title> 2 <title>Encoding API: replacement 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/encodings.js"></script> 5 <script src="resources/encodings.js"></script>
6 <script> 6 <script>
7 7
8 test(function() { 8 test(function() {
9 assert_throws(new RangeError(), function() { new TextEncoder('replacement'); });
10 assert_throws(new RangeError(), function() { new TextDecoder('replacement'); }); 9 assert_throws(new RangeError(), function() { new TextDecoder('replacement'); });
11 }, 'The "replacement" label should not be a known encoding.'); 10 }, 'The "replacement" label should not be a known encoding.');
12 11
13 encodings_table.forEach(function(section) { 12 encodings_table.forEach(function(section) {
14 section.encodings.filter(function(encoding) { 13 section.encodings.filter(function(encoding) {
15 return encoding.name === 'replacement'; 14 return encoding.name === 'replacement';
16 }).forEach(function(encoding) { 15 }).forEach(function(encoding) {
17 encoding.labels.forEach(function(label) { 16 encoding.labels.forEach(function(label) {
18 test(function() { 17 test(function() {
19 assert_throws(new RangeError(), function() { new TextEncoder(lab el); });
20 assert_throws(new RangeError(), function() { new TextDecoder(lab el); }); 18 assert_throws(new RangeError(), function() { new TextDecoder(lab el); });
21 }, 'Label for "replacement" should be rejected by API: ' + label); 19 }, 'Label for "replacement" should be rejected by API: ' + label);
22 }); 20 });
23 }); 21 });
24 }); 22 });
25 23
26 </script> 24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698