Commit 25818e61 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Fix flaky unanimated-style.html

animations/unanimated-style.html was using setTimout(0) to wait for the
initial style calculations
before starting the animation. This isn't a reliable method.

We now force style recalc explicitly by reading an element's offsetTop.

BUG=770362

Change-Id: Icf518b3a43b51d854de81cc2fab371922e271e16
Reviewed-on: https://chromium-review.googlesource.com/699974Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506497}
parent dfe05ebb
......@@ -3713,7 +3713,6 @@ crbug.com/767469 virtual/mojo-loading/http/tests/navigation/start-load-during-pr
crbug.com/767892 [ Win Linux Mac ] virtual/mojo-loading/http/tests/devtools/startup/database-open.html [ Pass Timeout ]
# Sheriff failures 2017-09-29
crbug.com/770362 [ Linux Debug ] virtual/threaded/animations/unanimated-style.html [ Pass Timeout ]
# Sheriff failures 2017-10-02
crbug.com/770971 [ Win7 ] fast/forms/suggested-value.html [ Pass Failure ]
......
......@@ -15,7 +15,7 @@
animation: move 1s linear;
left: 400px;
}
@keyframes move {
from {
}
......@@ -23,7 +23,7 @@
left: 500px;
}
}
#result {
margin-top: 130px;
}
......@@ -31,23 +31,22 @@
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
if (window.testRunner)
if (window.testRunner)
testRunner.waitUntilDone();
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, "test", "left", 450, 8],
[0.5, "test", "left", 450, 0],
];
function setupTest()
{
document.getElementById('test').className = 'animating box';
test.offsetTop; // force style recalc
test.className = 'animating box';
runAnimationTest(expectedValues);
}
window.addEventListener('load', function() {
window.setTimeout(setupTest, 0);
}, false);
window.addEventListener('load', setupTest, false);
</script>
</head>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment