OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src=media-file.js></script> | 4 <script src=media-file.js></script> |
5 <script src=video-test.js></script> | 5 <script src=video-test.js></script> |
6 <script> | 6 <script> |
7 var start = function() { | 7 var start = function() { |
8 findMediaElement(); | 8 findMediaElement(); |
9 waitForEvent('canplay',canplay); | 9 waitForEventOnce('canplay',canplay); |
10 video.src = findMediaFile('video', 'content/test'); | 10 video.src = findMediaFile('video', 'content/test'); |
11 }; | 11 }; |
12 | 12 |
13 var canplay = function() { | 13 var canplay = function() { |
14 video.mediaGroup = "group"; | 14 video.mediaGroup = "group"; |
15 | 15 |
16 // Test non-finite rates. | 16 // Test non-finite rates. |
17 testException("video.controller.defaultPlaybackRate = -Infinity"
, '"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaCont
roller\': The provided double value is non-finite."'); | 17 testException("video.controller.defaultPlaybackRate = -Infinity"
, '"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaCont
roller\': The provided double value is non-finite."'); |
18 testException("video.controller.defaultPlaybackRate = Infinity",
'"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaContr
oller\': The provided double value is non-finite."'); | 18 testException("video.controller.defaultPlaybackRate = Infinity",
'"TypeError: Failed to set the \'defaultPlaybackRate\' property on \'MediaContr
oller\': The provided double value is non-finite."'); |
19 testException("video.controller.defaultPlaybackRate = NaN", '"Ty
peError: Failed to set the \'defaultPlaybackRate\' property on \'MediaController
\': The provided double value is non-finite."'); | 19 testException("video.controller.defaultPlaybackRate = NaN", '"Ty
peError: Failed to set the \'defaultPlaybackRate\' property on \'MediaController
\': The provided double value is non-finite."'); |
(...skipping 12 matching lines...) Expand all Loading... |
32 waitForEventOnce('seeked', seeked); | 32 waitForEventOnce('seeked', seeked); |
33 }; | 33 }; |
34 | 34 |
35 var seeked = function() { | 35 var seeked = function() { |
36 waitForEvent('play', play); | 36 waitForEvent('play', play); |
37 video.play(); | 37 video.play(); |
38 }; | 38 }; |
39 | 39 |
40 var play = function() { | 40 var play = function() { |
41 video.controller.playbackRate = 2; | 41 video.controller.playbackRate = 2; |
42 waitForEventOnce('timeupdate', timeupdate); | 42 waitForEventOnce("playing", playing); |
| 43 }; |
| 44 |
| 45 var playing = function() { |
| 46 waitForEventOnce("timeupdate", timeupdate); |
43 }; | 47 }; |
44 | 48 |
45 var timeupdate = function() { | 49 var timeupdate = function() { |
46 testExpected('video.currentTime', 0, '!='); | 50 testExpected('video.currentTime', 0, '!='); |
47 endTest(); | 51 endTest(); |
48 }; | 52 }; |
49 </script> | 53 </script> |
50 </head> | 54 </head> |
51 <body onload="start()"> | 55 <body onload="start()"> |
52 <video controls></video> | 56 <video controls></video> |
53 </body> | 57 </body> |
54 </html> | 58 </html> |
OLD | NEW |