| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="../../resources/gesture-util.js"></script> |
| <li>Middle-click inside the <div> with the red border below to activate autoscroll.</li> |
| <li>First, move the mouse such that you scroll the <div> in unavailable scroll direction and then in scrollable direction.</li> |
| <li>If bug repros, it won't scroll in available direction.</li> |
| window.onload = async function() |
| const container = document.getElementById("container"); |
| promise_test (async (t) => { |
| await waitForCompositorCommit(); |
| await mouseClickOn(container.offsetLeft + 10, container.offsetTop + 10, middleButton); |
| //Move mouse in unavailable direction first. |
| await mouseMoveTo(container.offsetLeft + (container.offsetWidth/2), container.offsetTop + 10); |
| //Move mouse in available direction to scroll the content. |
| await mouseMoveTo(container.offsetLeft + (container.offsetWidth/2), container.offsetTop + container.offsetHeight); |
| return container.scrollTop === container.scrollHeight - container.clientHeight; |
| }, "Failed to scroll container with middle-click autoscroll."); |
| }, "Container scrolled in available direction."); |