From c3673885ce9f78aab1d3370153cc7886058d97ff Mon Sep 17 00:00:00 2001 From: Bryce Van Dyk Date: Mon, 22 Aug 2016 08:52:45 +1200 Subject: [PATCH] Bug 1145011 - Add test for waitingforkey. r=jya MozReview-Commit-ID: LKlDd4wkRSE --HG-- extra : rebase_source : e7089e48d90739470686868541c9e8bfd6789dc0 --- dom/media/test/eme.js | 63 ++++++++---- dom/media/test/mochitest.ini | 2 + dom/media/test/test_eme_waitingforkey.html | 111 +++++++++++++++++++++ 3 files changed, 157 insertions(+), 19 deletions(-) create mode 100644 dom/media/test/test_eme_waitingforkey.html diff --git a/dom/media/test/eme.js b/dom/media/test/eme.js index 1ea3f06a358c..ec49c1511744 100644 --- a/dom/media/test/eme.js +++ b/dom/media/test/eme.js @@ -249,7 +249,7 @@ function LoadTest(test, elem, token, loadParams) Log(token, "sourceopen"); return Promise.all(test.tracks.map(function(track) { return AppendTrack(test, ms, track, token, loadParams); - })).then(function(){ + })).then(function() { if (loadParams && loadParams.noEndOfStream) { Log(token, "Tracks loaded"); } else { @@ -257,6 +257,8 @@ function LoadTest(test, elem, token, loadParams) ms.endOfStream(); } resolve(); + }).catch(function() { + Log(token, "error while loading tracks"); }); }) }); @@ -299,7 +301,7 @@ function SetupEME(test, token, params) // Log events dispatched to make debugging easier... [ "canplay", "canplaythrough", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", - "stalled", "suspend", "waiting", + "stalled", "suspend", "waiting", "waitingforkey", ].forEach(function (e) { v.addEventListener(e, function(event) { Log(token, "" + e); @@ -314,13 +316,28 @@ function SetupEME(test, token, params) : bail(token + " Failed to set MediaKeys on