Bug 1101973 - fix browser_printpreview.js to work in e10s mode, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 26 Feb 2016 16:34:40 +0000
changeset 285786 1ee2382828fb99eec75ba40d6521f60ea9ed56a1
parent 285785 7ac5c16b31f48e5449e346e93dd8dcd217634f14
child 285787 231428749f764ea5779cf7addb2f74de75bcaa2f
push id30035
push usercbook@mozilla.com
push dateMon, 29 Feb 2016 10:16:00 +0000
treeherdermozilla-central@4972f77869de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1101973
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1101973 - fix browser_printpreview.js to work in e10s mode, r=mconley MozReview-Commit-ID: HG5yGatBdj2
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_printpreview.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -362,17 +362,17 @@ support-files =
   permissions.html
 [browser_pinnedTabs.js]
 [browser_plainTextLinks.js]
 [browser_popupUI.js]
 skip-if = buildapp == 'mulet'
 [browser_popup_blocker.js]
 skip-if = (os == 'linux') || (e10s && debug) # Frequent bug 1081925 and bug 1125520 failures
 [browser_printpreview.js]
-skip-if = buildapp == 'mulet' || e10s # Bug 1101973 - breaks the next test in e10s, and may be responsible for later timeout after logging "Error: Channel closing: too late to send/recv, messages will be lost"
+skip-if = buildapp == 'mulet'
 [browser_private_browsing_window.js]
 skip-if = buildapp == 'mulet'
 [browser_private_no_prompt.js]
 skip-if = buildapp == 'mulet'
 [browser_purgehistory_clears_sh.js]
 [browser_PageMetaData_pushstate.js]
 [browser_refreshBlocker.js]
 support-files =
--- a/browser/base/content/test/general/browser_printpreview.js
+++ b/browser/base/content/test/general/browser_printpreview.js
@@ -1,19 +1,28 @@
+let ourTab;
+
 function test() {
   waitForExplicitFinish();
 
-  ok(!gInPrintPreviewMode,
-     "Should NOT be in print preview mode at starting this tests");
-  // Skip access key test on platforms which don't support access key.
-  if (!/Win|Linux/.test(navigator.platform)) {
-    openPrintPreview(testClosePrintPreviewWithEscKey);
-  } else {
-    openPrintPreview(testClosePrintPreviewWithAccessKey);
-  }
+  BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home", true).then(function(tab) {
+    ourTab = tab;
+    ok(!gInPrintPreviewMode,
+       "Should NOT be in print preview mode at starting this tests");
+    // Skip access key test on platforms which don't support access key.
+    if (!/Win|Linux/.test(navigator.platform)) {
+      openPrintPreview(testClosePrintPreviewWithEscKey);
+    } else {
+      openPrintPreview(testClosePrintPreviewWithAccessKey);
+    }
+  });
+}
+
+function tidyUp() {
+  BrowserTestUtils.removeTab(ourTab).then(finish);
 }
 
 function testClosePrintPreviewWithAccessKey() {
   EventUtils.synthesizeKey("c", { altKey: true });
   checkPrintPreviewClosed(function (aSucceeded) {
     ok(aSucceeded,
        "print preview mode should be finished by access key");
     openPrintPreview(testClosePrintPreviewWithEscKey);
@@ -29,17 +38,17 @@ function testClosePrintPreviewWithEscKey
   });
 }
 
 function testClosePrintPreviewWithClosingWindowShortcutKey() {
   EventUtils.synthesizeKey("w", { accelKey: true });
   checkPrintPreviewClosed(function (aSucceeded) {
     ok(aSucceeded,
        "print preview mode should be finished by closing window shortcut key");
-    finish();
+    tidyUp();
   });
 }
 
 function openPrintPreview(aCallback) {
   document.getElementById("cmd_printPreview").doCommand();
   executeSoon(function () {
     if (gInPrintPreviewMode) {
       executeSoon(aCallback);