Commit 453cf902 authored by Navid Zolghadr's avatar Navid Zolghadr Committed by Commit Bot

Migrate root scroller test away from using EventSender

Bug: 1047176
Change-Id: I958edb07c881aa604ecb474f4aa735b69002c445
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2163649Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762155}
parent e66ab190
......@@ -61,6 +61,7 @@
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src='../resources/gesture-util.js'></script>
<script>
var rootScroller = document.querySelector('#rootscroller');
......@@ -73,9 +74,7 @@
var x = dialogRect.left + dialogRect.width / 2;
var y = dialogRect.top + dialogRect.height / 2;
test(function() {
if (!window.eventSender)
return;
promise_test(async () => {
// Sanity check - there should be no initial scroll.
assert_equals(dialog.scrollLeft, 0);
......@@ -84,10 +83,9 @@
assert_equals(rootscroller.scrollTop, 0);
// This scroll should fully scroll the dialog
eventSender.gestureScrollBegin(x, y);
eventSender.gestureScrollUpdate(-3000, 0);
eventSender.gestureScrollUpdate(0, -3000);
eventSender.gestureScrollEnd(0, 0);
await smoothScrollWithXY(3000, 3000, x, y, GestureSourceType.TOUCH_INPUT, SPEED_INSTANT);
await waitFor( () => { return dialog.scrollLeft == dialog.scrollWidth - dialog.clientWidth; } );
assert_equals(dialog.scrollLeft, dialog.scrollWidth - dialog.clientWidth);
assert_equals(dialog.scrollTop, dialog.scrollHeight - dialog.clientHeight);
......@@ -97,10 +95,9 @@
// This scroll would normally chain up to the viewport but the "real"
// viewport has no scrolling. Make sure we don't scroll the
// document.rootScroller.
eventSender.gestureScrollBegin(x, y);
eventSender.gestureScrollUpdate(-3000, 0);
eventSender.gestureScrollUpdate(0, -3000);
eventSender.gestureScrollEnd(0, 0);
await smoothScrollWithXY(3000, 3000, x, y, GestureSourceType.TOUCH_INPUT, SPEED_INSTANT);
await waitFor( () => { return dialog.scrollLeft == dialog.scrollWidth - dialog.clientWidth; } );
assert_equals(dialog.scrollLeft, dialog.scrollWidth - dialog.clientWidth);
assert_equals(dialog.scrollTop, dialog.scrollHeight - dialog.clientHeight);
......
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