Bug 991466 - Remove pushprevenv for security.csp.speccompliant from tests since the pref no longer has effect. (r=ckerschb)
authorSid Stamm <sstamm@mozilla.com>
Mon, 07 Jul 2014 11:59:59 -0700
changeset 192729 5ae58efd730bdb3dffd51f2e85057000d091ca48
parent 192728 3a34bf944379d919f064d705b93b36aaf7df57ff
child 192730 006053858a182dedbf5d118657dd9123768dcb57
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersckerschb
bugs991466
milestone33.0a1
Bug 991466 - Remove pushprevenv for security.csp.speccompliant from tests since the pref no longer has effect. (r=ckerschb)
content/base/test/csp/test_301_redirect.html
content/base/test/csp/test_302_redirect.html
content/base/test/csp/test_303_redirect.html
content/base/test/csp/test_307_redirect.html
content/base/test/csp/test_CSP.html
content/base/test/csp/test_CSP_bug663567.html
content/base/test/csp/test_CSP_bug802872.html
content/base/test/csp/test_CSP_bug885433.html
content/base/test/csp/test_CSP_bug888172.html
content/base/test/csp/test_CSP_bug909029.html
content/base/test/csp/test_CSP_bug910139.html
content/base/test/csp/test_CSP_bug941404.html
content/base/test/csp/test_CSP_evalscript.html
content/base/test/csp/test_CSP_evalscript_getCRMFRequest.html
content/base/test/csp/test_CSP_frameancestors.html
content/base/test/csp/test_CSP_inlinescript.html
content/base/test/csp/test_CSP_inlinestyle.html
content/base/test/csp/test_bug836922_npolicies.html
content/base/test/csp/test_bug886164.html
content/base/test/csp/test_csp_bug768029.html
content/base/test/csp/test_csp_bug773891.html
content/base/test/csp/test_csp_redirects.html
content/base/test/csp/test_csp_regexp_parsing.html
content/base/test/csp/test_csp_report.html
content/base/test/csp/test_hash_source.html
content/base/test/csp/test_multi_policy_injection_bypass.html
content/base/test/csp/test_nonce_source.html
content/base/test/csp/test_policyuri_regression_from_multipolicy.html
content/base/test/csp/test_report_uri_missing_in_report_only_header.html
content/base/test/csp/test_self_none_as_hostname_confusion.html
content/base/test/csp/test_subframe_run_js_if_allowed.html
--- a/content/base/test/csp/test_301_redirect.html
+++ b/content/base/test/csp/test_301_redirect.html
@@ -61,19 +61,14 @@ window.done = function(result) {
   // clean up observers and finish the test
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 // save this for last so that our listeners are registered.
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('content_iframe').src = 'file_redirect_content.sjs?301';
-    });
+// ... this loads the testbed of good and bad requests.
+document.getElementById('content_iframe').src = 'file_redirect_content.sjs?301';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_302_redirect.html
+++ b/content/base/test/csp/test_302_redirect.html
@@ -61,19 +61,14 @@ window.done = function(result) {
   // clean up observers and finish the test
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 // save this for last so that our listeners are registered.
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('content_iframe').src = 'file_redirect_content.sjs?302';
-    });
+// ... this loads the testbed of good and bad requests.
+document.getElementById('content_iframe').src = 'file_redirect_content.sjs?302';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_303_redirect.html
+++ b/content/base/test/csp/test_303_redirect.html
@@ -61,19 +61,14 @@ window.done = function(result) {
   // clean up observers and finish the test
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 // save this for last so that our listeners are registered.
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('content_iframe').src = 'file_redirect_content.sjs?303';
-    });
+// ... this loads the testbed of good and bad requests.
+document.getElementById('content_iframe').src = 'file_redirect_content.sjs?303';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_307_redirect.html
+++ b/content/base/test/csp/test_307_redirect.html
@@ -61,19 +61,15 @@ window.done = function(result) {
   // clean up observers and finish the test
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 // save this for last so that our listeners are registered.
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('content_iframe').src = 'file_redirect_content.sjs?307';
-    });
+// ... this loads the testbed of good and bad requests.
+document.getElementById('content_iframe').src = 'file_redirect_content.sjs?307';
+
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP.html
+++ b/content/base/test/csp/test_CSP.html
@@ -96,18 +96,17 @@ window.testResult = function(testname, r
   // ... otherwise, finish
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true],
-          // This defaults to 0 ("preload none") on mobile (B2G/Android), which
+  {'set':[// This defaults to 0 ("preload none") on mobile (B2G/Android), which
           // blocks loading the resource until the user interacts with a
           // corresponding widget, which breaks the media_* tests. We set it
           // back to the default used by desktop Firefox to get consistent
           // behavior.
           ["media.preload.default", 2]]},
     function() {
       // save this for last so that our listeners are registered.
       // ... this loads the testbed of good and bad requests.
--- a/content/base/test/csp/test_CSP_bug663567.html
+++ b/content/base/test/csp/test_CSP_bug663567.html
@@ -60,22 +60,17 @@ function checkBlocked () {
     is(xsltBlockedHeader, null, "XSLT loaded from different host should be blocked!");
   }
   catch (e) {
     ok(false, "Error: could not access content in xsltframe2!")
   }
   checkExplicitFinish();
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    document.getElementById('xsltframe').addEventListener('load', checkAllowed, false);
-    document.getElementById('xsltframe').src = 'file_CSP_bug663567_allows.xml';
+document.getElementById('xsltframe').addEventListener('load', checkAllowed, false);
+document.getElementById('xsltframe').src = 'file_CSP_bug663567_allows.xml';
 
-    document.getElementById('xsltframe2').addEventListener('load', checkBlocked, false);
-    document.getElementById('xsltframe2').src = 'file_CSP_bug663567_blocks.xml';
-  }
-);
+document.getElementById('xsltframe2').addEventListener('load', checkBlocked, false);
+document.getElementById('xsltframe2').src = 'file_CSP_bug663567_blocks.xml';
 
 </script>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_bug802872.html
