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

Unified Diff: LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed.html

Issue 138033019: CSP 1.1: Apply hashes to style elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed.html
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed.html b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed.html
new file mode 100644
index 0000000000000000000000000000000000000000..d551f8772c926b735fcde24c6a59010957d02766
--- /dev/null
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Security-Policy" content="style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='">
+ </head>
+ <body>
+ <p>This tests the result of a valid style hash. It passes if this text is green, and a "PASS" alert is fired.</p>
+ <style>p { color: green; }</style>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var color = window.getComputedStyle(document.querySelector('p')).color;
+ if (color === "rgb(0, 128, 0)")
+ alert("PASS: The 'p' element's text is green, which means the style was correctly applied.");
+ else
+ alert("FAIL: The 'p' element's text is " + color + ", which means the style was incorrectly applied.");
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-allowed-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698