OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | |
5 (Please avoid writing new tests using video-test.js) --> | |
6 <script src=video-test.js></script> | |
7 </head> | |
8 <body> | |
9 <p>Verify there is a 'durationchange' event just before 'ended' event if
the initially reported duration exceeds the actual data.</p> | |
10 <script> | |
11 var initialReportedDuration = -1; | |
12 | |
13 video = document.createElement('video'); | |
14 document.body.appendChild(video); | |
15 video.src = "content/truncated.webm"; | |
16 video.play(); | |
17 waitForEvent('durationchange', function() { | |
18 // Note the initial reported duration | |
19 if (initialReportedDuration == -1) | |
20 initialReportedDuration = video.duration; | |
21 }); | |
22 | |
23 waitForEventAndEnd('ended', function() { | |
24 // Verify that the actual duration is less than | |
25 // the initial reported duration | |
26 testExpected("video.duration < initialReportedDuration", true); | |
27 }); | |
28 </script> | |
29 </body> | |
30 </html> | |
OLD | NEW |