Function to test whether an inline script variable is defined or not.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/csp/submitted/mozilla/assertTrue.php Thu May 03 15:13:33 2012 -0700
@@ -0,0 +1,18 @@
+<?php
+
+//Prevent Caching
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+header("Content-Type: text/javascript");
+
+ print("(function () { if(typeof " . $_GET["varName"] . "=='undefined') {
+ test(function() {assert_true(" . $_GET["varName"] . ")}, \"assert_true with unsafeScript\");
+ } else{
+ test(function() {assert_true(" . $_GET["varName"] . ")}, \"assert_true with unsafeScript defined when it shouldn't be\");
+ } })();");
+
+?>
+