OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 body { |
| 4 height: 10000px; |
| 5 width: 10000px; |
| 6 } |
| 7 </style> |
| 8 |
| 9 <body></body> |
| 10 |
| 11 <script src="../../../resources/testharness.js"></script> |
| 12 <script src="../../../resources/testharnessreport.js"></script> |
| 13 <script type="text/javascript"> |
| 14 'use strict'; |
| 15 async_test(function(t) { |
| 16 window.addEventListener('load', t.step_func(function() { |
| 17 document.body.offsetTop; // force layout |
| 18 if (window.name != 'verification') { |
| 19 assert_array_equals([window.innerWidth, window.innerHeight], [800, 600],
'initial page size is valid'); |
| 20 if (window.internals) |
| 21 window.internals.setPageScaleFactor(2); |
| 22 assert_array_equals([window.innerWidth, window.innerHeight], [400, 300],
'page is scaled'); |
| 23 |
| 24 history.scrollRestoration = 'manual'; |
| 25 window.scrollTo(100, 200); |
| 26 assert_equals(history.scrollRestoration, 'manual'); |
| 27 assert_array_equals([window.scrollX, window.scrollY], [100, 200]); |
| 28 |
| 29 setTimeout(function() { |
| 30 window.name = 'verification'; |
| 31 window.location = "data:text/html,<script>history.back();</scr" + "ipt
>"; |
| 32 }, 0); |
| 33 } else { |
| 34 assert_array_equals([window.innerWidth, window.innerHeight], [400, 300],
'page scale is restored'); |
| 35 assert_array_equals([window.scrollX, window.scrollY], [0, 0], 'scroll po
sition is not restored'); |
| 36 // clean up |
| 37 window.name = ''; |
| 38 if (window.internals) |
| 39 setTimeout(function() {window.internals.setPageScaleFactor(1);}, 0); |
| 40 t.done(); |
| 41 } |
| 42 })); |
| 43 }, 'Setting scrollRestoration to manual should not affect scale restoration'); |
| 44 </script> |
OLD | NEW |