OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <title>VTTCue constructor</title> | |
3 <script src=../../../../../resources/testharness.js></script> | |
4 <script src=../../../../../resources/testharnessreport.js></script> | |
5 <div id=log></div> | |
6 <script> | |
7 test(function() { | |
8 assert_throws(new TypeError, function() { new VTTCue(NaN, 0, 'foo'); }); | |
9 assert_throws(new TypeError, function() { new VTTCue(Infinity, 0, 'foo'); }) ; | |
10 assert_throws(new TypeError, function() { new VTTCue('tomorrow', 'christmas' , 'foo'); }); | |
philipj_slow
2015/01/19 08:49:36
s/christmas/0/ unless I'm missing a reason.
fs
2015/01/19 10:18:16
Yes, this was just my fun-loving (pun-loving?) sid
| |
11 }, document.title+', non-finite start time'); | |
12 test(function() { | |
13 assert_throws(new TypeError, function() { new VTTCue(0, NaN, 'foo'); }); | |
14 assert_throws(new TypeError, function() { new VTTCue(0, Infinity, 'foo'); }) ; | |
15 assert_throws(new TypeError, function() { new VTTCue(0, 'tomorrow', 'foo'); }); | |
16 }, document.title+', non-finite end time'); | |
17 test(function() { | |
18 var start = { valueOf: function() { return 42; } }; | |
19 var end = { valueOf: function() { return 84; } }; | |
20 var cue = new VTTCue(start, end, 'bar'); | |
21 assert_equals(cue.startTime, 42); | |
22 assert_equals(cue.endTime, 84); | |
23 assert_equals(cue.text, 'bar'); | |
24 }, document.title+', valueOf'); | |
25 </script> | |
OLD | NEW |