michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Test for bug 673467. In a new tab, load a page which inserts a new iframe michael@0: // before the load and then sets its location during the load. This should michael@0: // create just one SHEntry. michael@0: michael@0: var doc = "data:text/html," + michael@0: "" + michael@0: "" michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let tab = gBrowser.addTab(doc); michael@0: let tabBrowser = tab.linkedBrowser; michael@0: michael@0: tabBrowser.addEventListener('load', function(aEvent) { michael@0: tabBrowser.removeEventListener('load', arguments.callee, true); michael@0: michael@0: // The main page has loaded. Now wait for the iframe to load. michael@0: let iframe = tabBrowser.contentWindow.document.getElementById('iframe'); michael@0: iframe.addEventListener('load', function(aEvent) { michael@0: michael@0: // Wait for the iframe to load the new document, not about:blank. michael@0: if (!iframe.src) michael@0: return; michael@0: michael@0: iframe.removeEventListener('load', arguments.callee, true); michael@0: let shistory = tabBrowser.contentWindow michael@0: .QueryInterface(Ci.nsIInterfaceRequestor) michael@0: .getInterface(Ci.nsIWebNavigation) michael@0: .sessionHistory; michael@0: michael@0: is(shistory.count, 1, 'shistory count should be 1.'); michael@0: michael@0: gBrowser.removeTab(tab); michael@0: finish(); michael@0: michael@0: }, true); michael@0: }, true); michael@0: }