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 waitForEvent('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 value provided is infinite."'); | 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 value provided is infinite."'); | 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 value provided is not a number."'); | 19 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
value provided is infinite."'); | 20 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 v
alue provided is infinite."'); | 21 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 value
provided is not a number."'); | 22 testException("video.controller.playbackRate = NaN", '"TypeError
: Failed to set the \'playbackRate\' property on \'MediaController\': The provid
ed double value is non-finite."'); |
23 | 23 |
24 // Test that the controller rate sets the video rate. | 24 // Test that the controller rate sets the video rate. |
25 video.playbackRate = 0; | 25 video.playbackRate = 0; |
26 video.defaultPlaybackRate = 0; | 26 video.defaultPlaybackRate = 0; |
27 video.controller.playbackRate = 0; | 27 video.controller.playbackRate = 0; |
28 video.controller.defaultPlaybackRate = 0; | 28 video.controller.defaultPlaybackRate = 0; |
29 waitForEvent('play', play); | 29 waitForEvent('play', play); |
30 video.play(); | 30 video.play(); |
31 }; | 31 }; |
32 | 32 |
33 var play = function() { | 33 var play = function() { |
34 video.controller.playbackRate = 2; | 34 video.controller.playbackRate = 2; |
35 waitForEventOnce('timeupdate', timeupdate); | 35 waitForEventOnce('timeupdate', timeupdate); |
36 }; | 36 }; |
37 | 37 |
38 var timeupdate = function() { | 38 var timeupdate = function() { |
39 testExpected('video.currentTime', 0, '!='); | 39 testExpected('video.currentTime', 0, '!='); |
40 endTest(); | 40 endTest(); |
41 }; | 41 }; |
42 </script> | 42 </script> |
43 </head> | 43 </head> |
44 <body onload="start()"> | 44 <body onload="start()"> |
45 <video controls></video> | 45 <video controls></video> |
46 </body> | 46 </body> |
47 </html> | 47 </html> |
OLD | NEW |