blob: 59b0b4cf1276b595bfca780fff350f24ca43848a [file] [log] [blame]
<video controls></video>
<p>Test 'volume' attribute<p>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
testExpected("video.volume", 1.0);
run("video.volume = 0.5");
testExpected("video.volume", 0.5);
run("video.volume = 0");
testExpected("video.volume", 0);
testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
video.src = findMediaFile("video", "content/test");
run("video.load()");
waitForEvent("canplaythrough", function () {
testExpected("video.volume", 0);
run("video.volume = 0.5");
testExpected("video.volume", 0.5);
testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
endTest();
});
</script>