blob: 08cb086db51b00cd9c8dc6eb67c866544bac3d0a [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 remoteDescription.");
var pc = null;
function requestFailed2()
{
testPassed('requestFailed was called.');
shouldBeEqualToString('pc.remoteDescription.type', "answer");
shouldBeEqualToString('pc.remoteDescription.sdp', "remote");
pc.close();
shouldBeEqualToString('pc.remoteDescription.type', "answer");
shouldBeEqualToString('pc.remoteDescription.sdp', "remote");
finishJSTest();
}
function requestSucceeded2()
{
testFailed('requestSucceeded was called.');
finishJSTest();
}
function requestFailed1()
{
testFailed('requestFailed was called.');
finishJSTest();
}
function requestSucceeded1()
{
testPassed('requestSucceeded was called.');
sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded2, requestFailed2);');
}
pc = new webkitRTCPeerConnection(null, null);
var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, requestFailed1);');
window.jsTestIsAsync = true;
window.successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>