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

Unified Diff: third_party/WebKit/LayoutTests/paint/invalidation/animated-gif-transformed-offscreen.html

Issue 2319833002: Deflake paint/invalidation/animated-gif*.html (Closed)
Patch Set: Disable under-invalidation checking for offscreen gif animation Created 4 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: third_party/WebKit/LayoutTests/paint/invalidation/animated-gif-transformed-offscreen.html
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/animated-gif-transformed-offscreen.html b/third_party/WebKit/LayoutTests/paint/invalidation/animated-gif-transformed-offscreen.html
index 29a50bf99bb02dadb7d7dd62d55d67cdd46f0b39..d1f11ef585b21c3967ec9550701abce0c5cabe5a 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/animated-gif-transformed-offscreen.html
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/animated-gif-transformed-offscreen.html
@@ -1,37 +1,27 @@
<!doctype HTML>
<body>
<div id="targetDiv" style="height: 2000px; width: 2000px; will-change: transform">
-<img id="targetImage">
+ <img id="targetImage">
</div>
<script src="../../fast/repaint/resources/text-based-repaint.js"></script>
<script>
window.testIsAsync = true;
-// The image should not show a paint invalidation if offscreen if Slimming Paint is on.
-// Otherwise it should.
-
-// Steps:
-// 1. Load the image
-// 2. Move the image offscreen
-// 3. Start tracking paint invalidation rects
-// 4. Call layoutAndPaintAsyncThen (via runRepaintTest, which does this for us) to draw a frame
-// 5. 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.)
-// 6. Stop tracking paint invalidation rects (finishRepaintTest does this for us)
-
-// These steps differ from a standard repaint test in that step 3 precedes step 4.
-// This is critical because layoutAndPaintAsyncThen may take longer than the 100ms of the timer,
-// so we may miss it.
+// Disable under-invalidation checking because the "under-invalidation" of
+// offscreen gif animation is intentional.
+if (window.internals)
+ internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false;
function repaintTest() {
- setTimeout(finishRepaintTest, 150);
+ if (window.internals)
+ internals.advanceImageAnimation(targetImage);
+ requestAnimationFrame(function() {
+ finishRepaintTest();
+ });
}
function targetImageOnload() {
targetDiv.style.transform = "translateY(-1000px)";
- if (window.internals)
- window.internals.startTrackingRepaints(document);
runRepaintTest();
}

Powered by Google App Engine
This is Rietveld 408576698