summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/media/video-volume.html
blob: d421204534bf7dca1cef46e5ce4c4bd504571418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<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 = Number.MIN_VALUE");
    testExpected("video.volume", Number.MIN_VALUE);
    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>