Index: LayoutTests/paint/invalidation/animated-gif.html |
diff --git a/LayoutTests/paint/invalidation/animated-gif.html b/LayoutTests/paint/invalidation/animated-gif.html |
index 312dbb110304ec4f552b4ca72cd532e8eb21a470..235c6590f4cc79a75a27f2e5b6100c608743b04f 100644 |
--- a/LayoutTests/paint/invalidation/animated-gif.html |
+++ b/LayoutTests/paint/invalidation/animated-gif.html |
@@ -7,26 +7,15 @@ |
<script> |
window.testIsAsync = true; |
-// Steps: |
-// 1. Load the image |
-// 2. Start tracking paint invalidation rects |
-// 3. Call layoutAndPaintAsyncThen (via runRepaintTest, which does this for us) to draw a frame |
-// 4. Wait longer than 100ms, so that the timer between the first and second animated GIF |
-// frame expires and a paint invalidation is issued on the animated GIF. (100ms is the |
-// length of the first frame of the animation in the GIF file.) |
-// 5. Stop tracking paint invalidation rects (finishRepaintTest does this for us) |
- |
-// These steps differ from a standard repaint test in that step 2 precedes step 3. |
-// This is critical because layoutAndPaintAsyncThen may take longer than the 100ms of the timer, |
-// so we may miss it. |
- |
function repaintTest() { |
- setTimeout(finishRepaintTest, 150); |
+ window.internals.advanceImageAnimation(targetImage); |
+ requestAnimationFrame(function() { |
+ finishRepaintTest(); |
+ }); |
} |
function targetImageOnload() { |
- if (window.internals) |
- window.internals.startTrackingRepaints(document); |
+ window.internals.startTrackingRepaints(document); |
runRepaintTest(); |
} |