content/base/test/test_bug592366.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=592366
     5 -->
     6 <head>
     7   <title>Test for Bug 592366</title>
     8   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.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=592366">Mozilla Bug 592366</a>
    14 <p id="display"></p>
    15 <div id="content" style="display: none">
    16 <iframe></iframe>
    17 <iframe></iframe>
    18 </div>
    19 <pre id="test">
    20 <script class="testbody" type="text/javascript">
    22 /** Test for Bug 592366 **/
    24 var gExecuted = false;
    26 function hitEventLoop(times, next)
    27 {
    28   if (times == 0) {
    29     next();
    30     return;
    31   }
    33   SimpleTest.executeSoon(function() {
    34     hitEventLoop(times - 1, next);
    35   });
    36 }
    38 SimpleTest.waitForExplicitFinish();
    39 addLoadEvent(function() {
    40   var s = document.createElement("script");
    41   s.src = "data:text/javascript,parent.gExecuted=true;";
    43   var iframes = document.getElementsByTagName("iframe");
    45   iframes[0].contentDocument.body.appendChild(s);
    46   iframes[1].contentDocument.body.appendChild(s);
    48   // It seems to work with 1 event loop hit locally but using 2 given that it
    49   // was hsivonen advice.
    50   hitEventLoop(2, function() {
    51     ok(!gExecuted, "The scripts should not have been executed");
    52     SimpleTest.finish();
    53   });
    54 });
    56 </script>
    57 </pre>
    58 </body>
    59 </html>

mercurial