зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1269249: [MSE] P2. Add mochitest verifying behavior. r=jwwang
MozReview-Commit-ID: LxEjSyStUIE --HG-- extra : rebase_source : ac543fd1e691cbd40133ed9a4453ecafbf53e65f
This commit is contained in:
Родитель
31a0cd2056
Коммит
6c48713ed0
|
@ -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() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче