blob: 3a66d2e26b119105ac1ed30dd5af5752997df342 [file] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Tests RTCSessionDescription.");
var initializer = {type:"offer", sdp:"foobar"};
var sessionDescription;
shouldNotThrow("sessionDescription = new RTCSessionDescription();");
shouldNotThrow("sessionDescription = new RTCSessionDescription(initializer);");
shouldBe('sessionDescription.type', '"offer"');
shouldBe('sessionDescription.sdp', '"foobar"');
shouldThrow("new RTCSessionDescription(null);");
shouldThrow("new RTCSessionDescription(5);");
shouldThrow("new RTCSessionDescription('foobar');");
shouldThrow("new RTCSessionDescription({type:'foobar', sdp:'x'});");
shouldThrow("new RTCSessionDescription({type:'offer', sdp:''});");
shouldNotThrow("new RTCSessionDescription({});");
shouldNotThrow("new RTCSessionDescription({type:'offer', sdp:'x'});");
shouldNotThrow("new RTCSessionDescription({type:'answer', sdp:'x'});");
shouldNotThrow("new RTCSessionDescription({type:'pranswer', sdp:'x'});");
window.successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>