Bug 1943514 - Close the RC sidebar panel when users opt out of/turn off Review Checke...
[gecko.git] / dom / media / tests / crashtests / 812785.html
blobf26168e49be624efb911077e11d6f551cb137b79
1 <!DOCTYPE HTML>
2 <html class="reftest-wait">
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=812785
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Bug 812785 - WebRTC use-after-free crash</title>
9 <script type="application/javascript">
10 var pc1, pc2, pc1_offer, pc2_answer, localAudio, remoteAudio;
12 function onFailure(code) {
13 stop();
16 function stop() {
17 pc1.close(); pc1 = null;
18 pc2.close(); pc2 = null;
20 var index = localStorage.index || 0;
21 if (index < 5) {
22 localStorage.index = index + 1;
23 window.location.reload();
25 else {
26 finish();
30 function start() {
31 localAudio = document.getElementById("local");
32 remoteAudio = document.getElementById("remote");
34 var stream = localAudio.mozCaptureStreamUntilEnded();
36 pc1 = new RTCPeerConnection();
37 pc2 = new RTCPeerConnection();
39 pc1.addStream(stream);
40 pc1.createOffer(function (offer) {
41 pc1_offer = offer;
42 pc1.setLocalDescription(pc1_offer, function () {
43 pc2.setRemoteDescription(pc1_offer, function () {
44 pc2.createAnswer(function (answer) {
45 pc2_answer = answer;
46 pc2.setLocalDescription(pc2_answer, function () {
47 pc1.setRemoteDescription(pc2_answer, function step6() {
48 stop();
49 }, onFailure);
50 }, onFailure);
51 }, onFailure);
52 }, onFailure);
53 }, onFailure);
54 }, onFailure);
57 function finish() {
58 delete localStorage["index"];
60 document.documentElement.removeAttribute("class");
62 </script>
63 </head>
65 <body onload="setTimeout(start, 100)">
66 <audio id="local" controls autoplay><source type="audio/wav" src="" /></audio>
67 <audio id="remote" controls></audio>
68 </body>
69 </html>