+++ b/content/base/test/csp/test_CSP_bug802872.html
@@ -20,39 +20,34 @@ var numberOfTests = 2;
 
 var checkExplicitFinish = function () {
   finishedTests++;
   if (finishedTests == numberOfTests) {
      SimpleTest.finish();
   }
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    // add event listeners for CSP-permitted EventSrc callbacks
-    addEventListener('allowedEventSrcCallbackOK', function (e) {
-      ok(true, "OK: CSP allows EventSource for whitelisted domain!");
-      checkExplicitFinish();
-    }, false);
-    addEventListener('allowedEventSrcCallbackFailed', function (e) {
-      ok(false, "Error: CSP blocks EventSource for whitelisted domain!");
-      checkExplicitFinish();
-    }, false);
+// add event listeners for CSP-permitted EventSrc callbacks
+addEventListener('allowedEventSrcCallbackOK', function (e) {
+  ok(true, "OK: CSP allows EventSource for whitelisted domain!");
+  checkExplicitFinish();
+}, false);
+addEventListener('allowedEventSrcCallbackFailed', function (e) {
+  ok(false, "Error: CSP blocks EventSource for whitelisted domain!");
+  checkExplicitFinish();
+}, false);
 
-    // add event listeners for CSP-blocked EventSrc callbacks
-    addEventListener('blockedEventSrcCallbackOK', function (e) {
-      ok(false, "Error: CSP allows EventSource to not whitelisted domain!");
-      checkExplicitFinish();
-    }, false);
-    addEventListener('blockedEventSrcCallbackFailed', function (e) {
-      ok(true, "OK: CSP blocks EventSource for not whitelisted domain!");
-      checkExplicitFinish();
-    }, false);
+// add event listeners for CSP-blocked EventSrc callbacks
+addEventListener('blockedEventSrcCallbackOK', function (e) {
+  ok(false, "Error: CSP allows EventSource to not whitelisted domain!");
+  checkExplicitFinish();
+}, false);
+addEventListener('blockedEventSrcCallbackFailed', function (e) {
+  ok(true, "OK: CSP blocks EventSource for not whitelisted domain!");
+  checkExplicitFinish();
+}, false);
 
-    // load it
-    document.getElementById('eventframe').src = 'file_CSP_bug802872.html';
-  }
-);
+// load it
+document.getElementById('eventframe').src = 'file_CSP_bug802872.html';
 
 </script>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_bug885433.html
