Bug 1269249: [MSE] P2. Add mochitest verifying behavior. r=jwwang

MozReview-Commit-ID: LxEjSyStUIE

--HG--
extra : rebase_source : ac543fd1e691cbd40133ed9a4453ecafbf53e65f
This commit is contained in:
Jean-Yves Avenard 2016-05-02 15:23:53 +10:00
Родитель 31a0cd2056
Коммит 6c48713ed0
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -23,6 +23,18 @@ runWithMSE(function(ms, v) {
var sb = ms.addSourceBuffer("video/mp4");
ok(sb, "Create a SourceBuffer");
// Log events for debugging.
var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
"loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort",
"waiting", "pause", "durationchange", "seeking", "seeked"];
function logEvent(e) {
var v = e.target;
info("got " + e.type + " event");
}
events.forEach(function(e) {
v.addEventListener(e, logEvent, false);
});
sb.addEventListener('error', (e) => { ok(false, "Got Error: " + e); SimpleTest.finish(); });
fetchAndLoad(sb, 'bipbop/bipbop', ['init'], '.mp4')
.then(function() {
@ -45,6 +57,7 @@ runWithMSE(function(ms, v) {
ms.endOfStream();
var promises = [];
promises.push(once(ms, "sourceended"));
promises.push(once(v, "playing"));
promises.push(once(v, "ended"));
return Promise.all(promises);
}).then(function() {