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

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

Issue 145973021: Implement "replacement" text encoding. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reworked tests, still WIP 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
(Empty)
1 <!DOCTYPE html>
2 <title>Encoding API: replacement encoding</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 test(function() {
9 assert_throws({name: 'TypeError'}, function() { new TextEncoder('replacement '); });
10 assert_throws({name: 'TypeError'}, function() { new TextDecoder('replacement '); });
11 }, 'The "replacement" label should not be a known encoding.');
12
13 encodings_table.forEach(function(section) {
14 section.encodings.filter(function(encoding) {
15 return encoding.name === 'replacement';
16 }).forEach(function(encoding) {
17 encoding.labels.forEach(function(label) {
18 test(function() {
19 assert_throws({name: 'TypeError'}, function() { new TextEncoder( 'replacement'); });
20 assert_throws({name: 'TypeError'}, function() { new TextDecoder( 'replacement'); });
21 }, 'Label for "replacement" should be rejected by API: ' + label);
22 });
23 });
24 });
25
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698