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.

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

mercurial