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 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 5 (Please avoid writing new tests using video-test.js) --> |
4 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
5 <script> | 7 <script> |
6 testExpected("video.volume", 1.0); | 8 testExpected("video.volume", 1.0); |
7 run("video.volume = 0.5"); | 9 run("video.volume = 0.5"); |
8 testExpected("video.volume", 0.5); | 10 testExpected("video.volume", 0.5); |
9 run("video.volume = Number.MIN_VALUE"); | 11 run("video.volume = Number.MIN_VALUE"); |
10 testExpected("video.volume", Number.MIN_VALUE); | 12 testExpected("video.volume", Number.MIN_VALUE); |
11 run("video.volume = 0"); | 13 run("video.volume = 0"); |
12 testExpected("video.volume", 0); | 14 testExpected("video.volume", 0); |
13 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); | 15 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); |
14 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR"); | 16 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 provided double value is non-finit
e."'); | 17 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 provided double value is non-finite
."'); | 18 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 provided double value is non-finite."'); | 19 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 video.src = findMediaFile("video", "content/test"); |
19 run("video.load()"); | 21 run("video.load()"); |
20 waitForEvent("canplaythrough", function () { | 22 waitForEvent("canplaythrough", function () { |
21 testExpected("video.volume", 0); | 23 testExpected("video.volume", 0); |
22 run("video.volume = 0.5"); | 24 run("video.volume = 0.5"); |
23 testExpected("video.volume", 0.5); | 25 testExpected("video.volume", 0.5); |
24 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); | 26 testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR"); |
25 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR"); | 27 testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR"); |
26 endTest(); | 28 endTest(); |
27 }); | 29 }); |
28 </script> | 30 </script> |
OLD | NEW |