dom/media/tests/crashtests/812785.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/media/tests/crashtests/812785.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html class="reftest-wait">
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=812785
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Bug 812785 - WebRTC use-after-free crash</title>
    1.12 +  <script type="application/javascript">
    1.13 +    var pc1, pc2, pc1_offer, pc2_answer, localAudio, remoteAudio;
    1.14 +
    1.15 +    function onFailure(code) {
    1.16 +      stop();
    1.17 +    }
    1.18 +
    1.19 +    function stop() {
    1.20 +      pc1.close(); pc1 = null;
    1.21 +      pc2.close(); pc2 = null;
    1.22 +
    1.23 +      var index = localStorage.index || 0;
    1.24 +      if (index < 5) {
    1.25 +        localStorage.index = index + 1;
    1.26 +        window.location.reload();
    1.27 +      }
    1.28 +      else {
    1.29 +        finish();
    1.30 +      }
    1.31 +    }
    1.32 +
    1.33 +    function start() {
    1.34 +      localAudio = document.getElementById("local");
    1.35 +      remoteAudio = document.getElementById("remote");
    1.36 +
    1.37 +      var stream = localAudio.mozCaptureStreamUntilEnded();
    1.38 +
    1.39 +      pc1 = new mozRTCPeerConnection();
    1.40 +      pc2 = new mozRTCPeerConnection();
    1.41 +
    1.42 +      pc1.addStream(stream);
    1.43 +      pc1.createOffer(function (offer) {
    1.44 +        pc1_offer = offer;
    1.45 +        pc1.setLocalDescription(pc1_offer, function () {
    1.46 +          pc2.setRemoteDescription(pc1_offer, function () {
    1.47 +            pc2.createAnswer(function (answer) {
    1.48 +              pc2_answer = answer;
    1.49 +              pc2.setLocalDescription(pc2_answer, function () {
    1.50 +                pc1.setRemoteDescription(pc2_answer, function step6() {
    1.51 +                  stop();
    1.52 +                }, onFailure);
    1.53 +              }, onFailure);
    1.54 +            }, onFailure);
    1.55 +          }, onFailure);
    1.56 +        }, onFailure);
    1.57 +      }, onFailure);
    1.58 +    }
    1.59 +
    1.60 +    function finish() {
    1.61 +      delete localStorage["index"];
    1.62 +
    1.63 +      document.documentElement.removeAttribute("class");
    1.64 +    }
    1.65 +  </script>
    1.66 +</head>
    1.67 +
    1.68 +<body onload="setTimeout(start, 100)">
    1.69 +  <audio id="local" controls autoplay><source type="audio/wav" src="" /></audio>
    1.70 +  <audio id="remote" controls></audio>
    1.71 +</body>
    1.72 +</html>
    1.73 +

mercurial