2 <html class=
"reftest-wait">
4 https://bugzilla.mozilla.org/show_bug.cgi?id=812785
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) {
17 pc1.close(); pc1 = null;
18 pc2.close(); pc2 = null;
20 var index = localStorage.index ||
0;
22 localStorage.index = index +
1;
23 window.location.reload();
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) {
42 pc1.setLocalDescription(pc1_offer, function () {
43 pc2.setRemoteDescription(pc1_offer, function () {
44 pc2.createAnswer(function (answer) {
46 pc2.setLocalDescription(pc2_answer, function () {
47 pc1.setRemoteDescription(pc2_answer, function step6() {
58 delete localStorage[
"index"];
60 document.documentElement.removeAttribute(
"class");
65 <body onload=
"setTimeout(start, 100)">
66 <audio id=
"local" controls autoplay
><source type=
"audio/wav" src=
"" /></audio>
67 <audio id=
"remote" controls
></audio>