Bug 1377868 - .dmp.ignore files should not cause other crash reports to be ignored. r=felipe
authorPerry Jiang <jiangperry@gmail.com>
Mon, 03 Jul 2017 14:48:40 -0700
changeset 367195 2475913ce86b273aa55fcc9dddb457098616d829
parent 367194 1f47b5163a3688507153fb7e147a3db4982b9559
child 367196 f5564d2bbc096bb5bc6c7a0e2fba2852c5e81739
push id32125
push usercbook@mozilla.com
push dateTue, 04 Jul 2017 08:48:50 +0000
treeherdermozilla-central@fef489e8c2a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1377868
milestone56.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 1377868 - .dmp.ignore files should not cause other crash reports to be ignored. r=felipe MozReview-Commit-ID: Lvebn8uLoYd
browser/modules/test/browser/browser_UnsubmittedCrashHandler.js
toolkit/crashreporter/CrashSubmit.jsm
--- a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js
+++ b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js
@@ -244,16 +244,46 @@ add_task(async function test_one_pending
     await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
   Assert.ok(notification, "There should be a notification");
 
   gNotificationBox.removeNotification(notification, true);
   clearPendingCrashReports();
 });
 
 /**
+ * Tests that an ignored crash report does not suppress a notification that
+ * would be trigged by another, unignored crash report.
+ */
+add_task(async function test_other_ignored() {
+  let toIgnore = await createPendingCrashReports(1);
+  let notification =
+    await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
+  Assert.ok(notification, "There should be a notification");
+
+  // Dismiss notification, creating the .dmp.ignore file
+  let anonyNodes = document.getAnonymousNodes(notification)[0];
+  let closeButton = anonyNodes.querySelector(".close-icon");
+  closeButton.click();
+  gNotificationBox.removeNotification(notification, true);
+  await waitForIgnoredReports(toIgnore);
+
+  notification =
+    await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
+  Assert.ok(!notification, "There should not be a notification");
+
+  await createPendingCrashReports(1);
+  notification =
+    await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
+  Assert.ok(notification, "There should be a notification");
+
+  gNotificationBox.removeNotification(notification, true);
+  clearPendingCrashReports();
+});
+
+/**
  * Tests that there is a notification if there is more than one
  * pending crash report.
  */
 add_task(async function test_several_pending() {
   await createPendingCrashReports(3);
   let notification =
     await UnsubmittedCrashHandler.checkForUnsubmittedCrashReports();
   Assert.ok(notification, "There should be a notification");
--- a/toolkit/crashreporter/CrashSubmit.jsm
+++ b/toolkit/crashreporter/CrashSubmit.jsm
@@ -514,30 +514,30 @@ this.CrashSubmit = {
             if (UUID_REGEX.test(id)) {
               entries[id] = OS.File.stat(entry.path);
             }
           } else {
             // maybe it's a .ignore file
             let matchesIgnore = entry.name.match(/(.+)\.dmp.ignore$/);
 
             if (matchesIgnore) {
-              let id = matches[1];
+              let id = matchesIgnore[1];
 
               if (UUID_REGEX.test(id)) {
                 ignored[id] = true;
               }
             }
           }
         }
       });
 
       for (let entry in entries) {
         let entryInfo = await entries[entry];
 
-        if (!(`${entry}.dmp.ignore` in ignored) &&
+        if (!(entry in ignored) &&
             entryInfo.lastAccessDate > minFileDate) {
           ids.push(entry);
         }
       }
     } catch (ex) {
       Cu.reportError(ex);
       throw ex;
     } finally {