docshell/test/test_bug662170.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=662170
     5 -->
     6 <head>
     7   <title>Test for Bug 662170</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=662170">Mozilla Bug 662170</a>
    15 <script type="application/javascript;version=1.7">
    17 /** Test for Bug 662170 **/
    18 SimpleTest.waitForExplicitFinish();
    20 function childLoad() {
    21   // Spin the event loop so we leave the onload handler.
    22   SimpleTest.executeSoon(childLoad2);
    23 }
    25 function childLoad2() {
    26   let cw = $('iframe').contentWindow;
    28   // When we initially load the page, we should be at the top.
    29   is(cw.pageYOffset, 0, 'Initial Y offset should be 0.');
    31   // Scroll the iframe to the bottom.
    32   cw.scrollTo(0, 300);
    34   // Did we actually scroll somewhere?
    35   isnot(cw.pageYOffset, 0, 'Y offset should be non-zero after scrolling.');
    37   // Now load file_bug662170.html#, which should take us to the top of the
    38   // page.
    39   cw.location = cw.location + '#';
    41   is(cw.pageYOffset, 0, 'Correct Y offset after loading #.');
    42   SimpleTest.finish();
    43 }
    45 </script>
    47 <!-- When the iframe loads, it calls childLoad(). -->
    48 <iframe height='100px' id='iframe' src='file_bug662170.html'></iframe>
    50 </body>
    51 </html>

mercurial