Backed out changeset e6614cb53f0a (bug 1208373) for mda testfailures in test_peerConnection_setLocalOfferInHaveRemoteOffer.html

--HG--
extra : amend_source : c1699ce07f9ec8ddd2c65ed3b0e51adc3f207a83
This commit is contained in:
Carsten "Tomcat" Book 2016-05-13 13:51:54 +02:00
Родитель c8b8c1f17c
Коммит 9201048b08
2 изменённых файлов: 3 добавлений и 35 удалений

Просмотреть файл

@ -572,28 +572,6 @@ function createOneShotEventWrapper(wrapper, obj, event) {
};
}
/**
* 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.

Просмотреть файл

@ -55,17 +55,8 @@ MediaStreamPlayback.prototype = {
});
});
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'.
@ -74,8 +65,7 @@ MediaStreamPlayback.prototype = {
}
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"));
},
/**