Bug 1421920 - Remove unnecessary script in test_eme_unsetMediaKeys_then_capture.html for further debugging. r=jwwang
authorKilik Kuo <kikuo@mozilla.com>
Fri, 01 Dec 2017 10:59:57 +0800
changeset 394643 2a5765cbd308215f11ea6bc7b52e71228709d971
parent 394642 fee99376eef35459556b6f35e08fdb5825876d7a
child 394644 1294e490afc2d16596baa7497dd4c758864f9afc
push id33019
push userbtara@mozilla.com
push dateMon, 04 Dec 2017 20:16:32 +0000
treeherdermozilla-central@4a003542df78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1421920, 1414464
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1421920 - Remove unnecessary script in test_eme_unsetMediaKeys_then_capture.html for further debugging. r=jwwang There're several causes for Bug 1414464. Removing unnecessary script in this test to eliminate the uncertainty for further debugging. MozReview-Commit-ID: IWvvlzJ24gw
dom/media/test/test_eme_unsetMediaKeys_then_capture.html
--- a/dom/media/test/test_eme_unsetMediaKeys_then_capture.html
+++ b/dom/media/test/test_eme_unsetMediaKeys_then_capture.html
@@ -32,24 +32,19 @@ function startTest(test, token)
 
   let v = document.createElement("video");
   document.body.appendChild(v);
 
   let finish = new EMEPromise;
 
   function onVideoEnded(ev) {
     ok(true, TimeStamp(token) + " (ENCRYPTED) content playback ended.");
-    v.removeEventListener("ended", onVideoEnded);
 
     function playClearVideo() {
-      var p1 = once(v, 'ended', (e) => {
-        ok(true, TimeStamp(token) + " (CLEAR) content playback ended.");
-        console.log(" bipbop.mp4 playback ended !!");
-      });
-      var p2 = once(v, 'loadeddata', (e) => {
+      var p1 = once(v, 'loadeddata', (e) => {
         ok(true, TimeStamp(token) + " Receiving event 'loadeddata' for (CLEAR) content.");
         canvasElem = document.createElement('canvas');
         document.body.appendChild(canvasElem);
         ctx2d = canvasElem.getContext('2d');
 
         var gotTypeError = false;
         try {
           ctx2d.drawImage(v, 0, 0);
@@ -57,37 +52,37 @@ function startTest(test, token)
           if (e instanceof TypeError) {
             gotTypeError = true;
           }
         }
         ok(!gotTypeError, TimeStamp(token) + " Canvas2D context drawImage succeed.")
       });
       v.src = 'bipbop_225w_175kbps.mp4';
       v.play();
-      Promise.all([p1, p2, closeSessions()]).then(() => {
+      Promise.all([p1]).then(() => {
         manager.finished(token);
       }, () => {
         ok(false, TimeStamp(token) + " Something wrong.");
         manager.finished(token);
       });
     }
 
-    Promise.all(sessions.map(s => s.close()))
+    closeSessions()
     .then(() => {
       v.setMediaKeys(null)
       .then(() => {
         ok(true, TimeStamp(token) + " Setting MediaKeys to null.");
         playClearVideo();
       }, () => {
         ok(false, TimeStamp(token) + " Setting MediaKeys to null.");
       });;
     });
   }
 
-  v.addEventListener("ended", onVideoEnded);
+  once(v, "ended", onVideoEnded);
 
   // Create a MediaKeys object and set to HTMLMediaElement then start the playback.
   Promise.all([
     LoadInitData(v, test, token),
     CreateAndSetMediaKeys(v, test, token),
     LoadTest(test, v, token)])
   .then(values => {
     let initData = values[0];