summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/media/audio-only-video-intrinsic-size.html
blob: e986d06eb40442773a49a94aa2500bf05509f3a3 (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
26
<video id="vid" src="content/test.wav" onloadedmetadata="loadedMetadata()"></video>
<p>
    This tests the intrinsic size of a video element is the default 300&#xd7;150 before metadata is
    loaded, and also after metadata is loaded for an audio-only file.
</p>
<pre id="console"></pre>
<script>
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    function log(message)
    {
        document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
    }

    var videoElement = document.getElementById("vid");
    log("Initial dimensions: " + videoElement.offsetWidth + "\u00d7" + videoElement.offsetHeight);

    function loadedMetadata()
    {
        log("Dimensions after metadata loaded: " + videoElement.offsetWidth + "\u00d7" + videoElement.offsetHeight);        
        testRunner.notifyDone();
    }
</script>