Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 | |
| 3 <style> | |
| 4 body { | |
| 5 height: 800px; | |
|
bokan
2016/09/15 15:03:47
No need for this style, these are the defaults.
| |
| 6 width: 600px; | |
| 7 } | |
| 8 </style> | |
| 9 | |
| 10 <a href="./same-page-navigate.html" id="same-page" style="position: absolute; to p: 2000px">link to self</a> | |
| 11 | |
| 12 <script src="../../resources/testharness.js"></script> | |
| 13 <script src="../../resources/testharnessreport.js"></script> | |
| 14 | |
| 15 <script> | |
| 16 | |
| 17 // Ensure that the scroll position is correct when we navigate to same page afte r scale(zoom-in/zoom-out) | |
| 18 // crbug.com/642279 | |
| 19 test(function() { | |
| 20 | |
| 21 testRunner.waitUntilDone(); | |
|
bokan
2016/09/15 15:03:47
Wrap this and notifyDone in `if(testRunner) ...`
| |
| 22 | |
| 23 // exit in second load, using innerWidth to detect scale | |
| 24 if (innerWidth < 800) { | |
|
bokan
2016/09/15 15:03:47
Lets be more explicit, use internals.pageScaleFact
| |
| 25 console.log("scrollX=" + scrollX); | |
| 26 console.log("scrollY=" + scrollY); | |
|
bokan
2016/09/15 15:03:47
Remove console messages, use asserts instead.
| |
| 27 testRunner.notifyDone(); | |
| 28 return; | |
| 29 } | |
| 30 | |
| 31 window.internals.setPageScaleFactor(2); | |
| 32 scrollTo(0, 10000); | |
| 33 | |
| 34 var atag = document.getElementById('same-page'); | |
| 35 | |
| 36 var x = (atag.offsetLeft - scrollX + 1) * 2; | |
| 37 var y = (atag.offsetTop - scrollY + 1) * 2; | |
| 38 eventSender.mouseMoveTo(x, y); | |
|
bokan
2016/09/15 15:03:47
Add a comment here that this clicks on the link wh
| |
| 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 |