Backed out changeset 2b077be047c0 (bug 1208373) for test failures in test_all_synthetic_events.html on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 09 Jun 2016 15:19:09 +0200
changeset 301297 df403befe9fe76dea67ca4a0fb4386c6cab6bf93
parent 301296 b7602995ca0f432feee77356f46102779ab02f5f
child 301298 8126ffafaf6d0f41a40d126e4b2e148d1532509f
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 out2b077be047c0bb50e8c72e9922a5fa0b7ec4df87
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 2b077be047c0 (bug 1208373) for test failures in test_all_synthetic_events.html on a CLOSED TREE
dom/media/tests/mochitest/head.js
dom/media/tests/mochitest/mediaStreamPlayback.js
--- a/dom/media/tests/mochitest/head.js
+++ b/dom/media/tests/mochitest/head.js
@@ -585,38 +585,16 @@ function createOneShotEventWrapper(wrapp
   obj[onx] = e => {
     info(wrapper + ': "on' + event + '" event fired');
     e.wrapper = wrapper;
     wrapper[onx](e);
     wrapper[onx] = unexpected;
   };
 }
 
-/**
- * Returns a promise that resolves when `target` has raised an event with the
- * given name. Cancel the returned promise by passing in a `cancelPromise` and
- * resolve it.
- *
- * @param {object} target
- *        The target on which the event should occur.
- * @param {string} name
- *        The name of the event that should occur.
- * @param {promise} cancelPromise
- *        A promise that on resolving rejects the returned promise,
- *        so we can avoid logging results after a test has finished.
- */
-function haveEvent(target, name, cancelPromise) {
-  var listener;
-  var p = Promise.race([
-    (cancelPromise || new Promise()).then(e => Promise.reject(e)),
-    new Promise(resolve => target.addEventListener(name, listener = resolve))
-  ]);
-  p.then(() => target.removeEventListener(name, listener));
-  return p;
-};
 
 /**
  * This class executes a series of functions in a continuous sequence.
  * Promise-bearing functions are executed after the previous promise completes.
  *
  * @constructor
  * @param {object} framework
  *        A back reference to the framework which makes use of the class. It is
--- a/dom/media/tests/mochitest/mediaStreamPlayback.js
+++ b/dom/media/tests/mochitest/mediaStreamPlayback.js
@@ -50,37 +50,27 @@ MediaStreamPlayback.prototype = {
     var elem = this.mediaElement;
     var waitForEnded = () => new Promise(resolve => {
       elem.addEventListener('ended', function ended() {
         elem.removeEventListener('ended', ended);
         resolve();
       });
     });
 
-    var noTrackEnded = Promise.all(this.mediaStream.getTracks().map(t => {
-      let onNextLoop = wait(0);
-      let p = Promise.race([
-        onNextLoop,
-        haveEvent(t, "ended", onNextLoop)
-          .then(() => Promise.reject("Unexpected ended event for track " + t.id),
-                () => Promise.resolve())
-      ]);
-      t.stop();
-      return p;
-    }));
+    // TODO (bug 910249) Also check that all the tracks are local.
+    this.mediaStream.getTracks().forEach(t => t.stop());
 
     // XXX (bug 1208316) When we implement MediaStream.active, do not stop
     // the stream. We just do it now so the media element will raise 'ended'.
     if (!this.mediaStream.stop) {
       return;
     }
     this.mediaStream.stop();
     return timeout(waitForEnded(), ENDED_TIMEOUT_LENGTH, "ended event never fired")
-             .then(() => ok(true, "ended event successfully fired"))
-             .then(() => noTrackEnded);
+             .then(() => ok(true, "ended event successfully fired"));
   },
 
   /**
    * Starts media with a media stream, runs it until a canplaythrough and
    * timeupdate event fires, and stops the media.
    *
    * @param {Boolean} isResume specifies if this media element is being resumed
    *                           from a previous run