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

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

Issue 261013007: Prevent direct use of "replacement" text encoding. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: MSVC fix 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
« no previous file with comments | « no previous file | LayoutTests/fast/encoding/api/replacement-encoding-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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( label); });
20 assert_throws({name: 'TypeError'}, function() { new TextDecoder( label); });
21 }, 'Label for "replacement" should be rejected by API: ' + label);
22 });
23 });
24 });
25
26 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/encoding/api/replacement-encoding-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698