dom/media/tests/crashtests/812785.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html class="reftest-wait">
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=812785
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <meta charset="utf-8">
michael@0 8 <title>Bug 812785 - WebRTC use-after-free crash</title>
michael@0 9 <script type="application/javascript">
michael@0 10 var pc1, pc2, pc1_offer, pc2_answer, localAudio, remoteAudio;
michael@0 11
michael@0 12 function onFailure(code) {
michael@0 13 stop();
michael@0 14 }
michael@0 15
michael@0 16 function stop() {
michael@0 17 pc1.close(); pc1 = null;
michael@0 18 pc2.close(); pc2 = null;
michael@0 19
michael@0 20 var index = localStorage.index || 0;
michael@0 21 if (index < 5) {
michael@0 22 localStorage.index = index + 1;
michael@0 23 window.location.reload();
michael@0 24 }
michael@0 25 else {
michael@0 26 finish();
michael@0 27 }
michael@0 28 }
michael@0 29
michael@0 30 function start() {
michael@0 31 localAudio = document.getElementById("local");
michael@0 32 remoteAudio = document.getElementById("remote");
michael@0 33
michael@0 34 var stream = localAudio.mozCaptureStreamUntilEnded();
michael@0 35
michael@0 36 pc1 = new mozRTCPeerConnection();
michael@0 37 pc2 = new mozRTCPeerConnection();
michael@0 38
michael@0 39 pc1.addStream(stream);
michael@0 40 pc1.createOffer(function (offer) {
michael@0 41 pc1_offer = offer;
michael@0 42 pc1.setLocalDescription(pc1_offer, function () {
michael@0 43 pc2.setRemoteDescription(pc1_offer, function () {
michael@0 44 pc2.createAnswer(function (answer) {
michael@0 45 pc2_answer = answer;
michael@0 46 pc2.setLocalDescription(pc2_answer, function () {
michael@0 47 pc1.setRemoteDescription(pc2_answer, function step6() {
michael@0 48 stop();
michael@0 49 }, onFailure);
michael@0 50 }, onFailure);
michael@0 51 }, onFailure);
michael@0 52 }, onFailure);
michael@0 53 }, onFailure);
michael@0 54 }, onFailure);
michael@0 55 }
michael@0 56
michael@0 57 function finish() {
michael@0 58 delete localStorage["index"];
michael@0 59
michael@0 60 document.documentElement.removeAttribute("class");
michael@0 61 }
michael@0 62 </script>
michael@0 63 </head>
michael@0 64
michael@0 65 <body onload="setTimeout(start, 100)">
michael@0 66 <audio id="local" controls autoplay><source type="audio/wav" src="" /></audio>
michael@0 67 <audio id="remote" controls></audio>
michael@0 68 </body>
michael@0 69 </html>
michael@0 70

mercurial