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