Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / gesture-scrollbar-textarea.html
blob12a171e2b7aedc6ce99c319c33ab9b1b308f2f89
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../../resources/js-test.js"></script>
5 <style type="text/css">
6 ::-webkit-scrollbar {
7 background-color: #ccc;
8 height: 15px;
9 width: 15px;
12 ::-webkit-scrollbar-button {
13 display: none;
16 ::-webkit-scrollbar-thumb {
17 background-color: #777;
18 height: 15px;
19 width: 15px;
22 #text {
23 height: 300px;
24 width: 200px;
26 </style>
27 </head>
28 <body onload="runTest();">
29 <textarea id="text">
30 Attack your ankles catnip leap hiss chase the red dot, zzz run run I don't like
31 that food puking eat feed me. Attack shed everywhere sleep on your face
32 scratched bat sleep on your keyboard, chase the red dot attack your ankles
33 attack biting eat the grass bat. Sunbathe chase the red dot eat the grass
34 attack sleep on your face rip the couch, toss the mousie sleep in the sink lick
35 climb the curtains. I don't like that food meow climb the curtains toss the
36 mousie tail flick stuck in a tree, judging you toss the mousie stretching
37 hairball biting attack. Give me fish eat judging you claw, eat biting I don't
38 like that food toss the mousie catnip sleep in the sink toss the mousie purr.
39 Sniff sleep on your keyboard eat the grass lick, rip the couch give me fish leap
40 bat shed everywhere knock over the lamp jump on the table toss the mousie.
41 </textarea>
43 <script type="text/javascript">
45 var textArea;
47 function verticalScrollTest() {
48 textArea = document.getElementById('text');
49 var scrollbarX = textArea.offsetLeft + textArea.offsetWidth - 5;
50 var scrollThumbSafeOffset = 20;
51 var scrollbarY = textArea.offsetTop + scrollThumbSafeOffset;
53 // Ensure we use a touch with an area to test under touch adjustment
54 var touchWidth = 25;
55 var touchHeight = 25;
57 eventSender.gestureTapDown(
58 scrollbarX, scrollbarY, touchWidth, touchHeight);
59 shouldBe('textArea.scrollTop', '0');
60 eventSender.gestureShowPress(
61 scrollbarX, scrollbarY, touchWidth, touchHeight);
62 eventSender.gestureScrollBegin(
63 scrollbarX, scrollbarY, touchWidth, touchHeight);
64 eventSender.gestureScrollUpdate(0, 20);
65 eventSender.gestureScrollEnd(0, 0);
66 shouldBeGreaterThanOrEqual('textArea.scrollTop', '1');
68 // If we've got here, we've passed.
69 isSuccessfullyParsed();
72 function exitIfNecessary()
74 debug('Gesture events not implemented on this platform or broken');
75 isSuccessfullyParsed();
78 function runTest()
80 internals.settings.setMockScrollbarsEnabled(true);
81 if (window.eventSender) {
82 description(
83 'This tests scroll gesture events on a textarea scrollbar. ' +
84 'The textarea below should be slightly scrolled down ' +
85 'if successful.');
87 if (eventSender.clearTouchPoints)
88 verticalScrollTest();
89 else
90 exitIfNecessary();
91 } else {
92 debug("This test requires DumpRenderTree.");
95 </script>
96 </body>
97 </html>