blob: 61ef0213aa2b947dcb9875cd0fc699ac4cd94efa [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<style>
.bigbutton {
display:block;
width: 600px;
height: 600px;
}
</style>
</head>
<body style="width: 2000px">
<button class="bigbutton">One</button>
<button class="bigbutton">Two</button>
<button class="bigbutton">Three</button>
<script>
async_test((t) => {
window.scrollTo(0, 0);
assert_equals(window.pageXOffset, 0);
accessibilityController.addNotificationListener(t.step_func((target, notification) => {
if (target.role == 'AXRole: AXWebArea' && notification == 'ScrollPositionChanged') {
console.log('Got notification on web area');
accessibilityController.removeNotificationListener();
assert_equals(window.pageXOffset, 500);
t.done();
}
}));
window.setTimeout(function() {
window.scrollTo(500, 0);
}, 0);
window.setTimeout(t.step_func_done(() => {
assert_unreached();
}), 200);
}, "This test ensures that scrolling the window sends a notification.");
</script>
</body>
</html>