From 6c48713ed0fabd542648871fb6dd3625e6f18f61 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 2 May 2016 15:23:53 +1000 Subject: [PATCH] Bug 1269249: [MSE] P2. Add mochitest verifying behavior. r=jwwang MozReview-Commit-ID: LxEjSyStUIE --HG-- extra : rebase_source : ac543fd1e691cbd40133ed9a4453ecafbf53e65f --- .../mediasource/test/test_FrameSelection_mp4.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dom/media/mediasource/test/test_FrameSelection_mp4.html b/dom/media/mediasource/test/test_FrameSelection_mp4.html index b62f0a9a7166..a5b8fa2903a9 100644 --- a/dom/media/mediasource/test/test_FrameSelection_mp4.html +++ b/dom/media/mediasource/test/test_FrameSelection_mp4.html @@ -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() {