dom/tests/mochitest/bugs/test_bug684544.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=
     5 -->
     6 <head>
     7   <title>Test for Bug </title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug  **/
    22 var f = document.createElement("iframe");
    23 document.body.appendChild(f);
    24 var win = f.contentWindow;
    26 // Set location once to make sure it's resolved
    27 win.location = "data:text/html,1";
    29 // Now try to make the location object go away.
    30 f.parentNode.removeChild(f);
    32 // Check that location is now null.  If it's not, the test needs changing
    33 // (e.g. to use window.close() so that it's null).
    34 is("location" in win, true, "Should still have a location property");
    35 is(win.location, null, "There should be no location object now");
    37 // Just set the location.  This should not crash but throw an exception.
    38 var noException;
    39 try {
    40   win.location = "data:text/html,2";
    41   noException = true;
    42 }
    43 catch(e) {
    44   noException = false;
    45 }
    46 todo(noException, "Shouldn't throw when setting location.");
    48 // And check that we didn't override the slot in the process.
    49 is(typeof(win.location), "object", "Location should not have become a string");
    50 is(win.location, null,
    51    "There should be no location object for real after the set");
    53 </script>
    54 </pre>
    55 </body>
    56 </html>

mercurial