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 @@ ...@@ -61,6 +61,7 @@
<script src="../resources/testharness.js"></script> <script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script> <script src="../resources/testharnessreport.js"></script>
<script src='../resources/gesture-util.js'></script>
<script> <script>
var rootScroller = document.querySelector('#rootscroller'); var rootScroller = document.querySelector('#rootscroller');
...@@ -73,9 +74,7 @@ ...@@ -73,9 +74,7 @@
var x = dialogRect.left + dialogRect.width / 2; var x = dialogRect.left + dialogRect.width / 2;
var y = dialogRect.top + dialogRect.height / 2; var y = dialogRect.top + dialogRect.height / 2;
test(function() { promise_test(async () => {
if (!window.eventSender)
return;
// Sanity check - there should be no initial scroll. // Sanity check - there should be no initial scroll.
assert_equals(dialog.scrollLeft, 0); assert_equals(dialog.scrollLeft, 0);
...@@ -84,10 +83,9 @@ ...@@ -84,10 +83,9 @@
assert_equals(rootscroller.scrollTop, 0); assert_equals(rootscroller.scrollTop, 0);
// This scroll should fully scroll the dialog // This scroll should fully scroll the dialog
eventSender.gestureScrollBegin(x, y); await smoothScrollWithXY(3000, 3000, x, y, GestureSourceType.TOUCH_INPUT, SPEED_INSTANT);
eventSender.gestureScrollUpdate(-3000, 0);
eventSender.gestureScrollUpdate(0, -3000); await waitFor( () => { return dialog.scrollLeft == dialog.scrollWidth - dialog.clientWidth; } );
eventSender.gestureScrollEnd(0, 0);
assert_equals(dialog.scrollLeft, dialog.scrollWidth - dialog.clientWidth); assert_equals(dialog.scrollLeft, dialog.scrollWidth - dialog.clientWidth);
assert_equals(dialog.scrollTop, dialog.scrollHeight - dialog.clientHeight); assert_equals(dialog.scrollTop, dialog.scrollHeight - dialog.clientHeight);
...@@ -97,10 +95,9 @@ ...@@ -97,10 +95,9 @@
// This scroll would normally chain up to the viewport but the "real" // This scroll would normally chain up to the viewport but the "real"
// viewport has no scrolling. Make sure we don't scroll the // viewport has no scrolling. Make sure we don't scroll the
// document.rootScroller. // document.rootScroller.
eventSender.gestureScrollBegin(x, y); await smoothScrollWithXY(3000, 3000, x, y, GestureSourceType.TOUCH_INPUT, SPEED_INSTANT);
eventSender.gestureScrollUpdate(-3000, 0);
eventSender.gestureScrollUpdate(0, -3000); await waitFor( () => { return dialog.scrollLeft == dialog.scrollWidth - dialog.clientWidth; } );
eventSender.gestureScrollEnd(0, 0);
assert_equals(dialog.scrollLeft, dialog.scrollWidth - dialog.clientWidth); assert_equals(dialog.scrollLeft, dialog.scrollWidth - dialog.clientWidth);
assert_equals(dialog.scrollTop, dialog.scrollHeight - dialog.clientHeight); 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