Bug 894150 - Test.
[gecko.git] / docshell / test / test_bug653741.html
blobf4d4587b8c1e0a97009d7230cfbe657fe22e5da4
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=653741
5 -->
6 <head>
7 <title>Test for Bug 653741</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=653741">Mozilla Bug 653741</a>
15 <script type="application/javascript;version=1.7">
17 /** Test for Bug 653741 **/
18 SimpleTest.waitForExplicitFinish();
20 function childLoad() {
21 // Spin the event loop so we leave the onload handler.
22 SimpleTest.executeSoon(childLoad2);
25 function childLoad2() {
26 let cw = $('iframe').contentWindow;
28 // Save the Y offset. For sanity's sake, make sure it's not 0, because we
29 // should be at the bottom of the page!
30 let origYOffset = cw.pageYOffset;
31 ok(origYOffset != 0, 'Original Y offset is not 0.');
33 // Scroll the iframe to the top, then navigate to #bottom again.
34 cw.scrollTo(0, 0);
36 // Our current location is #bottom, so this should scroll us down to the
37 // bottom again.
38 cw.location = cw.location + '';
40 is(cw.pageYOffset, origYOffset, 'Correct offset after reloading page.');
41 SimpleTest.finish();
44 </script>
46 <iframe height='100px' id='iframe' src='file_bug653741.html#bottom'></iframe>
48 </body>
49 </html>