Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: LayoutTests/paint/invalidation/animated-gif-background.html

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase harder Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}

Powered by Google App Engine
This is Rietveld 408576698