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() |
philipj_slow
2015/01/09 14:10:25
Both styles are OK by http://www.chromium.org/blin
| |
8 { | |
8 findMediaElement(); | 9 findMediaElement(); |
9 waitForEvent('canplay',canplay); | 10 waitForEventOnce('canplay',canplay); |
10 video.src = findMediaFile('video', 'content/test'); | 11 video.src = findMediaFile('video', 'content/test'); |
11 }; | 12 }; |
12 | 13 |
13 var canplay = function() { | 14 var canplay = function() |
15 { | |
14 video.mediaGroup = "group"; | 16 video.mediaGroup = "group"; |
15 | 17 |
16 // Test non-finite rates. | 18 // 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."'); | 19 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."'); | 20 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."'); | 21 testException("video.controller.defaultPlaybackRate = NaN", '"Ty peError: Failed to set the \'defaultPlaybackRate\' property on \'MediaController \': The provided double value is non-finite."'); |
20 testException("video.controller.playbackRate = -Infinity", '"Typ eError: Failed to set the \'playbackRate\' property on \'MediaController\': The provided double value is non-finite."'); | 22 testException("video.controller.playbackRate = -Infinity", '"Typ eError: Failed to set the \'playbackRate\' property on \'MediaController\': The provided double value is non-finite."'); |
21 testException("video.controller.playbackRate = Infinity", '"Type Error: Failed to set the \'playbackRate\' property on \'MediaController\': The p rovided double value is non-finite."'); | 23 testException("video.controller.playbackRate = Infinity", '"Type Error: Failed to set the \'playbackRate\' property on \'MediaController\': The p rovided double value is non-finite."'); |
22 testException("video.controller.playbackRate = NaN", '"TypeError : Failed to set the \'playbackRate\' property on \'MediaController\': The provid ed double value is non-finite."'); | 24 testException("video.controller.playbackRate = NaN", '"TypeError : Failed to set the \'playbackRate\' property on \'MediaController\': The provid ed double value is non-finite."'); |
23 | 25 |
24 // Test that the controller rate sets the video rate. | 26 // Test that the controller rate sets the video rate. |
25 video.playbackRate = 0; | 27 video.playbackRate = 0; |
26 video.defaultPlaybackRate = 0; | 28 video.defaultPlaybackRate = 0; |
27 video.controller.playbackRate = 0; | 29 video.controller.playbackRate = 0; |
28 video.controller.defaultPlaybackRate = 0; | 30 video.controller.defaultPlaybackRate = 0; |
29 | 31 |
30 // Wait for the seek initiated by the "bringing up to speed" | 32 // Wait for the seek initiated by the "bringing up to speed" |
31 // step to complete. | 33 // step to complete. |
32 waitForEventOnce('seeked', seeked); | 34 waitForEventOnce('seeked', seeked); |
33 }; | 35 }; |
34 | 36 |
35 var seeked = function() { | 37 var seeked = function() |
38 { | |
36 waitForEvent('play', play); | 39 waitForEvent('play', play); |
37 video.play(); | 40 video.play(); |
38 }; | 41 }; |
39 | 42 |
40 var play = function() { | 43 var play = function() |
44 { | |
41 video.controller.playbackRate = 2; | 45 video.controller.playbackRate = 2; |
42 waitForEventOnce('timeupdate', timeupdate); | 46 waitForEventOnce("playing", function() |
47 { | |
48 waitForEventOnce("timeupdate", timeupdate); | |
49 }); | |
43 }; | 50 }; |
44 | 51 |
45 var timeupdate = function() { | 52 var timeupdate = function() |
53 { | |
46 testExpected('video.currentTime', 0, '!='); | 54 testExpected('video.currentTime', 0, '!='); |
47 endTest(); | 55 endTest(); |
48 }; | 56 }; |
49 </script> | 57 </script> |
50 </head> | 58 </head> |
51 <body onload="start()"> | 59 <body onload="start()"> |
52 <video controls></video> | 60 <video controls></video> |
53 </body> | 61 </body> |
54 </html> | 62 </html> |
OLD | NEW |