Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-allowed.php

Issue 2020223002: Refactor nonce support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@inline
Patch Set: Rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-allowed.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-allowed.php b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-allowed.php
new file mode 100644
index 0000000000000000000000000000000000000000..62788b531bc01e5a29e5739d6a7444f19a06776d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-allowed.php
@@ -0,0 +1,13 @@
+<?php
+ header("Content-Security-Policy: script-src 'self' 'nonce-abc'");
+?>
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script nonce="abc">
+ var executed_test = async_test("Nonced script executes, and does not generate a violation report.");
+ document.addEventListener('securitypolicyviolation', executed_test.unreached_func("No report should be generated"));
+</script>
+<script nonce="abc">
+ executed_test.done();
+</script>

Powered by Google App Engine
This is Rietveld 408576698