Bug 1508224 [wpt PR 14122] - Prevent timeout when remote stats are not implemented, a=testonly
authorHarald Alvestrand <hta@chromium.org>
Sat, 24 Nov 2018 10:29:07 +0000
changeset 504478 1e89c802587d7859afc78a3de32c1c221bbc7152
parent 504477 30e78e224e8fc22d66223d1dd2acbe451247716e
child 504479 3d96d149964b803d8caa2ce7ad6ce22ae328b53f
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1508224, 14122, 904574, 1341510, 610010
milestone65.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 1508224 [wpt PR 14122] - Prevent timeout when remote stats are not implemented, a=testonly Automatic update from web-platform-testsPrevent timeout when remote stats are not implemented This prevents a failure in RTCP messsaging from masking other failures. It's up to other tests to actually verify that RTCP stats have been delivered. Bug: 904574 Change-Id: Ie641d5275372b4c10ad5fa3a39ae38c36f974482 Reviewed-on: https://chromium-review.googlesource.com/c/1341510 Reviewed-by: Guido Urdaneta <guidou@chromium.org> Commit-Queue: Harald Alvestrand <hta@chromium.org> Cr-Commit-Position: refs/heads/master@{#610010} -- wpt-commits: 393598458226e65e5b15d881300786f40108b215 wpt-pr: 14122
testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js
@@ -246,24 +246,29 @@ function createDataChannelPair(
     pc2.addEventListener('datachannel', onDataChannel);
 
     doSignalingHandshake(pc1, pc2);
   });
 }
 
 // Wait for RTP and RTCP stats to arrive
 async function waitForRtpAndRtcpStats(pc) {
+  // If remote stats are never reported, return after 5 seconds.
+  const startTime = performance.now();
   while (true) {
     const report = await pc.getStats();
     const stats = [...report.values()].filter(({type}) => type.endsWith("bound-rtp"));
     // Each RTP and RTCP stat has a reference
     // to the matching stat in the other direction
     if (stats.length && stats.every(({localId, remoteId}) => localId || remoteId)) {
       break;
     }
+    if (performance.now() > startTime + 5000) {
+      break;
+    }
   }
 }
 
 // Wait for a single message event and return
 // a promise that resolve when the event fires
 function awaitMessage(channel) {
   return new Promise((resolve, reject) => {
     channel.addEventListener('message',