Bug 1367194 - Explicitly pause video at the end of the test to prevent the media backend from pausing the video as the page closes and thus
randomly firing a 'pause' event when the test isn't expecting it. r=jaws
MozReview-Commit-ID: 65NrpKbIxi7
--- a/toolkit/content/tests/widgets/test_videocontrols.html
+++ b/toolkit/content/tests/widgets/test_videocontrols.html
@@ -415,20 +415,25 @@ function runTest(event) {
is(event.type, "seeked", "checking event type");
ok(true, "video position is at " + video.currentTime);
synthesizeMouse(video, scrubberOffsetX + 10, scrubberCenterY, {});
break;
case 33:
is(event.type, "play", "checking event type");
ok(true, "video resume after mouseup");
+ synthesizeMouse(video, playButtonCenterX, playButtonCenterY, { });
+ break;
+
+ // Bug 1367194: Always ensure video is paused before calling SimpleTest.finish().
+ case 34:
+ is(event.type, "pause", "checking event type");
SimpleTest.finish();
break;
-
default:
throw "unexpected test #" + testnum + " w/ event " + event.type;
}
testnum++;
}