| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <a href="./same-page-navigate.html" id="same-page" style="position: absolute; to
p: 2000px">link to self</a> |
| 4 |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 |
| 8 <script> |
| 9 |
| 10 // Ensure that the scroll position is correct when we navigate to same page afte
r scale(zoom-in/zoom-out) |
| 11 // crbug.com/642279 |
| 12 test(function() { |
| 13 |
| 14 if(testRunner) { |
| 15 testRunner.waitUntilDone(); |
| 16 } |
| 17 |
| 18 // exit in second load, using scale to detect |
| 19 if (internals.pageScaleFactor() == 2) { |
| 20 assert_equals(scrollX, 0); |
| 21 assert_equals(scrollY, 0); |
| 22 |
| 23 if(testRunner) { |
| 24 testRunner.notifyDone(); |
| 25 } |
| 26 return; |
| 27 } |
| 28 |
| 29 window.internals.setPageScaleFactor(2); |
| 30 scrollTo(0, 10000); |
| 31 |
| 32 var atag = document.getElementById('same-page'); |
| 33 |
| 34 var x = (atag.offsetLeft - scrollX + 1) * 2; |
| 35 var y = (atag.offsetTop - scrollY + 1) * 2; |
| 36 |
| 37 // this clicks on the link which causes a reload of this page. |
| 38 eventSender.mouseMoveTo(x, y); |
| 39 eventSender.mouseDown(); |
| 40 eventSender.mouseUp(); |
| 41 }, 'Ensure that the scroll position is correct when we navigate to same page aft
er scale(zoom-in/zoom-out)'); |
| 42 |
| 43 </script> |
| OLD | NEW |