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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scroll-by-page.html

Issue 1557993002: Add scroll units in GestureEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test on Mac Created 4 years, 11 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../../resources/js-test.js"></script>
5 <style type="text/css">
6 ::-webkit-scrollbar {
7 width: 0px;
8 height: 0px;
9 }
10
11 #greenbox {
12 width: 100px;
13 height: 2000px;
14 background: green;
15 }
16 #redbox {
17 width: 100px;
18 height: 2000px;
19 background: red;
20 }
21
22 </style>
23 </head>
24 <body style="margin:0" onload="runTest();">
25
26 <div id="greenbox"></div>
27 <div id="redbox"></div>
28
29 <p id="description"></p>
30 <div id="console"></div>
31 <script type="text/javascript">
32
33 function gestureScroll()
34 {
35 eventSender.gestureScrollBegin("touchpad", 10, 20);
36 eventSender.gestureScrollUpdate("touchpad", 0, -1, false, "Page");
37 eventSender.gestureScrollUpdate("touchpad", 0, -2, false, "Page");
38 eventSender.gestureScrollUpdate("touchpad", 0, 1, false, "Page");
39 eventSender.gestureScrollEnd("touchpad", 0, 0);
40
41 // see kMinFractionToStepWhenPaging in ScrollableArea.cppP
42 // 2 is the expected number of pages scrolled (-1 + -2 + 1)
43 shouldBecomeEqual("document.scrollingElement.scrollTop >= window.innerHeight * 0.875 * 2", "true", finishJSTest, 1000);
44 }
45
46 jsTestIsAsync = true;
47
48 function runTest()
49 {
50 if (window.eventSender) {
51 description('This tests gesture scrolling by pages.');
52 gestureScroll();
53 } else {
54 debug("This test requires DumpRenderTree. Gesture-scroll the page to va lidate the implementation.");
55 }
56 }
57 </script>
58
59 </body>
60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698