Bug 1303479 - Remove <xul:notification>s right away in browser_UnsubmittedCrashHandler.js to avoid intermittent. r=florian, a=test-only
authorMike Conley <mconley@mozilla.com>
Wed, 21 Sep 2016 13:37:29 -0400
changeset 355699 04669583b577b8c2033fd3d9dab3b22ed846e8b8
parent 355698 66951f9c2c5320ca5af414c38fb4385b1cffc250
child 355700 ef567dcc1de7f603ea78c2463d9d77897b6797da
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, test-only
bugs1303479
milestone51.0a2
Bug 1303479 - Remove <xul:notification>s right away in browser_UnsubmittedCrashHandler.js to avoid intermittent. r=florian, a=test-only MozReview-Commit-ID: DHObiW2K0WL
browser/modules/test/browser_UnsubmittedCrashHandler.js
--- a/browser/modules/test/browser_UnsubmittedCrashHandler.js
+++ b/browser/modules/test/browser_UnsubmittedCrashHandler.js
@@ -410,16 +410,19 @@ add_task(function* test_can_ignore() {
   let notification =
     yield UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
   Assert.ok(notification, "There should be a notification");
 
   // Dismiss the notification by clicking on the "X" button.
   let anonyNodes = document.getAnonymousNodes(notification)[0];
   let closeButton = anonyNodes.querySelector(".close-icon");
   closeButton.click();
+  // We'll not wait for the notification to finish its transition -
+  // we'll just remove it right away.
+  gNotificationBox.removeNotification(notification, true);
   yield waitForIgnoredReports(reportIDs);
 
   notification =
     yield UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
   Assert.equal(notification, null, "There should be no notification");
 
   clearPendingCrashReports();
 });
@@ -481,27 +484,30 @@ add_task(function* test_shutdown_while_n
   let notification =
     yield UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
   Assert.ok(notification, "There should be a notification");
 
   // Dismiss the notification by clicking on the "X" button.
   let anonyNodes = document.getAnonymousNodes(notification)[0];
   let closeButton = anonyNodes.querySelector(".close-icon");
   closeButton.click();
+  // We'll not wait for the notification to finish its transition -
+  // we'll just remove it right away.
+  gNotificationBox.removeNotification(notification, true);
+
   yield waitForIgnoredReports(reportIDs);
 
   UnsubmittedCrashHandler.uninit();
   Assert.throws(() => {
     let shutdownWhileShowing =
       UnsubmittedCrashHandler.prefs.getBoolPref("shutdownWhileShowing");
   }, "We should have noticed that the notification had closed before " +
      "uninitting.");
   UnsubmittedCrashHandler.init();
 
-  gNotificationBox.removeNotification(notification, true);
   clearPendingCrashReports();
 });
 
 /**
  * Tests that if
  * browser.crashReports.unsubmittedCheck.shutdownWhileShowing is
  * set and the lastShownDate is today, then we don't decrement
  * browser.crashReports.unsubmittedCheck.chancesUntilSuppress.