| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>TextTrackCue constructor</title> | 4 <title>TextTrackCue constructor</title> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <div id="log"></div> | 9 <div id="log"></div> |
| 10 <script> | 10 <script> |
| 11 test(function() | 11 test(function() |
| 12 { | 12 { |
| 13 assert_not_equals(TextTrackCue, VTTCue); | 13 assert_not_equals(TextTrackCue, VTTCue); |
| 14 }, "TextTrackCue and VTTCue are separate interfaces"); | 14 }, "TextTrackCue and VTTCue are separate interfaces"); |
| 15 test(function() | 15 test(function() |
| 16 { | 16 { |
| 17 » var cue = new TextTrackCue(0, 0, ""); | 17 assert_throws(new TypeError(), function() |
| 18 assert_true(cue instanceof TextTrackCue); | 18 { |
| 19 assert_true(cue instanceof VTTCue); | 19 new TextTrackCue(0, 0, ""); |
| 20 }, "TextTrackCue constructor returns a VTTCue"); | 20 }); |
| 21 test(function() | 21 }, "TextTrackCue constructor should not be supported"); |
| 22 { | |
| 23 try { | |
| 24 new TextTrackCue(0); | |
| 25 assert_unreached("Expected a TypeError"); | |
| 26 } catch (e) { | |
| 27 assert_true(e instanceof TypeError); | |
| 28 assert_equals(e.message, "Failed to construct 'TextTrackCue'
: 3 arguments required, but only 1 present."); | |
| 29 } | |
| 30 }, "When not fully applied, TextTrackCue constructor throws a TypeEr
ror"); | |
| 31 </script> | 22 </script> |
| 32 </body> | 23 </body> |
| 33 </html> | 24 </html> |
| OLD | NEW |