Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / media-controller-volume.html
blob774ff4c35732bee937d58a81577bbf3326bf4a09
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()
10 findMediaElement();
11 waitForEvent('canplay', canplay);
12 video.src = findMediaFile("video", "content/test");
15 function canplay()
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);
25 testDOMException("video.controller.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
26 testDOMException("video.controller.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
27 testException("video.controller.volume = -Infinity", '"TypeError: Failed to set the \'volume\' property on \'MediaController\': The provided double value is non-finite."');
28 testException("video.controller.volume = Infinity", '"TypeError: Failed to set the \'volume\' property on \'MediaController\': The provided double value is non-finite."');
29 testException("video.controller.volume = NaN", '"TypeError: Failed to set the \'volume\' property on \'MediaController\': The provided double value is non-finite."');
31 endTest();
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>