blob: 3211d0db60a2b1df0f47e82ab85d9529cce814a0 [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 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).then(requestSucceeded2, requestFailed2);');
}
pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded1, requestFailed1);');
window.jsTestIsAsync = true;
window.successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>