diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/components/sessionstore/test/browser_480893.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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_480893.js')
-rw-r--r-- | browser/components/sessionstore/test/browser_480893.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/browser/components/sessionstore/test/browser_480893.js b/browser/components/sessionstore/test/browser_480893.js new file mode 100644 index 000000000..e3ddb39b7 --- /dev/null +++ b/browser/components/sessionstore/test/browser_480893.js @@ -0,0 +1,47 @@ +"use strict"; + +/** + * Tests that we get sent to the right page when the user clicks + * the "Close" button in about:sessionrestore + */ +add_task(function*() { + yield SpecialPowers.pushPrefEnv({ + "set": [ + ["browser.startup.page", 0], + ] + }); + + let tab = gBrowser.addTab("about:sessionrestore"); + gBrowser.selectedTab = tab; + let browser = tab.linkedBrowser; + yield BrowserTestUtils.browserLoaded(browser, false, "about:sessionrestore"); + + let doc = browser.contentDocument; + + // Click on the "Close" button after about:sessionrestore is loaded. + doc.getElementById("errorCancel").click(); + + yield BrowserTestUtils.browserLoaded(browser, false, "about:blank"); + + // Test that starting a new session loads the homepage (set to http://mochi.test:8888) + // if Firefox is configured to display a homepage at startup (browser.startup.page = 1) + let homepage = "http://mochi.test:8888/"; + yield SpecialPowers.pushPrefEnv({ + "set": [ + ["browser.startup.homepage", homepage], + ["browser.startup.page", 1], + ] + }); + + browser.loadURI("about:sessionrestore"); + yield BrowserTestUtils.browserLoaded(browser, false, "about:sessionrestore"); + doc = browser.contentDocument; + + // Click on the "Close" button after about:sessionrestore is loaded. + doc.getElementById("errorCancel").click(); + yield BrowserTestUtils.browserLoaded(browser); + + is(browser.currentURI.spec, homepage, "loaded page is the homepage"); + + yield BrowserTestUtils.removeTab(tab); +}); |