blob: f826e726cb029613a56b099f150ff6db1cb49fc4 [file] [log] [blame]
mitz@apple.com3a96a442010-04-29 22:20:45 +00001<p>
2 This tests that in a standalone media document with audio content, the media element has non-zero
3 size.
4</p>
5<pre id="console"></pre>
mitz@apple.com3a96a442010-04-29 22:20:45 +00006<script>
rniwa@webkit.org08372332012-06-15 07:33:22 +00007 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
mitz@apple.com3a96a442010-04-29 22:20:45 +000010 }
11
12 function log(message)
13 {
14 document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
15 }
16
17 function frameLoaded()
18 {
19 var videoElement = document.getElementById("fr").contentDocument.querySelector("video");
20 var elementWidth = videoElement.offsetWidth;
21 var elementHeight = videoElement.offsetHeight;
22 if (elementWidth > 0 && elementHeight > 0)
23 log("PASS");
24 else
25 log("FAIL: the video element dimensions are " + elementWidth + " by " + elementHeight);
rniwa@webkit.org08372332012-06-15 07:33:22 +000026 if (window.testRunner)
27 testRunner.notifyDone();
mitz@apple.com3a96a442010-04-29 22:20:45 +000028 }
29</script>
commit-queue@webkit.org0b512b62011-03-07 08:19:58 +000030<iframe src="content/test.wav" id="fr" width=380 height=330 onload="frameLoaded()"></iframe>