+++ b/content/base/test/csp/test_CSP_bug885433.html
@@ -45,21 +45,16 @@ function checkBlocked () {
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-eval-script-blocked')).color;
   ok(color === black, "Eval should be blocked");
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-inline-style-blocked')).color;
   ok(color === black, "Inline style should be blocked");
 
   SimpleTest.finish();
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    document.getElementById('cspframe').src = 'file_CSP_bug885433_allows.html';
-    document.getElementById('cspframe').addEventListener('load', checkAllowed, false);
-    document.getElementById('cspframe2').src = 'file_CSP_bug885433_blocks.html';
-    document.getElementById('cspframe2').addEventListener('load', checkBlocked, false);
-  }
-);
+document.getElementById('cspframe').src = 'file_CSP_bug885433_allows.html';
+document.getElementById('cspframe').addEventListener('load', checkAllowed, false);
+document.getElementById('cspframe2').src = 'file_CSP_bug885433_blocks.html';
+document.getElementById('cspframe2').addEventListener('load', checkBlocked, false);
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_bug888172.html
+++ b/content/base/test/csp/test_CSP_bug888172.html
@@ -51,28 +51,23 @@ function checkDefaultSrcWithStyleSrc() {
   ok(getElementColorById(testframe, 'unsafe-inline-script') === green, "Inline script should be allowed");
   ok(getElementColorById(testframe, 'unsafe-eval-script')  === green, "Eval should be allowed");
   ok(getElementColorById(testframe, 'unsafe-inline-style') === black, "Inline style should be blocked");
 
   // last test calls finish
   SimpleTest.finish();
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    document.getElementById('testframe1').src = 'file_CSP_bug888172.sjs?csp=' +
-      escape("default-src 'self' 'unsafe-inline' 'unsafe-eval'");
-    document.getElementById('testframe1').addEventListener('load', checkDefaultSrcOnly, false);
+document.getElementById('testframe1').src = 'file_CSP_bug888172.sjs?csp=' +
+  escape("default-src 'self' 'unsafe-inline' 'unsafe-eval'");
+document.getElementById('testframe1').addEventListener('load', checkDefaultSrcOnly, false);
 
-    document.getElementById('testframe2').src = 'file_CSP_bug888172.sjs?csp=' +
-      escape("default-src 'self' 'unsafe-inline' 'unsafe-eval'; script-src 'self'");
-    document.getElementById('testframe2').addEventListener('load', checkDefaultSrcWithScriptSrc, false);
+document.getElementById('testframe2').src = 'file_CSP_bug888172.sjs?csp=' +
+  escape("default-src 'self' 'unsafe-inline' 'unsafe-eval'; script-src 'self'");
+document.getElementById('testframe2').addEventListener('load', checkDefaultSrcWithScriptSrc, false);
 
-    document.getElementById('testframe3').src = 'file_CSP_bug888172.sjs?csp=' +
-      escape("default-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self'");
-    document.getElementById('testframe3').addEventListener('load', checkDefaultSrcWithStyleSrc, false);
-  }
-);
+document.getElementById('testframe3').src = 'file_CSP_bug888172.sjs?csp=' +
+  escape("default-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self'");
+document.getElementById('testframe3').addEventListener('load', checkDefaultSrcWithStyleSrc, false);
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_bug909029.html
+++ b/content/base/test/csp/test_CSP_bug909029.html
@@ -115,20 +115,15 @@ function checkInlineWithNone() {
   window.testResult("noneInlineStyleAllowed",
                     getElementColorById(testframe, 'inline-style') === green,
                     "Inline styles should be allowed (style-src 'unsafe-inline' with none)");
   window.testResult("noneInlineScriptBlocked",
                     getElementColorById(testframe, 'inline-script') === black,
                     "Inline scripts should be blocked (style-src 'unsafe-inline' with none)");
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    document.getElementById('testframe1').src = 'file_CSP_bug909029_star.html';
-    document.getElementById('testframe1').addEventListener('load', checkInlineWithStar, false);
-    document.getElementById('testframe2').src = 'file_CSP_bug909029_none.html';
-    document.getElementById('testframe2').addEventListener('load', checkInlineWithNone, false);
-  }
-);
+document.getElementById('testframe1').src = 'file_CSP_bug909029_star.html';
+document.getElementById('testframe1').addEventListener('load', checkInlineWithStar, false);
+document.getElementById('testframe2').src = 'file_CSP_bug909029_none.html';
+document.getElementById('testframe2').addEventListener('load', checkInlineWithNone, false);
     </script>
   </body>
 </html>
--- a/content/base/test/csp/test_CSP_bug910139.html
+++ b/content/base/test/csp/test_CSP_bug910139.html
@@ -53,19 +53,14 @@ function checkBlocked () {
     is(xsltBlockedHeader, null, "XSLT loaded from different host should be blocked!");
   }
   catch (e) {
     ok(false, "Error: could not access content in xsltframe2!")
   }
   SimpleTest.finish();
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    document.getElementById('xsltframe').addEventListener('load', checkAllowed, false);
-    document.getElementById('xsltframe').src = 'file_CSP_bug910139.sjs';
-  }
-);
+document.getElementById('xsltframe').addEventListener('load', checkAllowed, false);
+document.getElementById('xsltframe').src = 'file_CSP_bug910139.sjs';
 
 </script>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_bug941404.html
+++ b/content/base/test/csp/test_CSP_bug941404.html
@@ -92,20 +92,16 @@ window.testResult = function(testname, r
 
   // ... otherwise, finish
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe').src = 'file_CSP_bug941404.html';
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_CSP_bug941404.html';
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_evalscript.html
+++ b/content/base/test/csp/test_CSP_evalscript.html
@@ -44,20 +44,16 @@ var checkTestResults = function() {
   // ... otherwise, finish
   SimpleTest.finish();
 }
 
 //////////////////////////////////////////////////////////////////////
 // set up and go
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('cspframe').src = 'file_CSP_evalscript_main.html';
-      document.getElementById('cspframe2').src = 'file_CSP_evalscript_main_allowed.html';
-    });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_CSP_evalscript_main.html';
+document.getElementById('cspframe2').src = 'file_CSP_evalscript_main_allowed.html';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_evalscript_getCRMFRequest.html
+++ b/content/base/test/csp/test_CSP_evalscript_getCRMFRequest.html
@@ -43,21 +43,17 @@ var checkTestResults = function() {
   // ... otherwise, finish
   SimpleTest.finish();
 }
 
 //////////////////////////////////////////////////////////////////////
 // set up and go
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('cspframe').src = 'file_CSP_evalscript_main_getCRMFRequest.html';
-      document.getElementById('cspframe2').src = 'file_CSP_evalscript_main_allowed_getCRMFRequest.html';
-      document.getElementById('cspframe3').src = 'file_CSP_evalscript_no_CSP_at_all.html';
-    });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_CSP_evalscript_main_getCRMFRequest.html';
+document.getElementById('cspframe2').src = 'file_CSP_evalscript_main_allowed_getCRMFRequest.html';
+document.getElementById('cspframe3').src = 'file_CSP_evalscript_no_CSP_at_all.html';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_frameancestors.html
+++ b/content/base/test/csp/test_CSP_frameancestors.html
@@ -142,21 +142,16 @@ function receiveMessage(event) {
     frameLoaded(event.data.testname, event.data.uri);
 }
 
 //////////////////////////////////////////////////////////////////////
 // set up and go
 window.examiner = new examiner();
 SimpleTest.waitForExplicitFinish();
 
-// added this so the tests run even if we don't flip the pref on by default.
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe').src = 'file_CSP_frameancestors_main.html';
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_CSP_frameancestors_main.html';
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_inlinescript.html
+++ b/content/base/test/csp/test_CSP_inlinescript.html
@@ -96,22 +96,18 @@ function clickit1() {
 }
 
 function clickit2() {
   var cspframe2 = document.getElementById('cspframe2');
   var a = cspframe2.contentDocument.getElementById('anchortoclick');
   sendMouseEvent({type:'click'}, a, cspframe2.contentWindow);
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe1').src = 'file_CSP_inlinescript_main.html';
-    document.getElementById('cspframe1').addEventListener('load', clickit1, false);
-    document.getElementById('cspframe2').src = 'file_CSP_inlinescript_main_allowed.html';
-    document.getElementById('cspframe2').addEventListener('load', clickit2, false);
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe1').src = 'file_CSP_inlinescript_main.html';
+document.getElementById('cspframe1').addEventListener('load', clickit1, false);
+document.getElementById('cspframe2').src = 'file_CSP_inlinescript_main_allowed.html';
+document.getElementById('cspframe2').addEventListener('load', clickit2, false);
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_CSP_inlinestyle.html
+++ b/content/base/test/csp/test_CSP_inlinestyle.html
@@ -89,23 +89,19 @@ function checkStylesAllowed(evt) {
 }
 
 function checkIfDone() {
   done++;
   if (done == 2)
     SimpleTest.finish();
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe1').src = 'file_CSP_inlinestyle_main.html';
-    document.getElementById('cspframe1').addEventListener('load', checkStyles, false);
-    document.getElementById('cspframe2').src = 'file_CSP_inlinestyle_main_allowed.html';
-    document.getElementById('cspframe2').addEventListener('load', checkStylesAllowed, false);
-  }
-);
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe1').src = 'file_CSP_inlinestyle_main.html';
+document.getElementById('cspframe1').addEventListener('load', checkStyles, false);
+document.getElementById('cspframe2').src = 'file_CSP_inlinestyle_main_allowed.html';
+document.getElementById('cspframe2').addEventListener('load', checkStylesAllowed, false);
+
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_bug836922_npolicies.html
+++ b/content/base/test/csp/test_bug836922_npolicies.html
@@ -230,20 +230,16 @@ window.testResult = function(testname, r
     is(result, 'blocked', ">> " + msg);
   }
   window.loads[testname].verified = true;
 }
 
 
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-   function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe').src = 'http://mochi.test:8888' + path + 'file_bug836922_npolicies.html';
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'http://mochi.test:8888' + path + 'file_bug836922_npolicies.html';
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_bug886164.html
+++ b/content/base/test/csp/test_bug886164.html
@@ -152,25 +152,21 @@ window.testResult = function(testname, r
   cspTestsDone = true;
   if (iframeSandboxTestsDone) {
     SimpleTest.finish();
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe').src = 'file_bug886164.html';
-    document.getElementById('cspframe2').src = 'file_bug886164_2.html';
-    document.getElementById('cspframe3').src = 'file_bug886164_3.html';
-    document.getElementById('cspframe4').src = 'file_bug886164_4.html';
-    document.getElementById('cspframe5').src = 'file_bug886164_5.html';
-    document.getElementById('cspframe6').src = 'file_bug886164_6.html';
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_bug886164.html';
+document.getElementById('cspframe2').src = 'file_bug886164_2.html';
+document.getElementById('cspframe3').src = 'file_bug886164_3.html';
+document.getElementById('cspframe4').src = 'file_bug886164_4.html';
+document.getElementById('cspframe5').src = 'file_bug886164_5.html';
+document.getElementById('cspframe6').src = 'file_bug886164_6.html';
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_csp_bug768029.html
+++ b/content/base/test/csp/test_csp_bug768029.html
@@ -208,17 +208,16 @@ function runTest() {
 var gTestRunner = runTest();
 
 // load the default CSP and pref it on
 SpecialPowers.addPermission("browser", true, "https://example.com");
 SpecialPowers.pushPrefEnv({'set': [["dom.mozBrowserFramesEnabled", true],
                                    ["security.apps.privileged.CSP.default", DEFAULT_CSP_PRIV],
                                    ["security.apps.certified.CSP.default", DEFAULT_CSP_CERT],
                                    ["security.mixed_content.block_active_content", false],
-                                   ["security.mixed_content.block_display_content", false],
-                                   ["security.csp.speccompliant", true]]},
+                                   ["security.mixed_content.block_display_content", false]]},
                           function() {  gTestRunner.next(); });
 
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_csp_bug773891.html
+++ b/content/base/test/csp/test_csp_bug773891.html
@@ -213,17 +213,16 @@ function runTest() {
 
 var gTestRunner = runTest();
 
 // load the default CSP and pref it on
 SpecialPowers.addPermission("browser", true, "https://example.com");
 
 SpecialPowers.pushPrefEnv({'set': [["dom.mozBrowserFramesEnabled", true],
                                    ["security.apps.privileged.CSP.default", DEFAULT_CSP_PRIV],
-                                   ["security.apps.certified.CSP.default", DEFAULT_CSP_CERT],
-                                   ["security.csp.speccompliant", true]]},
+                                   ["security.apps.certified.CSP.default", DEFAULT_CSP_CERT]]},
                           function() {  gTestRunner.next(); });
 
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_csp_redirects.html
+++ b/content/base/test/csp/test_csp_redirects.html
@@ -106,18 +106,17 @@ var testResult = function(testName, url,
 
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true],
-          // This defaults to 0 ("preload none") on mobile (B2G/Android), which
+  {'set':[// This defaults to 0 ("preload none") on mobile (B2G/Android), which
           // blocks loading the resource until the user interacts with a
           // corresponding widget, which breaks the media_* tests. We set it
           // back to the default used by desktop Firefox to get consistent
           // behavior.
           ["media.preload.default", 2]]},
   function() {
     // save this for last so that our listeners are registered.
     // ... this loads the testbed of good and bad requests.
--- a/content/base/test/csp/test_csp_regexp_parsing.html
+++ b/content/base/test/csp/test_csp_regexp_parsing.html
@@ -89,18 +89,13 @@ function test() {
     is(divcontent, policy[0], "should be " + policy[0] + " in test " + (counter - 1) + "!");
   }
   catch (e) {
     ok(false, "ERROR: could not access content in test " + (counter - 1) + "!");
   }
   loadNextTest();
 }
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    loadNextTest();
-  }
-);
+loadNextTest();
 
 </script>
 </body>
 </html>
