Bug 1442559 part 3 - Detect whitelist item which doesn't have any condition. r=Gijs
☠☠ backed out by 53f082b32ba9 ☠ ☠
authorXidorn Quan <me@upsuper.org>
Sat, 03 Mar 2018 11:56:55 +1100
changeset 406518 d540c55c96c5e4fdab1434032628fa876152b8e1
parent 406517 6371120b7c1cd2701152c86a5840257e9df5b9fb
child 406519 53f082b32ba9eb0b9febdc97373c89b9ac500bd3
push id60574
push userxquan@mozilla.com
push dateSun, 04 Mar 2018 22:56:08 +0000
treeherderautoland@d540c55c96c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1442559
milestone60.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 1442559 part 3 - Detect whitelist item which doesn't have any condition. r=Gijs MozReview-Commit-ID: GavZUKl9y1r
browser/base/content/test/static/browser_parsable_css.js
--- a/browser/base/content/test/static/browser_parsable_css.js
+++ b/browser/base/content/test/static/browser_parsable_css.js
@@ -168,23 +168,31 @@ function dumpWhitelistItem(item) {
  * objects defined in whitelist
  *
  * @param aErrorObject the error to check
  * @return true if the error should be ignored, false otherwise.
  */
 function ignoredError(aErrorObject) {
   for (let whitelistItem of whitelist) {
     let matches = true;
+    let catchAll = true;
     for (let prop of ["sourceName", "errorMessage"]) {
-      if (whitelistItem.hasOwnProperty(prop) &&
-          !whitelistItem[prop].test(aErrorObject[prop] || "")) {
-        matches = false;
-        break;
+      if (whitelistItem.hasOwnProperty(prop)) {
+        catchAll = false;
+        if (!whitelistItem[prop].test(aErrorObject[prop] || "")) {
+          matches = false;
+          break;
+        }
       }
     }
+    if (catchAll) {
+      ok(false, "A whitelist item is catching all errors. " +
+         dumpWhitelistItem(whitelistItem));
+      continue;
+    }
     if (matches) {
       whitelistItem.used = true;
       let {sourceName, errorMessage} = aErrorObject;
       info(`Ignored error "${errorMessage}" on ${sourceName} ` +
            "because of whitelist item " + dumpWhitelistItem(whitelistItem));
       return true;
     }
   }