Chromium Code Reviews| 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: 121%; | |
| 16 padding: 5px; | |
| 17 } | |
| 18 </style> | |
| 19 <script> | |
| 20 function $(id) { return document.getElementById(id); } | |
| 21 var outerdiv; | |
| 22 | |
| 23 function testIt() { | |
| 24 outerdiv = $('outerdiv'); | |
| 25 var retryCount = 0; | |
| 26 | |
| 27 // Attempt a digonal pan scroll originating in the inner div. | |
| 28 eventSender.mouseMoveTo(150, 150); | |
| 29 eventSender.mouseDown(1); | |
| 30 eventSender.mouseUp(1); | |
| 31 eventSender.mouseMoveTo(225, 75); | |
| 32 | |
| 33 function checkScrolled() | |
| 34 { | |
| 35 ++retryCount; | |
| 36 if (outerdiv.scrollLeft || retryCount > 10) { | |
| 37 finishTest(); | |
| 38 return; | |
| 39 } | |
| 40 | |
| 41 window.setTimeout(checkScrolled, 50); | |
|
jamesr
2013/05/29 22:46:56
this looks flaky to me. why 50ms? what happens if
yosin_UTC9
2013/05/30 01:45:54
50ms is auto scrolling interval. We may catch seco
yosin_UTC9
2013/05/30 04:29:56
Finally, I understand what you expect.
We can use
| |
| 42 } | |
| 43 | |
| 44 function finishTest() { | |
| 45 shouldNotBe('outerdiv.scrollLeft', '0'); | |
| 46 shouldBeZero('outerdiv.scrollTop'); | |
| 47 testRunner.notifyDone(); | |
| 48 } | |
| 49 | |
| 50 checkScrolled(); | |
| 51 } | |
| 52 | |
| 53 function setUpTest() | |
| 54 { | |
| 55 if (!window.eventSender) { | |
| 56 console.log('Please run within DumpRenderTree.'); | |
| 57 return; | |
| 58 } | |
| 59 | |
| 60 window.jsTestIsAsync = true; | |
| 61 window.onload = testIt; | |
| 62 } | |
| 63 </script> | |
| 64 </head> | |
| 65 <body> | |
| 66 <div id="outerdiv"> | |
| 67 <p>Top of outer div.</p> | |
| 68 <div id="innerdiv"> | |
| 69 <p>Inner div.</p> | |
| 70 </div> | |
| 71 <p>Bottom of outer div.</p> | |
| 72 </div> | |
| 73 <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> | |
| 74 <div id="console"></div> | |
| 75 <script src="../js/resources/js-test-pre.js"></script> | |
| 76 <script> | |
| 77 setUpTest(); | |
| 78 </script> | |
| 79 <script src="../js/resources/js-test-post.js"></script> | |
| 80 </body> | |
| 81 </html> | |
| OLD | NEW |