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

Unified Diff: third_party/WebKit/LayoutTests/paint/invalidation/svg/image-animation-with-zoom.html

Issue 2882873002: Deflake paint/invalidation/svg/image-animation-with-zoom.html (Closed)
Patch Set: - Created 3 years, 7 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/svg/image-animation-with-zoom.html
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/image-animation-with-zoom.html b/third_party/WebKit/LayoutTests/paint/invalidation/svg/image-animation-with-zoom.html
index 280ffd168d99105ae080f5499f71fce245aca1a0..b56636becccb5346fe1f84962889153d9f9d40d0 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/svg/image-animation-with-zoom.html
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/image-animation-with-zoom.html
@@ -1,6 +1,6 @@
<!DOCTYPE HTML>
<!-- Test for crbug.com/375765: test passes if a green square is drawn. -->
-<script src="../resources/text-based-repaint.js"></script>
+<script src="../../../resources/run-after-layout-and-paint.js"></script>
<style>
html {
zoom: 2.2;
@@ -9,16 +9,29 @@
margin: 0;
padding: 0;
}
+ img {
+ width: 50px;
+ height: 50px;
+ }
</style>
<script>
-window.testIsAsync = true;
-window.onload = runRepaintTest;
-
-function repaintTest() {
- window.internals.advanceImageAnimation(targetImage);
- window.requestAnimationFrame(function() {
- finishRepaintTest();
- });
+if (window.testRunner)
+ testRunner.waitUntilDone();
+window.onload = function() {
+ targetImage.onload = function() {
+ runAfterLayoutAndPaint(function() {
+ if (window.internals) {
+ internals.advanceImageAnimation(targetImage);
+ runAfterLayoutAndPaint(function() {
+ internals.advanceImageAnimation(targetImage);
Xianzhu 2017/05/15 22:13:20 Without the second advanceImageAnimation, the test
pdr. 2017/05/16 01:39:50 I think I found the bug: https://cs.chromium.org/c
+ runAfterLayoutAndPaint(function() {
+ testRunner.notifyDone();
+ });
+ });
+ }
+ });
+ };
+ targetImage.src='resources/animate-center.svg';
};
</script>
-<img id="targetImage" src="resources/animate-center.svg" width="10px" height="10px">
+<img id="targetImage">

Powered by Google App Engine
This is Rietveld 408576698