blob: dfefb22f2fca1acb484e58c813f815bbafd21742 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../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', "offer");
shouldBeEqualToString('pc.remoteDescription.sdp', "remote");
pc.close();
shouldBeEqualToString('pc.remoteDescription.type', "offer");
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:"answer", sdp:"local"});
shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded2, requestFailed2);');
}
pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, requestFailed1);');
window.jsTestIsAsync = true;
window.successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>