Bug 812785 - Crashtest for WebRTC use-after-free crash. r=jesup
authorHenrik Skupin <hskupin@mozilla.com>
Mon, 19 Nov 2012 15:56:29 +0100
changeset 124588 36ac5361823644b6c993658323f32ba6c3003469
parent 124587 cfccbaf87671adf1be8442cdded6ca79c4bb4d68
child 124589 7897d0e37bb9dc664b070fd64a1caad33c82c8d7
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs812785
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 812785 - Crashtest for WebRTC use-after-free crash. r=jesup
dom/media/tests/crashtests/812785.html
dom/media/tests/crashtests/crashtests.list
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/crashtests/812785.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=812785
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Bug 812785 - WebRTC use-after-free crash</title>
+  <script type="application/javascript">
+    var pc1, pc2, pc1_offer, pc2_answer, localAudio, remoteAudio;
+
+    function onFailure(code) {
+      stop();
+    }
+
+    function stop() {
+      pc1.close(); pc1 = null;
+      pc2.close(); pc2 = null;
+
+      var index = localStorage.index || 0;
+      if (index < 5) {
+        localStorage.index = index + 1;
+        window.location.reload();
+      }
+      else {
+        finish();
+      }
+    }
+
+    function start() {
+      localAudio = document.getElementById("local");
+      remoteAudio = document.getElementById("remote");
+
+      var stream = localAudio.mozCaptureStreamUntilEnded();
+
+      pc1 = new mozRTCPeerConnection();
+      pc2 = new mozRTCPeerConnection();
+
+      pc1.addStream(stream);
+      pc1.createOffer(function (offer) {
+        pc1_offer = offer;
+        pc1.setLocalDescription(pc1_offer, function () {
+          pc2.setRemoteDescription(pc1_offer, function () {
+            pc2.createAnswer(function (answer) {
+              pc2_answer = answer;
+              pc2.setLocalDescription(pc2_answer, function () {
+                pc1.setRemoteDescription(pc2_answer, function step6() {
+                  stop();
+                }, onFailure);
+              }, onFailure);
+            }, onFailure);
+          }, onFailure);
+        }, onFailure);
+      }, onFailure);
+    }
+
+    function finish() {
+      delete localStorage["index"];
+
+      document.documentElement.removeAttribute("class");
+    }
+  </script>
+</head>
+
+<body onload="start()">
+  <audio id="local" controls autoplay><source type="audio/wav" src="" /></audio>
+  <audio id="remote" controls></audio>
+</body>
+</html>
+
--- a/dom/media/tests/crashtests/crashtests.list
+++ b/dom/media/tests/crashtests/crashtests.list
@@ -1,8 +1,9 @@
 default-preferences pref(media.peerconnection.enabled,true)
 
 load 780790.html
 load 791270.html
 load 791278.html
 load 791330.html
 load 801227.html
 load 802982.html
+load 812785.html