1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
8 description("Tests that RTCPeerConnection event callbacks are async so that for example close can be called safely. The order of the messages is very important.");
14 testFailed('Stream generation failed.');
18 function getUserMedia(dictionary
, callback
) {
20 navigator
.webkitGetUserMedia(dictionary
, callback
, error
);
22 testFailed('webkitGetUserMedia threw exception :' + e
);
27 function onStateChange(event
) {
28 testPassed('onStateChange was called.');
29 shouldBe("pc.signalingState", "'closed'");
33 function onNegotiationNeeded(event
) {
34 testPassed('onNegotiationNeeded was called.');
35 pc
.onsignalingstatechange
= onStateChange
;
37 testPassed('onNegotiationNeeded done.')
40 function gotStream(s
) {
41 testPassed('gotStream was called.');
44 pc
= new webkitRTCPeerConnection(null, null);
45 pc
.onnegotiationneeded
= onNegotiationNeeded
;
48 testPassed('gotStream done.');
51 getUserMedia({audio
:true, video
:true}, gotStream
);
53 window
.jsTestIsAsync
= true;
54 window
.successfullyParsed
= true;