blob: 8edd49bef1a2a75dc17e7530b434cfbe89fa5fca [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>mock-media-source</title>
<script src="mock-media-source.js"></script>
<script src="../video-test.js"></script>
<script>
var source;
var sourceBuffer;
if (window.internals)
internals.initializeMockMediaSource();
function runTest() {
findMediaElement();
source = new MediaSource();
testDOMException('source.addSourceBuffer("invalid")', 'DOMException.NOT_SUPPORTED_ERR');
testExpected('MediaSource.isTypeSupported("invalid")', false);
testExpected('MediaSource.isTypeSupported("video/mock; codecs=mock")', true);
waitForEvent('sourceopen', sourceOpen, false, false, source);
run('video.src = URL.createObjectURL(source)');
}
function sourceOpen() {
run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")');
testExpected('source.sourceBuffers[0]', sourceBuffer);
endTest();
}
</script>
</head>
<body onload="runTest()">
<video></video>
</body>
</html>