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