Files
palemoon27/browser/components/sessionstore/test/browser_aboutSessionRestore.js
T
roytam1 3c4a44c16e import changes from `devel' branch of rmottola/Arctic-Fox:
- Bug 1132874 - Improve protections against sending a parent plugin protocol shutdown message to the child after the child has torn down. r=aklotz (b80b45fa7)
- Bug 1103036 - Follow-up to initial patch; r=jchen (51337c2dc)
- Bug 1132874 - Simplify PPluginWidget protocol handling, and avoid sending async messages from the parent. Addresses a problem with sub protocols that are torn down randomly from either side of the connection. r=aklotz (3ad936e84)
- Bug 1128214 - Avoid a crash when attempting to render windows titlebar specific theme elements with e10s. r=roc (b6f17da09)
- Bug 1139368 - Set FilterTypeSet dependency in improveThisTypesForCall. r=h4writer (422de7271)
- Bug 864041 - Remove Firefox 2+3 compat code from about:sessionrestore. r=mak (4cfc6fe9a)
- Bug 1009599 - Restoring from about:sessionrestore fails when there is more than one tab in the window r=smacleod (88ca1cfbc)
- Bug 1146052 - Fix empty about:sessionrestore after crash as well as empty about:welcomeback after resetting the profile r=smacleod (211b50396)
- Bug 1043797: extended popup notifications to create a generic doorhanger for all security notifications incl. mixed content r=adw (f7c2d5ded)
- Bug 900845 - We aren't using the NetUtil module in SessionStore.jsm. (3f5ddd133)
- Bug 898755 - Remove _resume_session_once_on_shutdown code from SessionStore; r=yoric (eb159fec9)
- Bug 902727 - [Session Restore] Remove legacy _writeFileEncoder; r=smacleod (8e375c529)
- space cleanup (cbd71ce91)
- Bug 968923 - part 1 - add infrastructure for defining use counters from UseCounters.conf; original-author=heycam; r=heycam,gfritzsche,mshal (d0dea9997)
- Bug 968923 - part 2 - change MappedAttrParser to store a nsSVGElement directly, instead of its nsIPrincipal; r=smaug (4eff86d7f)
- Merge branch 'devel' of https://github.com/rmottola/Arctic-Fox into devel (feb4378e6)
2020-01-17 09:03:54 +08:00

47 lines
1.5 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const CRASH_SHENTRY = {url: "about:mozilla"};
const CRASH_TAB = {entries: [CRASH_SHENTRY]};
const CRASH_STATE = {windows: [{tabs: [CRASH_TAB]}]};
const TAB_FORMDATA = {id: {sessionData: CRASH_STATE}};
const TAB_SHENTRY = {url: "about:sessionrestore", formdata: TAB_FORMDATA};
const TAB_STATE = {entries: [TAB_SHENTRY]};
const FRAME_SCRIPT = "data:," +
"content.document.getElementById('errorTryAgain').click()";
add_task(function* () {
// Prepare a blank tab.
let tab = gBrowser.addTab("about:blank");
let browser = tab.linkedBrowser;
yield promiseBrowserLoaded(browser);
// Fake a post-crash tab.
ss.setTabState(tab, JSON.stringify(TAB_STATE));
yield promiseTabRestored(tab);
ok(gBrowser.tabs.length > 1, "we have more than one tab");
browser.messageManager.loadFrameScript(FRAME_SCRIPT, true);
// Wait until the new window was restored.
let win = yield waitForNewWindow();
yield promiseWindowClosed(win);
let [{tabs: [{entries: [{url}]}]}] = JSON.parse(ss.getClosedWindowData());
is(url, "about:mozilla", "session was restored correctly");
ss.forgetClosedWindow(0);
});
function waitForNewWindow() {
return new Promise(resolve => {
Services.obs.addObserver(function observe(win, topic) {
Services.obs.removeObserver(observe, topic);
resolve(win);
}, "browser-delayed-startup-finished", false);
});
}