Bug 1024535 - Fix for failing video test on Windows 7. r=jwwang, a=test-only
authorMartijn Wargers <mwargers@mozilla.com>
Tue, 12 Aug 2014 16:09:56 -0700
changeset 209423 d2714b6fc28dd9cf27beef4b8331a5287bf2c275
parent 209422 3f100f09954234f910c85b37966e93c937c22ed4
child 209424 da78e23cbe3dfe125143adacc6191a16160690f7
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang, test-only
bugs1024535
milestone32.0
Bug 1024535 - Fix for failing video test on Windows 7. r=jwwang, a=test-only
content/media/test/test_load_candidates.html
--- a/content/media/test/test_load_candidates.html
+++ b/content/media/test/test_load_candidates.html
@@ -21,16 +21,19 @@ https://bugzilla.mozilla.org/show_bug.cg
 /** Test for Bug 465458 **/
 
 var manager = new MediaTestManager;
 
 function finish(evt) {
   var v = evt.target;
   is(v._error, 2, "Should have received 2 error events before loaded");
   v._finished = true;
+  // remove error event handler, because this would otherwise
+  // cause a failure on Windows 7, see bug 1024535
+  v.onerror = null;
   v.parentNode.removeChild(v);
   manager.finished(v.token);
 }
 
 function errorHandler(evt) {
   evt.target.parentNode._error++;
 }
 
@@ -40,17 +43,17 @@ var extension = {
   "video/ogg" : "ogv",
   "audio/ogg" : "oga",
   "video/webm" : "webm"
 };
 
 function startTest(test, token) {
   var v = document.createElement('video');
   v.preload = "auto";
-  v.addEventListener("error", function(){ok(false,"Error events on source children should not bubble");}, false);
+  v.onerror = function(){ok(false,"Error events on source children should not bubble");}
   v.token = token;
   manager.started(token);
   v._error = 0;
   v._finished = false;
   v._name = test.name;
 
   var s1 = document.createElement("source");
   s1.type = test.type;