Bug 979649 - Part 4: Re-enable RTCP timestamp test. r=jib
authorChris Peterson <cpeterson@mozilla.com>
Tue, 02 Oct 2018 21:42:12 -0700
changeset 490739 f4c2c10af6324ae04b53d18fff97eaec3e5e4396
parent 490738 47a7b32e57373e38139dd540394fd527442e59a2
child 490740 69d881a7866706d50389e433904d5946106e42d1
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersjib
bugs979649, 1495446
milestone65.0a1
Bug 979649 - Part 4: Re-enable RTCP timestamp test. r=jib One of the commented-out test cases is failing (bug 1495446), so temporarily log an info() statement until bug 1495446 is fixed. Differential Revision: https://phabricator.services.mozilla.com/D9355
dom/media/tests/mochitest/pc.js
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -1785,25 +1785,29 @@ PeerConnectionWrapper.prototype = {
     // Use spec way of enumerating stats
     var counters = {};
     for (let [key, res] of stats) {
       info("Checking stats for " + key + " : " + res);
       // validate stats
       ok(res.id == key, "Coherent stats id");
       var nowish = Date.now() + clockDriftAllowance;
       var minimum = this.whenCreated;
-      if (false) { // Bug 1325430 - timestamps aren't working properly in update 49
-      // if (!twoMachines) {
+      if (!twoMachines) {
         // Bug 1225729: On android, sometimes the first RTCP of the first
         // test run gets this value, likely because no RTP has been sent yet.
         if (res.timestamp != 2085978496000) {
-          ok(res.timestamp >= minimum,
-             "Valid " + (res.isRemote? "rtcp" : "rtp") + " timestamp " +
-                 res.timestamp + " >= " + minimum + " (" +
-                 (res.timestamp - minimum) + " ms)");
+          if (false) {
+            ok(res.timestamp >= minimum,
+               "Valid " + (res.isRemote? "rtcp" : "rtp") + " timestamp " +
+                   res.timestamp + " >= " + minimum + " (" +
+                   (res.timestamp - minimum) + " ms)");
+          } else {
+            info("FIXME bug 1495446: uncomment the timestamp test case " +
+                 "above after RTCP epoch bug 1495446 is fixed.");
+          }
           ok(res.timestamp <= nowish,
              "Valid " + (res.isRemote? "rtcp" : "rtp") + " timestamp " +
                  res.timestamp + " <= " + nowish + " (" +
                  (res.timestamp - nowish) + " ms)");
         } else {
           info("Bug 1225729: Uninitialized timestamp (" + res.timestamp +
                 "), should be >=" + minimum + " and <= " + nowish);
         }
@@ -1838,27 +1842,27 @@ PeerConnectionWrapper.prototype = {
             var rem = stats.get(res.remoteId);
             ok(rem.isRemote, "Remote is rtcp");
             ok(rem.remoteId == res.id, "Remote backlink match");
             if(res.type == "outbound-rtp") {
               ok(rem.type == "inbound-rtp", "Rtcp is inbound");
               ok(rem.packetsReceived !== undefined, "Rtcp packetsReceived");
               ok(rem.packetsLost !== undefined, "Rtcp packetsLost");
               ok(rem.bytesReceived >= rem.packetsReceived, "Rtcp bytesReceived");
-	       if (false) { // Bug 1325430 if (!this.disableRtpCountChecking) {
-	       // no guarantee which one is newer!
-	       // Note: this must change when we add a timestamp field to remote RTCP reports
-	       // and make rem.timestamp be the reception time
-		if (res.timestamp >= rem.timestamp) {
-                 ok(rem.packetsReceived <= res.packetsSent, "No more than sent packets");
-		 } else {
+              if (!this.disableRtpCountChecking) {
+                // no guarantee which one is newer!
+                // Note: this must change when we add a timestamp field to remote RTCP reports
+                // and make rem.timestamp be the reception time
+                if (res.timestamp >= rem.timestamp) {
+                  ok(rem.packetsReceived <= res.packetsSent, "No more than sent packets");
+                } else {
                   info("REVERSED timestamps: rec:" +
-		     rem.packetsReceived + " time:" + rem.timestamp + " sent:" + res.packetsSent + " time:" + res.timestamp);
-		 }
-		// Else we may have received more than outdated Rtcp packetsSent
+                    rem.packetsReceived + " time:" + rem.timestamp + " sent:" + res.packetsSent + " time:" + res.timestamp);
+                }
+                // Else we may have received more than outdated Rtcp packetsSent
                 ok(rem.bytesReceived <= res.bytesSent, "No more than sent bytes");
               }
               ok(rem.jitter !== undefined, "Rtcp jitter");
               if (rem.roundTripTime) {
                 ok(rem.roundTripTime > 0,
                    "Rtcp rtt " + rem.roundTripTime + " >= 0");
                 ok(rem.roundTripTime < 60000,
                    "Rtcp rtt " + rem.roundTripTime + " < 1 min");