Backed out changeset ea733590b886 (bug 1208373)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 09 Jun 2016 15:18:50 +0200
changeset 301296 b7602995ca0f432feee77356f46102779ab02f5f
parent 301295 ff6dd61ac5230a4d26c6199774e2adf2659c44c2
child 301297 df403befe9fe76dea67ca4a0fb4386c6cab6bf93
push id78275
push usercbook@mozilla.com
push dateThu, 09 Jun 2016 13:19:23 +0000
treeherdermozilla-inbound@df403befe9fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1208373
milestone50.0a1
backs outea733590b88625520282a8438b3068e76927c881
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
Backed out changeset ea733590b886 (bug 1208373)
dom/media/tests/mochitest/pc.js
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -129,39 +129,23 @@ function timerGuard(p, time, message) {
 PeerConnectionTest.prototype.closePC = function() {
   info("Closing peer connections");
 
   var closeIt = pc => {
     if (!pc || pc.signalingState === "closed") {
       return Promise.resolve();
     }
 
-    var promise = Promise.all([
-      new Promise(resolve => {
-        pc.onsignalingstatechange = e => {
-          is(e.target.signalingState, "closed", "signalingState is closed");
-          resolve();
-        };
-      }),
-      Promise.all(pc._pc.getReceivers()
-        .filter(receiver => receiver.track.readyState == "live")
-        .map(receiver => {
-          info("Waiting for track " + receiver.track.id + " (" +
-               receiver.track.kind + ") to end.");
-          return haveEvent(receiver.track, "ended", wait(50000))
-            .then(event => {
-              is(event.target, receiver.track, "Event target should be the correct track");
-              info("ended fired for track " + receiver.track.id);
-            }, e => e ? Promise.reject(e)
-                      : ok(false, "ended never fired for track " +
-                                    receiver.track.id));
-        }))
-    ]);
-    pc.close();
-    return promise;
+    return new Promise(resolve => {
+      pc.onsignalingstatechange = e => {
+        is(e.target.signalingState, "closed", "signalingState is closed");
+        resolve();
+      };
+      pc.close();
+    });
   };
 
   return timerGuard(Promise.all([
     closeIt(this.pcLocal),
     closeIt(this.pcRemote)
   ]), 60000, "failed to close peer connection");
 };
 
@@ -461,32 +445,29 @@ PeerConnectionTest.prototype.updateChain
 
 /**
  * Start running the tests as assigned to the command chain.
  */
 PeerConnectionTest.prototype.run = function() {
   /* We have to modify the chain here to allow tests which modify the default
    * test chain instantiating a PeerConnectionTest() */
   this.updateChainSteps();
-  var finished = () => {
-    if (window.SimpleTest) {
-      networkTestFinished();
-    } else {
-      finish();
-    }
-  };
   return this.chain.execute()
     .then(() => this.close())
+    .then(() => {
+      if (window.SimpleTest) {
+        networkTestFinished();
+      } else {
+        finish();
+      }
+    })
     .catch(e =>
-      ok(false, 'Error in test execution: ' + e +
-         ((typeof e.stack === 'string') ?
-          (' ' + e.stack.split('\n').join(' ... ')) : '')))
-    .then(() => finished())
-    .catch(e =>
-      ok(false, "Error in finished()"));
+           ok(false, 'Error in test execution: ' + e +
+              ((typeof e.stack === 'string') ?
+               (' ' + e.stack.split('\n').join(' ... ')) : '')));
 };
 
 /**
  * Routes ice candidates from one PCW to the other PCW
  */
 PeerConnectionTest.prototype.iceCandidateHandler = function(caller, candidate) {
   info("Received: " + JSON.stringify(candidate) + " from " + caller);