Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 if (window.testRunner) { | 4 if (window.testRunner) { |
| 5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
| 6 testRunner.waitUntilDone(); | 6 testRunner.waitUntilDone(); |
| 7 } | 7 } |
| 8 | 8 |
| 9 function clickLink() { | 9 function clickLink() { |
| 10 var link = document.getElementById("anchorLink"); | 10 var link = document.getElementById("anchorLink"); |
| 11 eventSender.mouseMoveTo(link.offsetLeft + 2, link.offsetTop + 2); | 11 link.click(); |
| 12 eventSender.mouseDown(); | |
| 13 eventSender.mouseUp(); | |
|
esprehn
2016/05/26 05:40:09
why did you change this? ::click() is different th
| |
| 14 } | 12 } |
| 15 | 13 |
| 16 function run() { | 14 function run() { |
| 17 clickLink(); | 15 clickLink(); |
| 18 window.scroll(0, 0); | 16 window.scroll(0, 0); |
| 19 clickLink(); | 17 clickLink(); |
| 20 var scrollY = window.scrollY; | 18 var scrollY = window.scrollY; |
| 21 var line = document.createElement('div'); | 19 var line = document.createElement('div'); |
| 22 line.appendChild(document.createTextNode("Scroll position is " + scrollY + " px")); | 20 line.appendChild(document.createTextNode("Scroll position is " + scrollY + " px")); |
| 23 document.getElementById('anchor').appendChild(line); | 21 document.getElementById('anchor').appendChild(line); |
| 24 testRunner.notifyDone(); | 22 testRunner.notifyDone(); |
| 25 } | 23 } |
| 26 | 24 |
| 27 </script> | 25 </script> |
| 28 </head> | 26 </head> |
| 29 <body onload="run();"> | 27 <body onload="run();"> |
| 30 <div style="height: 600px"> | 28 <div style="height: 600px"> |
| 31 <a id="anchorLink" href="#anchor">Anchor link</a> | 29 <a id="anchorLink" href="#anchor">Anchor link</a> |
| 32 </div> | 30 </div> |
| 33 <div id="anchor" style="height: 600px"></div> | 31 <div id="anchor" style="height: 600px"></div> |
| 34 </body> | 32 </body> |
| 35 </html> | 33 </html> |
| OLD | NEW |