dom/xbl/test/test_bug310107.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=310107
     5 -->
     6 <head>
     7   <title>Test for Bug 310107</title>
     8   <script type="text/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=310107">Mozilla Bug 310107</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    19 /** Test for Bug 310107 **/
    20 SimpleTest.waitForExplicitFinish();
    22 var win = window.open("bug310107-resource.xhtml", "", "width=10, height=10");
    24 function runTest() {
    25   window.el = win.document.getElementById("bar");
    26   window.doc = win.document;
    27   is(window.el.prop, 2, "Unexpected prop value at load");
    29   win.location = "data:text/html,<body onload='window.opener.loadDone()'>";
    30 }
    32 function loadDone() {
    33   is(window.el.prop, 2, "Prop still 2 because we're in bfcache");
    34   is(window.el, window.doc.getElementById("bar"),
    35      "document didn't get bfcached?");
    37   // Remove our node from the DOM
    38   window.el.parentNode.removeChild(window.el);
    40   is(window.el.prop, undefined, "Binding should have been detached");
    41   is(typeof(window.el.prop), "undefined", "Really undefined");
    43   win.close();
    45   SimpleTest.finish();
    46 }
    49 </script>
    50 </pre>
    51 </body>
    52 </html>

mercurial