test_bug1186774.html (1223B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1186774 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1186774</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script type="application/javascript"> 12 13 /** Test for Bug 1186774 */ 14 15 var child; 16 17 function runTest() { 18 child = window.open("file_bug1186774.html", "", "width=100,height=100"); 19 child.onload = function() { 20 setTimeout(function() { 21 child.scrollTo(0, 0); 22 child.history.pushState({}, "initial"); 23 child.scrollTo(0, 3000); 24 child.history.pushState({}, "scrolled"); 25 child.scrollTo(0, 6000); 26 child.history.back(); 27 }); 28 }; 29 30 child.onpopstate = function() { 31 is(Math.round(child.scrollY), 6000, "Shouldn't have scrolled before popstate"); 32 child.close(); 33 SimpleTest.finish(); 34 }; 35 } 36 37 SimpleTest.waitForExplicitFinish(); 38 addLoadEvent(runTest); 39 40 </script> 41 </head> 42 <body> 43 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1186774">Mozilla Bug 1186774</a> 44 <p id="display"></p> 45 <div id="content" style="display: none"> 46 47 </div> 48 <pre id="test"> 49 </pre> 50 </body> 51 </html>