-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1306266 - test for print preview using the right tab, r=mconley
MozReview-Commit-ID: LLFmpPWwc5d UltraBlame original commit: 38485e7430ba0a2107ddbb617e027ac00a688813
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[browser_tabSpinnerProbe.js] | ||
skip-if = !e10s # Tab spinner is e10s only. | ||
[browser_tabSwitchPrintPreview.js] | ||
skip-if = os == 'mac' |
23 changes: 23 additions & 0 deletions
23
browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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* () { | ||
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); | ||
}); | ||
}); |