blob: d8e8df10d8dea80b4bba3bbc69cf956bb633a3f8 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Tests RTCPeerConnection onnegotiationneeded.");
var stream = null;
var pc = null;
function error() {
testFailed('Stream generation failed.');
finishJSTest();
}
function getUserMedia(dictionary, callback) {
try {
navigator.webkitGetUserMedia(dictionary, callback, error);
} catch (e) {
testFailed('webkitGetUserMedia threw exception :' + e);
finishJSTest();
}
}
function onNegotiationNeeded(event) {
testPassed('onNegotiationNeeded was called.');
finishJSTest();
}
function gotStream(s) {
testPassed('Got a stream.');
stream = s;
pc = new webkitRTCPeerConnection(null, null);
pc.onnegotiationneeded = onNegotiationNeeded;
pc.addStream(stream);
}
getUserMedia({audio:true, video:true}, gotStream);
window.jsTestIsAsync = true;
window.successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>