Index: third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js |
diff --git a/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js b/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js |
index dfdbd3a1294bf16649d065f16739f49c88fc02d3..3b5fc0020a4a13fc181186abe5d9fed89c3ed012 100644 |
--- a/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js |
+++ b/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js |
@@ -139,15 +139,21 @@ class CompositedAnimationTestCommon { |
this.error.textContent += `${test.name}: ${message} `; |
} |
+ waitForCompositor() { |
+ return this.error.animate({opacity: ['1', '1']}, 1).ready; |
+ } |
+ |
layoutAndPaint() { |
if (window.testRunner) |
testRunner.waitUntilDone(); |
- requestAnimationFrame(() => { |
- if (window.internals) |
- this.assertAnimationCompositedState(); |
- if (window.testRunner) |
- testRunner.notifyDone(); |
+ this.waitForCompositor().then(() => { |
+ requestAnimationFrame(() => { |
+ if (window.internals) |
+ this.assertAnimationCompositedState(); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ }); |
}); |
} |