[chromium] compositing tests with videos fail in chromium DumpRenderTree, seeking...
[WebKit-https.git] / LayoutTests / compositing / resources / media-testing.js
index e303778d9f8dda4ead08be7eff038a3a8a121eba..0da79e7aa36257040531b736f7211b14d1fb961c 100644 (file)
@@ -4,13 +4,18 @@ if (window.layoutTestController)
 
 function ensureFrameVisible(video, videoRenderedCallback)
 {
-    video.addEventListener('timeupdate', function() {
+    var playingHandler = function() {
         video.pause();
         video.currentTime = 0;
+    };
+
+    var seekedHandler = function() {
         if (videoRenderedCallback)
             videoRenderedCallback();
-    }, false);
-    
+    };
+
+    video.addEventListener('playing', playingHandler, false);
+    video.addEventListener('seeked', seekedHandler, false);
     video.play();
 }