Index: LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html |
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dd7f9f681318ba17f77dcb696c575642c545b494 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html |
@@ -0,0 +1,20 @@ |
+<!DOCTYPE html> |
+<html> |
+ <head> |
+ <meta http-equiv="Content-Security-Policy" content="default-src 'sha256-SXMrww9+PS7ymkxYbv91id+HfXeO7p1uCY0xhNb4MIw='; script-src 'unsafe-inline'"> |
+ </head> |
+ <body> |
+ <p id="p">This tests the result of a valid style hash. It passes if this text is green, and a "PASS" alert for p is fired.</p> |
+ <style>p#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."); |
Mike West
2015/09/22 04:37:38
Nit: I know you've probably copy/pasted this from
jww
2015/09/22 16:55:37
Changed test, will add to w3c/web-platform-tests s
|
+ </script> |
+ </body> |
+</html> |