OLD | NEW |
1 <video controls></video> | 1 <video controls></video> |
2 <p>Test 'volume' attribute<p> | 2 <p>Test 'volume' attribute<p> |
3 <script src=media-file.js></script> | 3 <script src=media-file.js></script> |
4 <script src=video-test.js></script> | 4 <script src=video-test.js></script> |
5 <script> | 5 <script> |
6 testExpected("video.volume", 1.0); | 6 testExpected("video.volume", 1.0); |
7 run("video.volume = 0.5"); | 7 run("video.volume = 0.5"); |
8 testExpected("video.volume", 0.5); | 8 testExpected("video.volume", 0.5); |
9 run("video.volume = Number.MIN_VALUE"); | 9 run("video.volume = Number.MIN_VALUE"); |
10 testExpected("video.volume", Number.MIN_VALUE); | 10 testExpected("video.volume", Number.MIN_VALUE); |
11 run("video.volume = 0"); | 11 run("video.volume = 0"); |
12 testExpected("video.volume", 0); | 12 testExpected("video.volume", 0); |
13 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); | 13 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); |
14 testDOMException("video.volume = -0.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 \'v
olume\' property on \'HTMLMediaElement\': The value provided is infinite."'); | 15 testException("video.volume = -Infinity", '"TypeError: Failed to set the \'v
olume\' property on \'HTMLMediaElement\': The provided double value is non-finit
e."'); |
16 testException("video.volume = Infinity", '"TypeError: Failed to set the \'vo
lume\' property on \'HTMLMediaElement\': The value provided is infinite."'); | 16 testException("video.volume = Infinity", '"TypeError: Failed to set the \'vo
lume\' 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 value provided is not a number."'); | 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"); | 18 video.src = findMediaFile("video", "content/test"); |
19 run("video.load()"); | 19 run("video.load()"); |
20 waitForEvent("canplaythrough", function () { | 20 waitForEvent("canplaythrough", function () { |
21 testExpected("video.volume", 0); | 21 testExpected("video.volume", 0); |
22 run("video.volume = 0.5"); | 22 run("video.volume = 0.5"); |
23 testExpected("video.volume", 0.5); | 23 testExpected("video.volume", 0.5); |
24 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); | 24 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); |
25 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR"); | 25 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR"); |
26 endTest(); | 26 endTest(); |
27 }); | 27 }); |
28 </script> | 28 </script> |
OLD | NEW |