editor/libeditor/html/tests/test_bug635636.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=635636
     5 -->
     6 <head>
     7   <title>Test for Bug 635636</title>
     8   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=635636">Mozilla Bug 635636</a>
    14 <p id="display"></p>
    15 <div id="content">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 635636 **/
    21 SimpleTest.waitForExplicitFinish();
    22 addLoadEvent(function() {
    23   var w, d;
    25   function b1()
    26   {
    27     w = window.open('data:application/xhtml+xml,<html xmlns="http://www.w3.org/1999/xhtml"><div>1</div></html>');
    28     SimpleTest.waitForFocus(b2, w);
    29   }
    31   function b2()
    32   {
    33     w.document.designMode = 'on';
    34     w.location = "data:text/plain,2";
    35     d = w.document.getElementsByTagName("div")[0];
    36     const Ci = Components.interfaces;
    37     var mainWindow = w.QueryInterface(Ci.nsIInterfaceRequestor)
    38                       .getInterface(Ci.nsIWebNavigation)
    39                       .QueryInterface(Ci.nsIDocShellTreeItem)
    40                       .rootTreeItem
    41                       .QueryInterface(Ci.nsIInterfaceRequestor)
    42                       .getInterface(Ci.nsIDOMWindow);
    43     var browser = mainWindow.gBrowser.selectedBrowser;
    44     browser.addEventListener("pageshow", function() {
    45       setTimeout(b3, 0);
    46     }, false);
    47   }
    49   function b3()
    50   {
    51     d.parentNode.removeChild(d);
    52     ok(true, "Should not crash");
    53     // Not needed for the crash
    54     w.close();
    55     SimpleTest.finish();
    56   }
    58   b1();
    59 });
    61 </script>
    62 </pre>
    63 </body>
    64 </html>

mercurial