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.

     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();
    14     }
    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();
    24       }
    25       else {
    26         finish();
    27       }
    28     }
    30     function start() {
    31       localAudio = document.getElementById("local");
    32       remoteAudio = document.getElementById("remote");
    34       var stream = localAudio.mozCaptureStreamUntilEnded();
    36       pc1 = new mozRTCPeerConnection();
    37       pc2 = new mozRTCPeerConnection();
    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);
    55     }
    57     function finish() {
    58       delete localStorage["index"];
    60       document.documentElement.removeAttribute("class");
    61     }
    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>

mercurial