--- a/content/base/test/csp/test_csp_report.html
+++ b/content/base/test/csp/test_csp_report.html
@@ -95,19 +95,15 @@ window.checkResults = function(reportObj
   // change with the trunk
 }
 
 window.examiner = new examiner();
 
 SimpleTest.waitForExplicitFinish();
 
 // load the resource which will generate a CSP violation report
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // save this for last so that our listeners are registered.
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById("cspframe").src = testFile;
-    });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById("cspframe").src = testFile;
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_hash_source.html
+++ b/content/base/test/csp/test_hash_source.html
@@ -120,20 +120,16 @@ function checkInline () {
 
   cleanup();
 }
 
 //////////////////////////////////////////////////////////////////////
 // set up and go
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe').src = 'file_hash_source.html';
-    document.getElementById('cspframe').addEventListener('load', checkInline, false);
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_hash_source.html';
+document.getElementById('cspframe').addEventListener('load', checkInline, false);
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_multi_policy_injection_bypass.html
+++ b/content/base/test/csp/test_multi_policy_injection_bypass.html
@@ -105,19 +105,15 @@ window.testResult = function(testname, r
   // ... otherwise, finish
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 // save this for last so that our listeners are registered.
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-    function() {
-      // ... this loads the testbed of good and bad requests.
-      document.getElementById('cspframe').src = 'file_multi_policy_injection_bypass.html';
-      document.getElementById('cspframe2').src = 'file_multi_policy_injection_bypass_2.html';
-    });
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_multi_policy_injection_bypass.html';
+document.getElementById('cspframe2').src = 'file_multi_policy_injection_bypass_2.html';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_nonce_source.html
+++ b/content/base/test/csp/test_nonce_source.html
@@ -107,20 +107,16 @@ function checkInlineScriptsAndStyles () 
   ranTests(8);
 }
 
 //////////////////////////////////////////////////////////////////////
 // set up and go
 window.examiner = new examiner();
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    // save this for last so that our listeners are registered.
-    // ... this loads the testbed of good and bad requests.
-    document.getElementById('cspframe').src = 'file_nonce_source.html';
-    document.getElementById('cspframe').addEventListener('load', checkInlineScriptsAndStyles, false);
-  });
+// save this for last so that our listeners are registered.
+// ... this loads the testbed of good and bad requests.
+document.getElementById('cspframe').src = 'file_nonce_source.html';
+document.getElementById('cspframe').addEventListener('load', checkInlineScriptsAndStyles, false);
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_policyuri_regression_from_multipolicy.html
+++ b/content/base/test/csp/test_policyuri_regression_from_multipolicy.html
@@ -9,24 +9,19 @@
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <iframe style="width:200px;height:200px;" id='testframe'></iframe>
 <script class="testbody" type="text/javascript">
 SimpleTest.waitForExplicitFinish();
 
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function () {
-    var testframe = document.getElementById('testframe');
-    testframe.src = 'file_policyuri_regression_from_multipolicy.html';
-    testframe.addEventListener('load', function checkInlineScriptExecuted () {
-      is(this.contentDocument.getElementById('testdiv').innerHTML,
-         'Inline Script Executed',
-         'Inline script should execute (it would be blocked by the policy, but the policy is report-only)');
-      SimpleTest.finish();
-    });
-  }
-);
+var testframe = document.getElementById('testframe');
+testframe.src = 'file_policyuri_regression_from_multipolicy.html';
+testframe.addEventListener('load', function checkInlineScriptExecuted () {
+  is(this.contentDocument.getElementById('testdiv').innerHTML,
+      'Inline Script Executed',
+      'Inline script should execute (it would be blocked by the policy, but the policy is report-only)');
+  SimpleTest.finish();
+});
 </script>
 </body>
 </html>
