OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>MediaController - volume test</title> |
| 5 <script src=video-test.js></script> |
| 6 <script src=media-file.js></script> |
| 7 <script> |
| 8 function start() |
| 9 { |
| 10 findMediaElement(); |
| 11 waitForEvent('canplay', canplay); |
| 12 video.src = findMediaFile("video", "content/test"); |
| 13 }; |
| 14 |
| 15 function canplay() |
| 16 { |
| 17 testExpected("video.controller.volume", 1.0); |
| 18 run("video.controller.volume = 0.5"); |
| 19 testExpected("video.controller.volume", 0.5); |
| 20 run("video.controller.volume = Number.MIN_VALUE"); |
| 21 testExpected("video.controller.volume", Number.MIN_VALUE); |
| 22 run("video.controller.volume = 0"); |
| 23 testExpected("video.controller.volume", 0); |
| 24 |
| 25 testDOMException("video.controller.volume = 1.5", "DOMException.INDE
X_SIZE_ERR"); |
| 26 testDOMException("video.controller.volume = -0.5", "DOMException.IND
EX_SIZE_ERR"); |
| 27 testException("video.controller.volume = -Infinity", '"TypeError: Fa
iled to set the \'volume\' property on \'MediaController\': The value provided i
s infinite."'); |
| 28 testException("video.controller.volume = Infinity", '"TypeError: Fai
led to set the \'volume\' property on \'MediaController\': The value provided is
infinite."'); |
| 29 testException("video.controller.volume = NaN", '"TypeError: Failed t
o set the \'volume\' property on \'MediaController\': The value provided is not
a number."'); |
| 30 |
| 31 endTest(); |
| 32 }; |
| 33 </script> |
| 34 </head> |
| 35 <body> |
| 36 <body onload="start()"> |
| 37 <video id="video" mediaGroup="group" controls autoplay></video> |
| 38 </body> |
| 39 </body> |
| 40 </html> |
OLD | NEW |