4 https://bugzilla.mozilla.org/show_bug.cgi?id=509055
7 <title>Test for Bug
509055</title>
8 <script type=
"application/javascript" src=
"/MochiKit/packed.js"></script>
9 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <script type=
"application/javascript" src=
"/tests/SimpleTest/EventUtils.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=509055">Mozilla Bug
509055</a>
16 <div id=
"status"></div>
20 <script type=
"application/javascript;version=1.7">
22 /** Test for Bug
509055 **/
24 SimpleTest.waitForExplicitFinish();
28 function shortWait() {
29 setTimeout(function() { gGen.next(); },
0, false);
32 function onChildLoad(e) {
38 netscape.security.PrivilegeManager.enablePrivilege(
"UniversalXPConnect");
40 var popup = window.open(
"file_bug509055.html",
"popup 0",
41 "height=200,width=200,location=yes," +
42 "menubar=yes,status=yes,toolbar=yes,dependent=yes");
43 popup.onload = onChildLoad;
44 yield; // wait for load
46 // Not sure why this wait is necessary, but without it, the change to
47 // location.hash below doesn't create a SHEntry or enable the back button.
51 // Both setting location.hash and calling history.back() happen
52 // synchronously, so there's no need to yield here.
53 popup.location.hash =
"#1";
56 popup.document.title =
"Changed";
58 // Wait for listeners to be notified of the title change.
62 var sh = popup.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
63 .getInterface(Components.interfaces.nsIWebNavigation)
66 // Get the title of the inner popup's current SHEntry
67 var sheTitle = sh.getEntryAtIndex(sh.index, false).title;
68 is(sheTitle,
"Changed",
"SHEntry's title should change when we change.");
76 window.addEventListener('load', function() {