OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <style type="text/css"> | |
5 div { | |
6 line-height: 50px; | |
7 } | |
8 #outerdiv { | |
9 overflow:auto; | |
10 border: 2px solid #000FFF; | |
11 } | |
12 #innerdiv { | |
13 overflow:auto; | |
14 border: 2px solid #000000; | |
15 width: 120%; | |
16 padding: 5px; | |
17 } | |
18 </style> | |
19 <script> | |
20 function $(id) { return document.getElementById(id); } | |
21 | |
22 function finishTest() { | |
23 // Check that there was a horizontal scroll. | |
24 if (didScrollHorizontally) | |
25 testPassed('Outer div was scrolled horizontally.'); | |
26 else | |
27 testFailed('Outer div was not scrolled horizontally.'); | |
28 | |
29 // Check that there was no vertical scroll. | |
30 if (didScrollVertically) | |
31 testFailed('Outer div was scrolled vertically.'); | |
32 else | |
33 testPassed('Outer div was not scrolled vertically.'); | |
34 | |
35 window.testRunner.notifyDone(); | |
36 } | |
37 | |
38 var didScrollHorizontally; | |
39 var didScrollVertically; | |
40 | |
41 function testIt() { | |
42 var outerdiv = $('outerdiv'); | |
43 didScrollHorizontally = false; | |
44 didScrollVertically = false; | |
45 | |
46 // Check that the outer div has not been scrolled vertically. | |
47 if (outerdiv.scrollTop) | |
yosin_UTC9
2013/05/14 01:40:05
nit: these check are redundant. We don't need to v
tdanderson
2013/05/16 17:34:52
OK, removed.
| |
48 testFailed('outerdiv.scrollTop != 0 before the pan scroll.'); | |
49 else | |
50 testPassed('outerdiv.scrollTop == 0 before the pan scroll.'); | |
51 | |
52 // Check that the outer div has not been scrolled horizontally. | |
53 if (outerdiv.scrollLeft) | |
54 testFailed('outerdiv.scrollLeft != 0 before the pan scroll.'); | |
55 else | |
56 testPassed('outerdiv.scrollLeft == 0 before the pan scroll.'); | |
57 | |
58 // Attempt a digonal pan scroll originating in the inner div. | |
59 eventSender.mouseMoveTo(150, 150); | |
60 eventSender.mouseDown(1); | |
61 eventSender.mouseUp(1); | |
62 eventSender.mouseMoveTo(225, 75); | |
63 | |
64 var retryCount = 0; | |
65 | |
66 function checkScrolled() | |
67 { | |
68 if (outerdiv.scrollLeft) | |
69 didScrollHorizontally = true; | |
70 | |
71 if (outerdiv.scrollTop) | |
72 didScrollVertically = true; | |
73 | |
74 testPassed('retryCount is ' + retryCount); | |
75 ++retryCount; | |
76 if (retryCount > 10) { | |
yosin_UTC9
2013/05/14 01:40:05
We don't need to iterate 10 times for fast machine
tdanderson
2013/05/16 17:34:52
Done. Thanks a lot for the clarification.
| |
77 finishTest(); | |
78 return; | |
79 } | |
80 | |
81 window.setTimeout(checkScrolled, 50); | |
82 } | |
83 | |
84 checkScrolled(); | |
85 } | |
86 | |
87 function setUpTest() | |
88 { | |
89 if (!window.eventSender) { | |
90 console.log('Please run within DumpRenderTree.'); | |
91 return; | |
92 } | |
93 | |
94 window.jsTestIsAsync = false; | |
yosin_UTC9
2013/05/14 01:40:05
should be window.jsTestIsAsync = true and
don't ca
tdanderson
2013/05/16 17:34:52
Done.
| |
95 window.setTimeout(testIt, 0); | |
96 testRunner.waitUntilDone(); | |
97 } | |
98 </script> | |
99 </head> | |
100 <body> | |
101 <div id="outerdiv"> | |
102 <p>Top of outer div.</p> | |
103 <div id="innerdiv"> | |
104 <p>Inner div.</p> | |
105 </div> | |
106 <p>Bottom of outer div.</p> | |
107 </div> | |
108 <p>Test for <a href="http://crbug.com/232965">bug 232965</a> This tests that ver tical pan scrolling does not propagate from the inner div to the outer div when the outer div has no vertical overflow.</p> | |
109 <div id="console"></div> | |
110 <script src="../js/resources/js-test-pre.js"></script> | |
111 <script> | |
112 setUpTest(); | |
113 </script> | |
114 <script src="../js/resources/js-test-post.js"></script> | |
115 </body> | |
116 </html> | |
OLD | NEW |