// Test for bug 673467. In a new tab, load a page which inserts a new iframe // before the load and then sets its location during the load. This should // create just one SHEntry.
var doc = "data:text/html," + "" + "";
function test() {
waitForExplicitFinish();
let taskFinished;
let tab = BrowserTestUtils.addTab(gBrowser, doc, {}, tab => {
taskFinished = ContentTask.spawn(tab.linkedBrowser, null, () => { returnnew Promise(resolve => {
addEventListener( "load", function () { // The main page has loaded. Now wait for the iframe to load.
let iframe = content.document.getElementById("iframe");
iframe.addEventListener( "load", function listener() { // Wait for the iframe to load the new document, not about:blank. if (!iframe.src) { return;
}
iframe.removeEventListener("load", listener, true);
let shistory = content.docShell.QueryInterface(
Ci.nsIWebNavigation
).sessionHistory;
Assert.equal(shistory.count, 1, "shistory count should be 1.");
resolve();
}, true
);
}, true
);
});
});
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.