bug 826584 - remove canplaythrough event listener if we timeout. r=jesup
authorJason Smith <jsmith@mozilla.com>
Fri, 04 Jan 2013 06:54:59 -0800
changeset 126723 3355493a69642ad095456bb563c5b1954b55b311
parent 126722 a37a77235f8373474980f8f302bc8b1776aa3c94
child 126724 324f9002ab8a95a41d99f0827f9f85a44e51f3a7
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs826584
milestone20.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 826584 - remove canplaythrough event listener if we timeout. r=jesup
dom/media/tests/mochitest/mediaStreamPlayback.js
--- a/dom/media/tests/mochitest/mediaStreamPlayback.js
+++ b/dom/media/tests/mochitest/mediaStreamPlayback.js
@@ -113,16 +113,18 @@ function MediaStreamPlayback(mediaElemen
 
     // Hooks up the media stream to the media element and starts playing it
     this.mediaElement.mozSrcObject = mediaStream;
     this.mediaElement.play();
 
     // If canplaythrough doesn't fire in enough time, we fail the test
     setTimeout(function() {
       if(!canPlayThroughFired) {
+        self.mediaElement.removeEventListener('canplaythrough',
+          canPlayThroughCallback, false);
         ok(false, "canplaythrough event never fired");
         onError();
       }
     }, timeoutLength);
   };
 
   /**
    * Stops the media with the associated stream.