blob: 7db56fc73328e680a936aab0585e4d3819f2eea4 [file] [log] [blame]
<!DOCTYPE html>
<html>
<script src="../../resources/js-test.js"></script>
<body>
<script type="text/javascript">
description("Test MediaStream API callbacks in WebView");
window.jsTestIsAsync = true;
function error(e) {
testFailed('getUserMedia error callback, reason: ' + e.name);
finishJSTest();
}
function gotStream(stream) {
testPassed('getUserMedia succeeded.');
track = stream.getVideoTracks()[0];
activeStream = stream;
shouldBeEqualToString('track.readyState', 'live');
shouldBeTrue('activeStream.active');
finishJSTest();
}
function getUserMedia(constraints, callback) {
try {
navigator.webkitGetUserMedia(constraints, callback, error);
} catch (e) {
testFailed('webkitGetUserMedia threw exception :' + e);
finishJSTest();
}
}
getUserMedia({audio:true, video:true}, gotStream);
</script>
</body>
</html>