OLD | NEW |
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> | 5 <script> |
6 | 6 |
7 var bad = [ | 7 var bad = [ |
8 { encoding: 'utf-8', input: [0xFF], name: 'invalid code' }, | 8 { encoding: 'utf-8', input: [0xFF], name: 'invalid code' }, |
9 { encoding: 'utf-8', input: [0xC0], name: 'ends early' }, | 9 { encoding: 'utf-8', input: [0xC0], name: 'ends early' }, |
10 { encoding: 'utf-8', input: [0xE0], name: 'ends early 2' }, | 10 { encoding: 'utf-8', input: [0xE0], name: 'ends early 2' }, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 test(function() { | 64 test(function() { |
65 assert_true('fatal' in new TextDecoder(), 'The fatal attribute should exist
on TextDecoder.'); | 65 assert_true('fatal' in new TextDecoder(), 'The fatal attribute should exist
on TextDecoder.'); |
66 assert_equals(typeof new TextDecoder().fatal, 'boolean', 'The type of the f
atal attribute should be boolean.'); | 66 assert_equals(typeof new TextDecoder().fatal, 'boolean', 'The type of the f
atal attribute should be boolean.'); |
67 assert_false(new TextDecoder().fatal, 'The fatal attribute should default to
false.'); | 67 assert_false(new TextDecoder().fatal, 'The fatal attribute should default to
false.'); |
68 assert_true(new TextDecoder('utf-8', {fatal: true}).fatal, 'The fatal attrib
ute can be set using an option.'); | 68 assert_true(new TextDecoder('utf-8', {fatal: true}).fatal, 'The fatal attrib
ute can be set using an option.'); |
69 | 69 |
70 }, 'The fatal attribute of TextDecoder'); | 70 }, 'The fatal attribute of TextDecoder'); |
71 | 71 |
72 </script> | 72 </script> |
OLD | NEW |