Bug 1127725 - free media element ndoe to release decoder. r=cajbir
authorAlfredo Yang <ayang@mozilla.com>
Fri, 30 Jan 2015 00:00:00 +0100
changeset 226976 993b90fb20c9310436ebf413e5e9fab13520c717
parent 226975 dc9aad9b9ce1521b5e4beb928cdf6d45e406f93f
child 226977 6156b3b5f1e6abfe48b89c3f0497bead255abae4
push id54975
push usercbook@mozilla.com
push dateMon, 02 Feb 2015 08:02:01 +0000
treeherdermozilla-inbound@645f4595673d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir
bugs1127725
milestone38.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 1127725 - free media element ndoe to release decoder. r=cajbir
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");