OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Security-Policy" content="style-src 'nonce-non
cynonce'"> | 4 <meta http-equiv="Content-Security-Policy" content="style-src 'nonce-non
cynonce'"> |
5 <script src="/js-test-resources/js-test-pre.js"></script> | 5 <script src="/js-test-resources/js-test-pre.js"></script> |
6 <style nonce="noncynonce"> | 6 <style nonce="noncynonce"> |
7 #test { | 7 #test { |
8 color: green; | 8 color: green; |
9 } | 9 } |
10 </style> | 10 </style> |
11 <style> | 11 <style> |
12 #test { | 12 #test { |
13 color: red; | 13 color: red; |
14 } | 14 } |
15 </style> | 15 </style> |
16 </head> | 16 </head> |
17 <body> | 17 <body> |
18 <p id="test">This text should be green.</p> | 18 <p id="test">This text should be green.</p> |
19 <script> | 19 <script> |
20 description("Style correctly whitelisted via a 'nonce-*' expression
in 'style-src' should be applied to the page."); | 20 description("Style correctly whitelisted via a 'nonce-*' expression
in 'style-src' should be applied to the page."); |
21 var el = document.querySelector('#test'); | 21 var el = document.querySelector('#test'); |
22 shouldBeEqualToString("window.getComputedStyle(el).color", "rgb(0, 1
28, 0)"); | 22 shouldBeEqualToString("window.getComputedStyle(el).color", "rgb(0, 1
28, 0)"); |
23 </script> | 23 </script> |
24 <script src="/js-test-resources/js-test-post.js"></script> | |
25 </body> | 24 </body> |
26 </html> | 25 </html> |
OLD | NEW |