Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <div id = "div" style="overflow: auto; width: 1400px"> | |
| 5 <table style="height:2000px; width: 1800px"> | |
| 6 <tbody> | |
| 7 <tr style="height: 2000px"> | |
| 8 <td style="width: 600px; height: 2000px">first</td> | |
| 9 <td style="width: 1200px; height: 2000px"> | |
| 10 <iframe style="width: 1000px; height: 2000px" src="resources/middleClick Autoscroll-iframe.html"></iframe> | |
| 11 </td> | |
| 12 </tr> | |
| 13 </tbody> | |
| 14 </table> | |
| 15 </div> | |
| 16 <script> | |
| 17 var testBubble = async_test("Tests that middleClickAutoscroll finds the correct ancestor layoutobject when starting in an unscrollable direction.") | |
| 18 testBubble.step(function() { | |
| 19 if (!window.eventSender) | |
| 20 return; | |
| 21 var startx = 100; | |
|
bokan
2016/11/09 15:34:10
It's hard to tell where you're clicking from the r
| |
| 22 var starty = 100; | |
| 23 var endx = 100; | |
| 24 var endy = 200; | |
| 25 eventSender.mouseMoveTo(startx, starty); | |
| 26 eventSender.mouseDown(1); | |
| 27 eventSender.mouseUp(1); | |
| 28 eventSender.mouseMoveTo(endx, endy) | |
|
bokan
2016/11/09 15:34:10
I would also add a followup horizontal scroll to t
| |
| 29 | |
| 30 | |
| 31 var animationFrameCount = 0; | |
| 32 var animation = function () { | |
| 33 animationFrameCount++; | |
| 34 if (animationFrameCount == 30) { | |
| 35 eventSender.mouseDown(1); | |
| 36 eventSender.mouseUp(1); | |
| 37 assert_not_equals(window.scrollY, 0); | |
| 38 testIFrame(); | |
| 39 testBubble.done(); | |
| 40 } | |
| 41 else { | |
| 42 window.requestAnimationFrame(animation); | |
| 43 } | |
| 44 }; | |
| 45 window.requestAnimationFrame(animation); | |
| 46 }); | |
| 47 | |
| 48 function testIFrame() { | |
| 49 | |
| 50 var testIFrame = async_test("Tests that middleClickAutoscroll finds the correct ancestor layoutobject when starting in an iframe, and the latching is correctly implemented.") | |
| 51 testIFrame.step(function() { | |
| 52 if (!window.eventSender) | |
| 53 return; | |
| 54 var startx = 650; | |
| 55 var starty = 500; | |
| 56 var endx = 750; | |
| 57 var endy = 500; | |
| 58 eventSender.mouseMoveTo(startx, starty); | |
| 59 eventSender.mouseDown(1); | |
| 60 eventSender.mouseUp(1); | |
| 61 eventSender.mouseMoveTo(endx, endy) | |
| 62 | |
| 63 | |
| 64 var animationFrameCount = 0; | |
| 65 var animation = function () { | |
| 66 animationFrameCount++; | |
| 67 var div = document.getElementById("div"); | |
| 68 if (animationFrameCount == 30) { | |
| 69 eventSender.mouseDown(1); | |
| 70 eventSender.mouseUp(1); | |
|
bokan
2016/11/09 15:34:10
Is this Down/Up needed?
| |
| 71 assert_not_equals(div.scrollLeft, 0); | |
| 72 assert_equals(window.scrollX, 0); | |
| 73 testIFrame.done(); | |
| 74 } else { | |
| 75 window.requestAnimationFrame(animation); | |
| 76 } | |
| 77 }; | |
| 78 window.requestAnimationFrame(animation); | |
| 79 }); | |
| 80 } | |
| 81 </script> | |
| OLD | NEW |