Index: LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked.html |
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked.html b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ffb475e9b28a44f25c41d9af76e5f610f896b2b |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <meta http-equiv="Content-Security-Policy" content="style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='"> |
+ <style>p { color: green; }</style> |
+ <style>p { color: red; }</style> |
+ <style>p { color: purple; }</style> |
+ <style>p { color: blue; }</style> |
+</head> |
+<body> |
+ <p> |
+ This tests the effect of a valid style-hash value, with one valid |
+ style and several invalid ones. It passes if the valid style is applied |
+ and three console warnings are visible. |
+ </p> |
+ <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> |