1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
8 description("Tests RTCPeerConnection createOffer.");
14 function requestFailed2(reason
)
16 testPassed('requestFailed was called.');
19 shouldBe('errorReason', '"TEST_ERROR"');
21 shouldThrow("pc.createOffer(dummy, dummy, {offerToReceiveVideo:-1, offerToReceiveAudio:0});");
22 shouldThrow("pc.createOffer(dummy, dummy, {offerToReceiveVideo:0, offerToReceiveAudio:-1});");
23 shouldNotThrow("pc.createOffer(dummy, dummy, {offerToReceiveVideo:1, offerToReceiveAudio:0, voiceActivityDetection:false, iceRestart:true});");
28 function requestSucceeded2(sd
)
30 testFailed('requestSucceeded was called.');
34 function requestFailed1()
36 testFailed('requestFailed was called.');
40 function requestSucceeded1(sd
)
42 testPassed('requestSucceeded was called.');
44 sessionDescription
= sd
;
45 shouldBe('sessionDescription.type', '"offer"');
47 pc
.createOffer(requestSucceeded2
, requestFailed2
, {mandatory
:{"succeed":false}});
50 pc
= new webkitRTCPeerConnection(null, null);
51 pc
.createOffer(requestSucceeded1
, requestFailed1
, {mandatory
:{"succeed":true}});
53 window
.jsTestIsAsync
= true;
54 window
.successfullyParsed
= true;