style-src-elem-allowed-src-blocked-link.html (703B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta http-equiv="Content-Security-Policy" content="style-src 'none'; style-src-elem 'self'"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script> 9 var t = async_test("Inline style should be applied"); 10 window.addEventListener('securitypolicyviolation', t.unreached_func("Should not have fired a spv event")); 11 </script> 12 <link rel="stylesheet" href="/content-security-policy/style-src/resources/allowed.css"> 13 </head> 14 <body> 15 <script> 16 t.step(function() { 17 assert_equals(document.styleSheets.length, 1); 18 t.done(); 19 }); 20 </script> 21 </body> 22 23 </html>