Bug 1431169 - P3. Stop playback mochitest on error. r=rillian
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 17 Jan 2018 22:38:02 +0100
changeset 454108 e3c55a7d764208a7560aaf18909be790887a2e0d
parent 454107 e97d7f1498adb10c3fb615189a2e7a9479184441
child 454109 302d28afd44ffc67f275854008ab3dcd01a17f5f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1431169
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 1431169 - P3. Stop playback mochitest on error. r=rillian Otherwise we need to wait for the test to timeout as the ended event won't be fired. MozReview-Commit-ID: HKgkG40Dz6w
dom/media/test/test_playback.html
--- a/dom/media/test/test_playback.html
+++ b/dom/media/test/test_playback.html
@@ -34,16 +34,20 @@ function startTest(test, token) {
     is(test.name, v.name, test.name + ": Name should match #1");
     checkMetadata(test.name, v, test);
   }}(test, v);
 
   var noLoad = function(test, v) { return function() {
     ok(false, test.name + " should not fire 'load' event");
   }}(test, v);
 
+  var noError = function(test, v) { return function() {
+    ok(false, test.name + " should not fire 'error' event " + v.error.message);
+  }}(test, v);
+
   var finish = function() {
     v.finished = true;
     v.removeEventListener("timeupdate", timeUpdate);
     removeNodeAndSource(v);
     manager.finished(v.token);
   }
 
   // We should get "ended" and "suspend" events to finish the test.
@@ -79,16 +83,17 @@ function startTest(test, token) {
     if (v.prevTime > v.currentTime) {
       ok(false, test.name + " time should run forwards: p=" +
                 v.prevTime + " c=" + v.currentTime);
     }
     v.prevTime = v.currentTime;
   }}(test, v);
 
   v.addEventListener("load", noLoad);
+  v.addEventListener("error", noError);
   v.addEventListener("loadedmetadata", check);
   v.addEventListener("timeupdate", timeUpdate);
 
   // We should get "ended" and "suspend" events for every resource
   v.addEventListener("ended", checkEnded);
   v.addEventListener("suspend", checkSuspended);
 
   document.body.appendChild(v);