blob: 4695a7dc14909e942e4ad6378880094aac19376c [file] [edit]
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<style>
@-webkit-keyframes bounce {
from {
-webkit-transform: translate3d(0,0,0);
}
to {
-webkit-transform: translate3d(200px,0,0);
}
}
#animator {
position: relative;
top: 0px;
width: 100px;
height: 100px;
background-color: blue;
-webkit-animation-name: bounce;
-webkit-animation-duration: 100ms;
-webkit-animation-iteration-count: infinite;
}
</style>
<script>
var hasScrolled = false;
function sawIteration(event) {
if (hasScrolled) {
document.getElementById("results").innerText = "PASS: Saw iteration after scrolling";
testRunner.notifyDone();
}
}
async function startScroll() {
if (window.eventSender) {
await eventSender.asyncMouseMoveTo(200, 200);
await eventSender.asyncMouseDown();
await eventSender.asyncMouseMoveTo(200, 300);
setTimeout(endScroll, 100);
}
}
async function endScroll() {
await eventSender.asyncMouseUp();
hasScrolled = true;
}
function startTest() {
var animator = document.getElementById("animator");
animator.addEventListener("webkitAnimationIteration", sawIteration, false);
setTimeout(startScroll, 100);
}
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
window.addEventListener("load", startTest, false);
</script>
<div id="animator"></div>
<div id="results"></div>