--- a/content/base/test/csp/test_report_uri_missing_in_report_only_header.html
+++ b/content/base/test/csp/test_report_uri_missing_in_report_only_header.html
@@ -35,17 +35,13 @@ SpecialPowers.registerConsoleListener(fu
     // if some other console message is present, we wait
     return;
   }
 });
 
 
 // set up and start testing
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv(
-  {'set': [["security.csp.speccompliant", true]]},
-  function() {
-    document.getElementById('cspframe').src = 'file_report_uri_missing_in_report_only_header.html';
-});
+document.getElementById('cspframe').src = 'file_report_uri_missing_in_report_only_header.html';
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_self_none_as_hostname_confusion.html
+++ b/content/base/test/csp/test_self_none_as_hostname_confusion.html
@@ -42,18 +42,14 @@ SpecialPowers.registerConsoleListener(fu
       // don't see the warning yet? wait.
       return;
     }
   }
 });
 
 // set up and start testing
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv(
-  {'set': [["security.csp.speccompliant", true]]},
-  function() {
-    document.getElementById('cspframe').src = 'file_self_none_as_hostname_confusion.html';
-    startTest = true;
-});
+document.getElementById('cspframe').src = 'file_self_none_as_hostname_confusion.html';
+startTest = true;
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/csp/test_subframe_run_js_if_allowed.html
+++ b/content/base/test/csp/test_subframe_run_js_if_allowed.html
@@ -22,16 +22,12 @@ function checkResult()
 {
   is(javascript_link_ran, true,
      "javascript URL didn't execute");
 
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv(
-  {'set':[["security.csp.speccompliant", true]]},
-  function() {
-    document.getElementById('i').src = 'file_subframe_run_js_if_allowed.html';
-  });
+document.getElementById('i').src = 'file_subframe_run_js_if_allowed.html';
 </script>
 </body>
 </html>