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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <body>
bokan 2016/09/19 21:13:18 Nit: no <body> tag
5 For manual testing, Select some text and drag the mouse close to the bottom
6 (do not reach the border) before releasing.
7 <div id="scrollable" style="height: 100px; overflow: auto; border: solid 3px #cc0000">
8 <p>This is a very long sentence to take up some space.</p>
9 <p>This is a very long sentence to take up some space.</p>
10 <p>This is a very long sentence to take up some space.</p>
11 <p>This is a very long sentence to take up some space.</p>
12 <p>This is a very long sentence to take up some space.</p>
13 <p>This is a very long sentence to take up some space.</p>
14 <p>This is a very long sentence to take up some space.</p>
15 <p>This is a very long sentence to take up some space.</p>
16 <p>This is a very long sentence to take up some space.</p>
17 <p>This is a very long sentence to take up some space.</p>
18 </div>
19 </body>
20 <script>
21 var scrollable = document.getElementById("scrollable");
22 var retryCount = 0;
23 var testAutoscroll = async_test('Selection-autoscroll should be triggered when t he mouse is within the border belt');
24 testAutoscroll.step(function() {
25 function checkScrolled() {
26 console.log(scrollable.scrollTop);
bokan 2016/09/19 21:13:18 Please remove the logging output.
27 if (scrollable.scrollTop > 0) {
28 testAutoscroll.done();
29 return;
30 }
31 ++retryCount;
32 if (retryCount > 4) {
33 assert_true(false);
34 testAutoscroll.done();
35 return;
36 }
37 // Autoscroll is occurred evey 0.05 sec.
bokan 2016/09/19 21:13:18 Where does this constant come from? I see Autoscro
38 window.setTimeout(checkScrolled, 50);
bokan 2016/09/19 21:13:18 We generally avoid using window.setTimeout in test
39 return;
40 }
41
42 if (!window.eventSender)
43 return;
44
45 var dragStartX = scrollable.offsetLeft + 20;
46 var dragStartY = scrollable.offsetTop + 5;
47 var dragEndX = dragStartX;
48 var dragEndY = scrollable.offsetTop + scrollable.offsetHeight - 10;
49
50 eventSender.dragMode = false;
51 eventSender.mouseMoveTo(dragStartX, dragStartY);
52 eventSender.mouseDown();
53 eventSender.mouseMoveTo(dragEndX, dragEndY);
54
55 checkScrolled();
56 });
57 </script>
OLDNEW
« 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