Bug 1461496 [wpt PR 10997] - Add test to verify a particular PeerConnection setup does not deadlock, a=testonly
authorKristoffer Erlandsson <kerl@google.com>
Sat, 19 May 2018 20:27:26 +0000
changeset 419077 4a5ab590207da99b47f5ed43e9c1d4e3a0445234
parent 419076 05585194b6f70d150bfec34b902601227eeea456
child 419078 0c68905b3d04284bbde904ac9cb944801a4e55b2
push id34026
push userapavel@mozilla.com
push dateMon, 21 May 2018 09:47:33 +0000
treeherdermozilla-central@dc1868d255be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1461496, 10997, 736725, 840737, 1057249, 559022
milestone62.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 1461496 [wpt PR 10997] - Add test to verify a particular PeerConnection setup does not deadlock, a=testonly Automatic update from web-platform-testsAdd test to verify a particular PeerConnection setup does not deadlock Does the connection setup in a specific sequence that historically triggered a deadlock (https://crbug.com/736725). The test simply verifies this specific sequence completes without errors or timeout. Verified it fails on the deadlock by running the test on the parent commit (2485344d4e8792bc4f9716deadda41fbc0d89ad9) of the original bug fix. BUG=chromium:840737 Change-Id: I93d9d8cb50cad9629268971520de489450d8649b Reviewed-on: https://chromium-review.googlesource.com/1057249 Reviewed-by: Henrik Boström <hbos@chromium.org> Reviewed-by: Patrik Höglund <phoglund@chromium.org> Commit-Queue: Kristoffer Erlandsson <kerl@google.com> Cr-Commit-Position: refs/heads/master@{#559022} -- wpt-commits: ad84337c037685845f96d63618bb9b46ae9e9468 wpt-pr: 10997
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webrtc/RTCPeerConnection-add-track-no-deadlock.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -373827,16 +373827,22 @@
     ]
    ],
    "webrtc/RTCIceTransport.html": [
     [
      "/webrtc/RTCIceTransport.html",
      {}
     ]
    ],
+   "webrtc/RTCPeerConnection-add-track-no-deadlock.https.html": [
+    [
+     "/webrtc/RTCPeerConnection-add-track-no-deadlock.https.html",
+     {}
+    ]
+   ],
    "webrtc/RTCPeerConnection-addIceCandidate.html": [
     [
      "/webrtc/RTCPeerConnection-addIceCandidate.html",
      {}
     ]
    ],
    "webrtc/RTCPeerConnection-addTrack.https.html": [
     [
@@ -615484,16 +615490,20 @@
   "webrtc/RTCIceCandidate-constructor.html": [
    "6938c88a0167e418aa9e93416865c857cc3489c5",
    "testharness"
   ],
   "webrtc/RTCIceTransport.html": [
    "db758cc2a744c049c291575e408dbb5f280cdf19",
    "testharness"
   ],
+  "webrtc/RTCPeerConnection-add-track-no-deadlock.https.html": [
+   "a16eaf6805528c2b73650694f26568f41be5d5ff",
+   "testharness"
+  ],
   "webrtc/RTCPeerConnection-addIceCandidate.html": [
    "dd19f1d7a8d12ee85101e53bb30c553e94d67b6a",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-addTrack.https.html": [
    "c434d2cdcb134f28b203df07cecca04e11195700",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-add-track-no-deadlock.https.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCPeerConnection addTrack does not deadlock</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+  'use strict';
+
+  // This test sets up two peer connections using a sequence of operations
+  // that triggered a deadlock in Chrome. See https://crbug.com/736725.
+  // If a deadlock is introduced again, this test times out.
+  promise_test(async t => {
+    const pc1 = new RTCPeerConnection();
+    t.add_cleanup(() => pc1.close());
+    const stream = await navigator.mediaDevices.getUserMedia(
+      {audio: false, video: true});
+    const videoTrack = stream.getVideoTracks()[0];
+    t.add_cleanup(() => videoTrack.stop());
+    pc1.addTrack(videoTrack, stream);
+    const offer = await pc1.createOffer();
+    await pc1.setLocalDescription(offer);
+    const pc2 = new RTCPeerConnection();
+    t.add_cleanup(() => pc2.close());
+    const srdPromise = pc2.setRemoteDescription(offer);
+    pc2.addTrack(videoTrack, stream);
+    // The deadlock encountered in https://crbug.com/736725 occured here.
+    await srdPromise;
+    await pc2.createAnswer();
+  }, 'RTCPeerConnection addTrack does not deadlock.');
+</script>