blob: 18e6eac7bb6595622fe97aaec28a3707c602273f [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src http://localhost:8000 'nonce-hello'">
<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/having-nonce-policy.cgi">
</head>
<body>
<script nonce="hello">
function test(actual, expected, message)
{
if (actual === expected)
console.log("PASS");
else
console.log("FAIL:" + message);
}
if (window.testRunner)
testRunner.dumpAsText();
test(document.inlineScriptHasRun, undefined, "document.inlineScriptHasRun");
test(document.externalScriptHasRun, undefined, "document.externalScriptHasRun");
test(document.externalScriptWithNonceHasRun, true, "document.externalScriptWithNonceHasRun");
test(document.inlineScriptWithNonceHasRun, true, "document.inlineScriptWithNonceHasRun");
test(document.evalFromInlineHasRun, undefined, "document.evalFromInlineHasRun");
test(document.evalFromExternalHasRun, undefined, "document.evalFromExternalHasRun");
test(document.evalFromInlineWithNonceHasRun, undefined, "document.evalFromInlineWithNonceHasRun");
test(document.evalFromExternalWithNonceHasRun, undefined, "document.evalFromExternalWithNonceHasRun");
</script>
</body>
</html>