haikuwebkit/LayoutTests/media/media-can-play-type.html

28 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="video-test.js"></script>
<script>
function start() {
video = document.getElementsByTagName('video')[0];
testException("video.canPlayType()", "'TypeError: Not enough arguments'");
testExpected("video.canPlayType('video/')", "");
testExpected("video.canPlayType('video/blahblah')", "");
testExpected("video.canPlayType('video/blahblah; codecs=\"blah, , blah\"')", "");
testExpected("video.canPlayType('video/blahblah; codecs=blah')", "");
testExpected("video.canPlayType('video/blahblah; codecs=\"blah\"')", "");
testExpected("video.canPlayType('video/blahblah; codecs=\"badcontent')", "");
testExpected("video.canPlayType('video/blahblah; codecs=badcontent\"')", "");
testExpected("video.canPlayType('video/blahblah; codecs=&quot;badcontent&quot;')", "");
endTest();
}
</script>
</head>
<body onload="start()">
<video controls></video>
<p>Test HTMLMediaElement <em>canPlayType()</em> method.</p>
</body>
</html>