1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 // Test for bug 673467. In a new tab, load a page which inserts a new iframe
5 // before the load and then sets its location during the load. This should
6 // create just one SHEntry.
9 "data:text/html,<html><body onload='load()'>" +
11 " var iframe = document.createElement('iframe');" +
12 " iframe.id = 'iframe';" +
13 " document.documentElement.appendChild(iframe);" +
14 " function load() {" +
15 " iframe.src = 'data:text/html,Hello!';" +
21 waitForExplicitFinish();
25 let tab = BrowserTestUtils.addTab(gBrowser, doc, {}, tab => {
26 taskFinished = ContentTask.spawn(tab.linkedBrowser, null, () => {
27 return new Promise(resolve => {
31 // The main page has loaded. Now wait for the iframe to load.
32 let iframe = content.document.getElementById("iframe");
33 iframe.addEventListener(
35 function listener(aEvent) {
36 // Wait for the iframe to load the new document, not about:blank.
41 iframe.removeEventListener("load", listener, true);
42 let shistory = content.docShell.QueryInterface(
46 Assert.equal(shistory.count, 1, "shistory count should be 1.");
58 taskFinished.then(() => {
59 gBrowser.removeTab(tab);