Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: third_party/WebKit/LayoutTests/fast/events/selection-autoscroll-borderbelt.html

Issue 2355643002: Selection-autoscroll should be triggered when the pointer is in the border belt. (Closed)
Patch Set: Patch Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/events/selection-autoscroll-borderbelt.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/selection-autoscroll-borderbelt.html b/third_party/WebKit/LayoutTests/fast/events/selection-autoscroll-borderbelt.html
new file mode 100644
index 0000000000000000000000000000000000000000..57f66abbf0dfd73a29da64d56f4b3324e9a541e2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/selection-autoscroll-borderbelt.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<body>
bokan 2016/09/19 21:13:18 Nit: no <body> tag
+For manual testing, Select some text and drag the mouse close to the bottom
+(do not reach the border) before releasing.
+ <div id="scrollable" style="height: 100px; overflow: auto; border: solid 3px #cc0000">
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ <p>This is a very long sentence to take up some space.</p>
+ </div>
+</body>
+<script>
+var scrollable = document.getElementById("scrollable");
+var retryCount = 0;
+var testAutoscroll = async_test('Selection-autoscroll should be triggered when the mouse is within the border belt');
+testAutoscroll.step(function() {
+ function checkScrolled() {
+ console.log(scrollable.scrollTop);
bokan 2016/09/19 21:13:18 Please remove the logging output.
+ if (scrollable.scrollTop > 0) {
+ testAutoscroll.done();
+ return;
+ }
+ ++retryCount;
+ if (retryCount > 4) {
+ assert_true(false);
+ testAutoscroll.done();
+ return;
+ }
+ // Autoscroll is occurred evey 0.05 sec.
bokan 2016/09/19 21:13:18 Where does this constant come from? I see Autoscro
+ window.setTimeout(checkScrolled, 50);
bokan 2016/09/19 21:13:18 We generally avoid using window.setTimeout in test
+ return;
+ }
+
+ if (!window.eventSender)
+ return;
+
+ var dragStartX = scrollable.offsetLeft + 20;
+ var dragStartY = scrollable.offsetTop + 5;
+ var dragEndX = dragStartX;
+ var dragEndY = scrollable.offsetTop + scrollable.offsetHeight - 10;
+
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(dragStartX, dragStartY);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(dragEndX, dragEndY);
+
+ checkScrolled();
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698