OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>test playbackRate and defaultPlaybackRate</title> | 4 <title>test playbackRate and defaultPlaybackRate</title> |
5 <script src=media-file.js></script> | 5 <script src=media-file.js></script> |
6 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
7 <script> | 7 <script> |
8 var rateChangeCount = 0; | 8 var rateChangeCount = 0; |
9 | 9 |
10 function ratechange() | 10 function ratechange() |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 run("video.playbackRate = Number.MIN_VALUE"); | 75 run("video.playbackRate = Number.MIN_VALUE"); |
76 testExpected("video.playbackRate", Number.MIN_VALUE); | 76 testExpected("video.playbackRate", Number.MIN_VALUE); |
77 consoleWrite(""); | 77 consoleWrite(""); |
78 | 78 |
79 run("video.playbackRate = Number.MAX_VALUE"); | 79 run("video.playbackRate = Number.MAX_VALUE"); |
80 testExpected("video.playbackRate", Number.MAX_VALUE); | 80 testExpected("video.playbackRate", Number.MAX_VALUE); |
81 consoleWrite(""); | 81 consoleWrite(""); |
82 | 82 |
83 consoleWrite("Test non-finite playback rates"); | 83 consoleWrite("Test non-finite playback rates"); |
84 testException("video.defaultPlaybackRate = -Infinity", '"TypeErr
or: Failed to set the \'defaultPlaybackRate\' property on \'HTMLMediaElement\':
The value provided is infinite."'); | 84 testException("video.defaultPlaybackRate = -Infinity", '"TypeErr
or: Failed to set the \'defaultPlaybackRate\' property on \'HTMLMediaElement\':
The provided double value is non-finite."'); |
85 testException("video.defaultPlaybackRate = Infinity", '"TypeErro
r: Failed to set the \'defaultPlaybackRate\' property on \'HTMLMediaElement\': T
he value provided is infinite."'); | 85 testException("video.defaultPlaybackRate = Infinity", '"TypeErro
r: Failed to set the \'defaultPlaybackRate\' property on \'HTMLMediaElement\': T
he provided double value is non-finite."'); |
86 testException("video.defaultPlaybackRate = NaN", '"TypeError: Fa
iled to set the \'defaultPlaybackRate\' property on \'HTMLMediaElement\': The va
lue provided is not a number."'); | 86 testException("video.defaultPlaybackRate = NaN", '"TypeError: Fa
iled to set the \'defaultPlaybackRate\' property on \'HTMLMediaElement\': The pr
ovided double value is non-finite."'); |
87 consoleWrite(""); | 87 consoleWrite(""); |
88 | 88 |
89 testException("video.playbackRate = -Infinity", '"TypeError: Fai
led to set the \'playbackRate\' property on \'HTMLMediaElement\': The value prov
ided is infinite."'); | 89 testException("video.playbackRate = -Infinity", '"TypeError: Fai
led to set the \'playbackRate\' property on \'HTMLMediaElement\': The provided d
ouble value is non-finite."'); |
90 testException("video.playbackRate = Infinity", '"TypeError: Fail
ed to set the \'playbackRate\' property on \'HTMLMediaElement\': The value provi
ded is infinite."'); | 90 testException("video.playbackRate = Infinity", '"TypeError: Fail
ed to set the \'playbackRate\' property on \'HTMLMediaElement\': The provided do
uble value is non-finite."'); |
91 testException("video.playbackRate = NaN", '"TypeError: Failed to
set the \'playbackRate\' property on \'HTMLMediaElement\': The value provided i
s not a number."'); | 91 testException("video.playbackRate = NaN", '"TypeError: Failed to
set the \'playbackRate\' property on \'HTMLMediaElement\': The provided double
value is non-finite."'); |
92 consoleWrite(""); | 92 consoleWrite(""); |
93 | 93 |
94 endTest(); | 94 endTest(); |
95 } | 95 } |
96 | 96 |
97 function start() | 97 function start() |
98 { | 98 { |
99 findMediaElement(); | 99 findMediaElement(); |
100 waitForEventOnce('canplaythrough', canplaythrough); | 100 waitForEventOnce('canplaythrough', canplaythrough); |
101 waitForEvent('ended', ended); | 101 waitForEvent('ended', ended); |
102 waitForEvent('ratechange', ratechange); | 102 waitForEvent('ratechange', ratechange); |
103 | 103 |
104 consoleWrite("*** setting src"); | 104 consoleWrite("*** setting src"); |
105 setSrcByTagName("video", findMediaFile("video", "content/test"))
; | 105 setSrcByTagName("video", findMediaFile("video", "content/test"))
; |
106 } | 106 } |
107 | 107 |
108 </script> | 108 </script> |
109 </head> | 109 </head> |
110 | 110 |
111 <body onload="start()"> | 111 <body onload="start()"> |
112 | 112 |
113 <video controls > </video> | 113 <video controls > </video> |
114 <ol> | 114 <ol> |
115 <li>'playbackRate' should not change when play() is called.</li> | 115 <li>'playbackRate' should not change when play() is called.</li> |
116 <li>'playbackRate' and 'defaultPlaybackRate' should always return th
e last value set.</li> | 116 <li>'playbackRate' and 'defaultPlaybackRate' should always return th
e last value set.</li> |
117 </ol> | 117 </ol> |
118 </body> | 118 </body> |
119 </html> | 119 </html> |
OLD | NEW |