// 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.
const HELLO_HTML = "data:text/html,Hello!";
var doc = `data:text/html,<html><body onload='load()'>
<script> var iframe = document.createElement('iframe');
iframe.id = 'iframe';
document.documentElement.appendChild(iframe); function load() {
iframe.src = '${HELLO_HTML}';
}
</script>
</body></html>`;
function test() {
waitForExplicitFinish();
let taskFinished;
let tab = BrowserTestUtils.addTab(gBrowser, doc, {}, tabEl => {
let browser = tabEl.linkedBrowser;
taskFinished = BrowserTestUtils.browserLoaded(
browser, true,
HELLO_HTML
).then(async () => {
await SpecialPowers.spawn(browser, [], function () {
let shistory = content.docShell.QueryInterface(
Ci.nsIWebNavigation
).sessionHistory; Assert.equal(shistory.count, 1, "shistory count should be 1.");
});
});
});
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 und die Messung sind noch experimentell.