summaryrefslogtreecommitdiffstats
path: root/browser/components/sessionstore/test/browser_707862.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 /browser/components/sessionstore/test/browser_707862.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 'browser/components/sessionstore/test/browser_707862.js')
-rw-r--r--browser/components/sessionstore/test/browser_707862.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/browser/components/sessionstore/test/browser_707862.js b/browser/components/sessionstore/test/browser_707862.js
new file mode 100644
index 000000000..e12c44af4
--- /dev/null
+++ b/browser/components/sessionstore/test/browser_707862.js
@@ -0,0 +1,61 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+var tabState = {
+ entries: [{url: "about:robots", children: [{url: "about:mozilla"}]}]
+};
+
+function test() {
+ waitForExplicitFinish();
+ requestLongerTimeout(2);
+
+ Services.prefs.setIntPref("browser.sessionstore.interval", 4000);
+ registerCleanupFunction(function () {
+ Services.prefs.clearUserPref("browser.sessionstore.interval");
+ });
+
+ let tab = gBrowser.addTab("about:blank");
+
+ let browser = tab.linkedBrowser;
+
+ promiseTabState(tab, tabState).then(() => {
+ let sessionHistory = browser.sessionHistory;
+ let entry = sessionHistory.getEntryAtIndex(0, false);
+ entry.QueryInterface(Ci.nsISHContainer);
+
+ whenChildCount(entry, 1, function () {
+ whenChildCount(entry, 2, function () {
+ promiseBrowserLoaded(browser).then(() => {
+ let sessionHistory = browser.sessionHistory;
+ let entry = sessionHistory.getEntryAtIndex(0, false);
+
+ whenChildCount(entry, 0, function () {
+ // Make sure that we reset the state.
+ let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank" }] }]}]};
+ waitForBrowserState(blankState, finish);
+ });
+ });
+
+ // reload the browser to deprecate the subframes
+ browser.reload();
+ });
+
+ // create a dynamic subframe
+ let doc = browser.contentDocument;
+ let iframe = doc.createElement("iframe");
+ doc.body.appendChild(iframe);
+ iframe.setAttribute("src", "about:mozilla");
+ });
+ });
+
+ // This test relies on the test timing out in order to indicate failure so
+ // let's add a dummy pass.
+ ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
+}
+
+function whenChildCount(aEntry, aChildCount, aCallback) {
+ if (aEntry.childCount == aChildCount)
+ aCallback();
+ else
+ setTimeout(() => whenChildCount(aEntry, aChildCount, aCallback), 100);
+}