Bug 1058451 - Intermittent test_CSP_bug885433.html | Inline script should be allowed - Result logged after SimpleTest.finish(). r=sstamm, a=test-only
authorMartijn Wargers <mwargers@mozilla.com>
Tue, 26 Aug 2014 17:59:42 +0200
changeset 209580 e06569159f7104e3e57e3c6362ec900b73f5002b
parent 209579 4a8b8042fc7cbfd36a1eda3f0af546eb335012f3
child 209581 c760537e6dd8e0f9f050f3751c8d78f29e6e20bf
push id6715
push userryanvm@gmail.com
push dateThu, 28 Aug 2014 20:56:18 +0000
treeherdermozilla-aurora@c760537e6dd8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstamm, test-only
bugs1058451, 885433
milestone33.0a2
Bug 1058451 - Intermittent test_CSP_bug885433.html | Inline script should be allowed - Result logged after SimpleTest.finish(). r=sstamm, a=test-only
content/base/test/csp/test_CSP_bug885433.html
--- a/content/base/test/csp/test_CSP_bug885433.html
+++ b/content/base/test/csp/test_CSP_bug885433.html
@@ -29,16 +29,19 @@ function checkAllowed () {
   var color;
 
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-inline-script-allowed')).color;
   ok(color === green, "Inline script should be allowed");
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-eval-script-allowed')).color;
   ok(color === green, "Eval should be allowed");
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-inline-style-allowed')).color;
   ok(color === green, "Inline style should be allowed");
+
+  document.getElementById('cspframe2').src = 'file_CSP_bug885433_blocks.html';
+  document.getElementById('cspframe2').addEventListener('load', checkBlocked, false);
 }
 
 function checkBlocked () {
   var cspframe = document.getElementById('cspframe2');
   var color;
 
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-inline-script-blocked')).color;
   ok(color === black, "Inline script should be blocked");
@@ -47,14 +50,12 @@ function checkBlocked () {
   color = window.getComputedStyle(cspframe.contentDocument.getElementById('unsafe-inline-style-blocked')).color;
   ok(color === black, "Inline style should be blocked");
 
   SimpleTest.finish();
 }
 
 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>