Bug 1127725 - free media element node to release decoder. r=cajbir a=testonly
authorAlfredo Yang <ayang@mozilla.com>
Fri, 30 Jan 2015 00:00:00 +0100
changeset 249734 9d4e384f97c0154e98f46eff3b4a870abc66baaa
parent 249733 f1c5ebda7ecfb588ce171de26d56ba78c2dc9522
child 249735 e081d3fbd502e585aeb9c6e7a977123874fc53d5
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir, testonly
bugs1127725
milestone37.0a2
Bug 1127725 - free media element node to release decoder. r=cajbir a=testonly
dom/media/test/test_fastSeek-forwards.html
--- a/dom/media/test/test_fastSeek-forwards.html
+++ b/dom/media/test/test_fastSeek-forwards.html
@@ -24,34 +24,37 @@ https://bugzilla.mozilla.org/show_bug.cg
     // seeking backwards. This can happen if the keyframe before the seek
     // target is before the current playback position. We'd prefer to seek to
     // the keyframe after the seek target in this case, but we don't implement
     // this yet (bug 1026330).
     var manager = new MediaTestManager;
 
     var onSecondSeekComplete = function(event) {
       var v = event.target;
+      v.removeEventListener("seeked", onSecondSeekComplete);
       ok(v.currentTime >= v.firstSeekTarget, v.name + " seek never go backwards. time=" + v.currentTime + " firstSeekTarget=" + v.firstSeekTarget + " secondSeekTarget=" + v.secondSeekTarget);
       manager.finished(v.token);
+      removeNodeAndSource(v);
     };
 
     var onFirstSeekComplete = function(event) {
       var v = event.target;
       v.removeEventListener("seeked", onFirstSeekComplete);
       // Seek to 75% of the way between the start and the first keyframe
       // using fastSeek. We then test that the currentTime doesn't drop back
       // to the previous keyframe, currentTime should go forwards.
       v.addEventListener("seeked", onSecondSeekComplete);
       v.secondSeekTarget = v.keyframes[1] * 0.75;
       v.fastSeek(v.secondSeekTarget);
     }
 
     var onLoadedMetadata = function(event) {
       // Seek to the mid-point between the start and the first keyframe.
       var v = event.target;
+      v.removeEventListener("loadedmetadata", onLoadedMetadata);
       v.addEventListener("seeked", onFirstSeekComplete);
       v.firstSeekTarget = v.keyframes[1] * 0.5;
       v.currentTime = v.firstSeekTarget;
     }
 
     function startTest(test, token) {
       manager.started(token);
       v = document.createElement("video");