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/base/content/test/tabs/browser_tabSwitchPrintPreview.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/base/content/test/tabs/browser_tabSwitchPrintPreview.js')
-rw-r--r-- | browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js b/browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js new file mode 100644 index 000000000..4ec36a7cc --- /dev/null +++ b/browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js @@ -0,0 +1,29 @@ +const kURL1 = "data:text/html,Should I stay or should I go?"; +const kURL2 = "data:text/html,I shouldn't be here!"; + +add_task(function* setup() { + yield SpecialPowers.pushPrefEnv({ + set: [["dom.ipc.processCount", 1]] + }); +}); + +/** + * Verify that if we open a new tab and try to make it the selected tab while + * print preview is up, that doesn't happen. + */ +add_task(function* () { + yield BrowserTestUtils.withNewTab(kURL1, function* (browser) { + let tab = gBrowser.addTab(kURL2); + document.getElementById("cmd_printPreview").doCommand(); + gBrowser.selectedTab = tab; + yield BrowserTestUtils.waitForCondition(() => gInPrintPreviewMode, "should be in print preview mode"); + isnot(gBrowser.selectedTab, tab, "Selected tab should not be the tab we added"); + is(gBrowser.selectedTab, PrintPreviewListener._printPreviewTab, "Selected tab should be the print preview tab"); + gBrowser.selectedTab = tab; + isnot(gBrowser.selectedTab, tab, "Selected tab should still not be the tab we added"); + is(gBrowser.selectedTab, PrintPreviewListener._printPreviewTab, "Selected tab should still be the print preview tab"); + PrintUtils.exitPrintPreview(); + yield BrowserTestUtils.waitForCondition(() => !gInPrintPreviewMode, "should be in print preview mode"); + yield BrowserTestUtils.removeTab(tab); + }); +}); |