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 draft
authorRay Lin <ralin@mozilla.com>
Wed, 24 May 2017 13:19:55 +0800
changeset 584266 4d69f8aa4bd21be7c52b866fbb3ed23e40f7a4e8
parent 584216 f81bcc23d37d7bec48f08b19a9327e93c54d37b5
child 630316 31a45f557bd438a98391e4c459c0686f910b8965
push id60668
push userbmo:ralin@mozilla.com
push dateThu, 25 May 2017 03:52:04 +0000
bugs1367194
milestone55.0a1
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
toolkit/content/tests/widgets/test_videocontrols.html
--- 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++;
 }