| 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 { |
| 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 waitForEvent('play', play); | 31 waitForEvent('play', play); |
| 30 video.play(); | 32 video.play(); |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 var play = function() { | 35 var play = function() |
| 36 { |
| 34 video.controller.playbackRate = 2; | 37 video.controller.playbackRate = 2; |
| 35 waitForEventOnce('timeupdate', timeupdate); | 38 waitForEventOnce("playing", function() |
| 39 { |
| 40 waitForEventOnce("timeupdate", timeupdate); |
| 41 }); |
| 36 }; | 42 }; |
| 37 | 43 |
| 38 var timeupdate = function() { | 44 var timeupdate = function() |
| 45 { |
| 39 testExpected('video.currentTime', 0, '!='); | 46 testExpected('video.currentTime', 0, '!='); |
| 40 endTest(); | 47 endTest(); |
| 41 }; | 48 }; |
| 42 </script> | 49 </script> |
| 43 </head> | 50 </head> |
| 44 <body onload="start()"> | 51 <body onload="start()"> |
| 45 <video controls></video> | 52 <video controls></video> |
| 46 </body> | 53 </body> |
| 47 </html> | 54 </html> |
| OLD | NEW |