blob: 9c13cc4681fe33b96dc94c216086244d5329922a [file] [log] [blame]
<!DOCTYPE html>
<style>
#content {
width: 750px;
height: 10000px;
background-color: blue;
}
</style>
<script src="../../resources/js-test.js"></script>
<div id="content"></div>
<div id="console"></div>
<script>
jsTestIsAsync = true;
var prevScrollY;
var scrollStart;
function runTest() {
internals.settings.setScrollAnimatorEnabled(true);
window.addEventListener("scroll", onWindowScroll);
testRunner.layoutAndPaintAsyncThen(function() {
window.eventSender.keyDown('End');
});
}
function onWindowScroll() {
if (typeof prevScrollY === 'undefined') {
shouldNotBe("window.scrollY",
"document.body.scrollHeight - window.innerHeight");
shouldBeGreaterThan("window.scrollY", "0");
prevScrollY = window.scrollY;
if (window.scrollY === document.body.scrollHeight - window.innerHeight) {
// We wont get another scroll event. The failure was reported above
// but return early to prevent a timeout.
finishJSTest();
}
} else {
shouldBeGreaterThan("window.scrollY", "prevScrollY");
finishJSTest();
}
}
description("Tests that overflow scrolls on the root frame are animated.");
if (window.eventSender)
runTest();
else
debug("FAIL: This test requires window.eventSender.");
</script>