Index: LayoutTests/paint/invalidation/animated-gif-background.html |
diff --git a/LayoutTests/paint/invalidation/animated-gif-background.html b/LayoutTests/paint/invalidation/animated-gif-background.html |
index 8edb5aed6470b78f7d135724158609c0d4a93eb7..fe5509c482cc73176517a1a0bc9fc82ecca993d2 100644 |
--- a/LayoutTests/paint/invalidation/animated-gif-background.html |
+++ b/LayoutTests/paint/invalidation/animated-gif-background.html |
@@ -8,26 +8,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(testTarget); |
+ requestAnimationFrame(function() { |
+ finishRepaintTest(); |
+ }); |
} |
function targetImageOnload() { |
- if (window.internals) |
- window.internals.startTrackingRepaints(document); |
+ window.internals.startTrackingRepaints(document); |
runRepaintTest(); |
} |