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

Unified Diff: third_party/WebKit/LayoutTests/transitions/cancel-transition.html

Issue 2621603002: CSS Transitions: avoid flakes in cancel-transition.html (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/transitions/cancel-transition.html
diff --git a/third_party/WebKit/LayoutTests/transitions/cancel-transition.html b/third_party/WebKit/LayoutTests/transitions/cancel-transition.html
index 7ff24f2b309f9bfca9ffc3b201020d1ae3345e72..e62bc81143a57c1bf01b5b40104de06e07a8911c 100644
--- a/third_party/WebKit/LayoutTests/transitions/cancel-transition.html
+++ b/third_party/WebKit/LayoutTests/transitions/cancel-transition.html
@@ -48,6 +48,21 @@
<script>
'use strict';
+ function waitForProgress() {
+ var initialLeft = getComputedStyle(left).left;
+ return new Promise(resolve => {
+ function poll() {
+ var currentLeft = getComputedStyle(left).left;
+ if (currentLeft === initialLeft) {
alancutter (OOO until 2018) 2017/01/10 08:41:54 Shouldn't we see a change in the value after a sin
suzyh_UTC10 (ex-contributor) 2017/01/10 22:43:30 I don't see the harm in continuing to call rAF in
Eric Willigers 2017/01/11 03:07:42 We occasionally have more than 10 frames with the
+ requestAnimationFrame(poll);
+ } else {
+ resolve();
+ }
+ }
+ requestAnimationFrame(poll);
+ });
+ }
+
function waitSeveralFrames() {
return container.animate({opacity: ['1', '1']}, 100).finished;
}
@@ -56,7 +71,7 @@
getComputedStyle(container).height; // force style recalc
container.className = 'run';
getComputedStyle(container).height; // force style recalc - transition will start
- waitSeveralFrames().then(t.step_func(() => {
+ waitForProgress().then(t.step_func(() => {
assert_greater_than(parseFloat(getComputedStyle(left).left), 50);
container.className = '';
getComputedStyle(container).height; // force style recalc - transition will cancel
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698