1 <video controls
></video>
2 <p>Test 'volume' attribute
<p>
3 <script src=media-file.js
></script>
4 <script src=video-test.js
></script>
6 testExpected("video.volume", 1.0);
7 run("video.volume = 0.5");
8 testExpected("video.volume", 0.5);
9 run("video.volume = Number.MIN_VALUE");
10 testExpected("video.volume", Number
.MIN_VALUE
);
11 run("video.volume = 0");
12 testExpected("video.volume", 0);
13 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
14 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
15 testException("video.volume = -Infinity", '"TypeError: Failed to set the \'volume\' property on \'HTMLMediaElement\': The provided double value is non-finite."');
16 testException("video.volume = Infinity", '"TypeError: Failed to set the \'volume\' property on \'HTMLMediaElement\': The provided double value is non-finite."');
17 testException("video.volume = NaN", '"TypeError: Failed to set the \'volume\' property on \'HTMLMediaElement\': The provided double value is non-finite."');
18 video
.src
= findMediaFile("video", "content/test");
20 waitForEvent("canplaythrough", function () {
21 testExpected("video.volume", 0);
22 run("video.volume = 0.5");
23 testExpected("video.volume", 0.5);
24 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
25 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");