summaryrefslogtreecommitdiffstats
path: root/docshell/test/browser/browser_bug673467.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /docshell/test/browser/browser_bug673467.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'docshell/test/browser/browser_bug673467.js')
-rw-r--r--docshell/test/browser/browser_bug673467.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/docshell/test/browser/browser_bug673467.js b/docshell/test/browser/browser_bug673467.js
new file mode 100644
index 000000000..10139a48c
--- /dev/null
+++ b/docshell/test/browser/browser_bug673467.js
@@ -0,0 +1,51 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// 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,<html><body onload='load()'>" +
+ "<script>" +
+ " var iframe = document.createElement('iframe');" +
+ " iframe.id = 'iframe';" +
+ " document.documentElement.appendChild(iframe);" +
+ " function load() {" +
+ " iframe.src = 'data:text/html,Hello!';" +
+ " }" +
+ "</script>" +
+ "</body></html>"
+
+function test() {
+ waitForExplicitFinish();
+
+ let tab = gBrowser.addTab(doc);
+ let tabBrowser = tab.linkedBrowser;
+
+ BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
+ return ContentTask.spawn(tab.linkedBrowser, null, () => {
+ return new Promise(resolve => {
+ // The main page has loaded. Now wait for the iframe to load.
+ let iframe = content.document.getElementById('iframe');
+ iframe.addEventListener('load', function listener(aEvent) {
+
+ // Wait for the iframe to load the new document, not about:blank.
+ if (!iframe.src)
+ return;
+
+ iframe.removeEventListener('load', listener, true);
+ let shistory = content
+ .QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .sessionHistory;
+
+ Assert.equal(shistory.count, 1, "shistory count should be 1.");
+ resolve();
+ }, true);
+ });
+ });
+ }).then(() => {
+ gBrowser.removeTab(tab);
+ finish();
+ });
+}