Bug 1456704 - Fix CSP empty directive test by ignoring errors that aren't from CSP. r=ckerschb, a=test-only
authorJonathan Kingston <jkt@mozilla.com>
Mon, 14 May 2018 10:44:06 +0100
changeset 473323 dd4babc850ff5b3313e11cb8479442c697b6283a
parent 473322 372bc698d60c50ec975a5ae84338edf3db897949
child 473324 f13605a00c2b310bc93ad9d44db34b2284d53dbe
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb, test-only
bugs1456704
milestone61.0
Bug 1456704 - Fix CSP empty directive test by ignoring errors that aren't from CSP. r=ckerschb, a=test-only MozReview-Commit-ID: DOlNKATQSY1
dom/security/test/csp/test_empty_directive.html
--- a/dom/security/test/csp/test_empty_directive.html
+++ b/dom/security/test/csp/test_empty_directive.html
@@ -27,17 +27,17 @@ function cleanup() {
 function finish() {
   SimpleTest.finish();
 }
 
 SpecialPowers.registerConsoleListener(function ConsoleMsgListener(aMsg) {
   if (aMsg.message == "SENTINEL") {
     is(consoleCount, 0);
     SimpleTest.executeSoon(finish);
-  } else {
+  } else if (aMsg.message.includes("Content Security Policy")) {
     ++consoleCount;
     ok(false, "Must never see a console warning here");
   }
 });
 
 // set up and start testing
 SimpleTest.waitForExplicitFinish();
 let frame = document.getElementById('cspframe');