2009-09-18 Alpha Lam <hclam@chromium.org>
[WebKit-https.git] / LayoutTests / media / video-volume.html
1 <video controls></video>
2 <p>Test 'volume' attribute<p>
3 <script src=media-file.js></script>
4 <script src=video-test.js></script>
5 <script>
6     testExpected("video.volume", 1.0);
7     run("video.volume = 0.5");
8     testExpected("video.volume", 0.5);
9     run("video.volume = 0");
10     testExpected("video.volume", 0);
11     testException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
12     testException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
13     video.src = findMediaFile("video", "content/test");
14     run("video.load()");
15     waitForEvent("load", function () {
16         testExpected("video.volume", 0);
17         run("video.volume = 0.5");
18         testExpected("video.volume", 0.5);
19         testException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
20         testException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
21         endTest();
22     }); 
23 </script>