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

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

Issue 292243003: Encoding API: Expose 'fatal' and 'ignoreBOM' readonly attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Regen test results Created 6 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
« no previous file with comments | « no previous file | LayoutTests/fast/encoding/api/fatal-flag-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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Encoding API: Fatal flag</title> 2 <title>Encoding API: Fatal flag</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/shared.js"></script> 5 <script src="resources/shared.js"></script>
6 <script> 6 <script>
7 7
8 var bad = [ 8 var bad = [
9 { encoding: 'utf-8', input: [0xFF], name: 'invalid code' }, 9 { encoding: 'utf-8', input: [0xFF], name: 'invalid code' },
10 { encoding: 'utf-8', input: [0xC0], name: 'ends early' }, 10 { encoding: 'utf-8', input: [0xC0], name: 'ends early' },
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 ]; 55 ];
56 56
57 bad.forEach(function(t) { 57 bad.forEach(function(t) {
58 test(function() { 58 test(function() {
59 assert_throws({name: 'EncodingError'}, function() { 59 assert_throws({name: 'EncodingError'}, function() {
60 new TextDecoder(t.encoding, {fatal: true}).decode(new Uint8Array(t.i nput)) 60 new TextDecoder(t.encoding, {fatal: true}).decode(new Uint8Array(t.i nput))
61 }); 61 });
62 }, 'Fatal flag: ' + t.encoding + ' - ' + t.name); 62 }, 'Fatal flag: ' + t.encoding + ' - ' + t.name);
63 }); 63 });
64 64
65 test(function() {
66 assert_true('fatal' in new TextDecoder(), 'The fatal attribute should exist on TextDecoder.');
67 assert_equals(typeof new TextDecoder().fatal, 'boolean', 'The type of the f atal attribute should be boolean.');
68 assert_false(new TextDecoder().fatal, 'The fatal attribute should default to false.');
69 assert_true(new TextDecoder('utf-8', {fatal: true}).fatal, 'The fatal attrib ute can be set using an option.');
70
71 }, 'The fatal attribute of TextDecoder');
72
65 </script> 73 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/encoding/api/fatal-flag-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698