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

Unified Diff: third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html

Issue 2108093002: Animations: Reduce flakiness of transitions/cancel-and-start-new.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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-and-start-new.html
diff --git a/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html b/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html
index 5aa27849141b6f78ae60b607a1817fae4a3eb40b..461ee3d9a15df00cc02a434e7f38cfd70fd33405 100644
--- a/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html
+++ b/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html
@@ -1,10 +1,9 @@
<!DOCTYPE html>
-
<html>
<head>
<style>
#target {
- position: relative;
+ position: absolute;
background-color: #933;
width: 50px;
height: 50px;
@@ -13,13 +12,11 @@
}
#target.transition-top {
top: 400px;
- -webkit-transition: top 100ms linear;
- transition: top 100ms linear;
+ transition: top 200ms linear;
}
#target.transition-left {
left: 400px;
- -webkit-transition: left 100ms linear;
- transition: left 100ms linear;
+ transition: left 200ms linear;
}
</style>
<script>
@@ -37,18 +34,19 @@
function cancelTransition()
{
document.getElementById("target").classList.remove('transition-top');
+ setTimeout(startNewTransition, 100);
}
function startNewTransition()
{
document.getElementById("target").classList.add('transition-left');
- setTimeout(check, 50);
+ setTimeout(check, 100);
}
function check()
{
var left = parseFloat(window.getComputedStyle(document.getElementById('target')).left);
- if (isEqual(left, 200, 50))
+ if (isEqual(left, 200, 80))
var result = "<span style='color:green'>PASS</span>";
else
var result = "<span style='color:red'>FAIL(was: " + left + ", expected: 200)</span>";
@@ -60,12 +58,13 @@
function start()
{
document.getElementById("target").classList.add('transition-top');
- setTimeout("cancelTransition()", 50);
- setTimeout("startNewTransition()", 100);
+ setTimeout(cancelTransition, 100);
alancutter (OOO until 2018) 2016/06/30 04:36:20 Use internals.pauseAnimations() instead of setTime
Eric Willigers 2016/07/01 03:15:46 Done
}
+
+ window.onload = start;
</script>
</head>
-<body onload="start()">
+<body>
<p>
Tests that having stopped a transition before it completes, a subsequent
transition starts correctly.
« 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