dom/tests/mochitest/general/test_bug628069_1.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=628069
     5 -->
     6 <head>
     7   <title>Test for Bug 628069</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.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=628069">Mozilla Bug 628069</a>
    14 <p id="display"></p>
    15 <div id="content">
    16   <iframe id="frame" style="height:100px; width:100px; border:0"></iframe>
    17   <div id="status" style="display: none"></div>
    18 </div>
    19 <pre id="test">
    20 <script type="application/javascript;version=1.7">
    22 /** Test for Bug 628069 **/
    24 SimpleTest.waitForExplicitFinish();
    26 popup = window.open('file_bug628069.html');
    28 // Control flows into childLoad, once the popup loads.
    30 gOrigURL = null;
    31 function childLoad() {
    32   gOrigURL = popup.location + '';
    34   popup.location.hash = '#hash';
    36   // This should trigger a hashchange, so control should flow down to
    37   // childHashchange.
    38 }
    40 function childHashchange(e) {
    41   is(e.oldURL, gOrigURL, 'event.oldURL');
    42   is(e.newURL, gOrigURL + '#hash', 'event.newURL');
    43   is(e.isTrusted, true, 'Hashchange event should be trusted.');
    44   popup.close();
    45   SimpleTest.finish();
    46 }
    48 </script>
    49 </body>
    50 </html>

mercurial