OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Security-Policy" content="base-uri 'self'"> | 4 <meta http-equiv="Content-Security-Policy" content="base-uri 'self'"> |
5 <script src="http://localhost:8000/js-test-resources/js-test.js"></script> | 5 <script src="http://localhost:8000/js-test-resources/js-test.js"></script> |
6 <script src="http://localhost:8000/security/contentSecurityPolicy/resources/
securitypolicyviolation-test.js"></script> | 6 <script src="http://localhost:8000/security/contentSecurityPolicy/resources/
securitypolicyviolation-test.js"></script> |
7 <script> | 7 <script> |
8 description('Check that base URIs cannot be set if they violate the page
\'s policy.'); | 8 description('Check that base URIs cannot be set if they violate the page
\'s policy.'); |
9 | 9 |
10 var expectations = { | 10 var expectations = { |
11 'documentURI': document.location.toString(), | 11 'documentURI': document.location.toString(), |
12 'referrer': document.referrer, | 12 'referrer': document.referrer, |
13 'blockedURI': 'http://example.com/base', | 13 'blockedURI': 'http://example.com/base', |
14 'violatedDirective': 'base-uri \'self\'', | 14 'violatedDirective': 'base-uri', |
15 'effectiveDirective': 'base-uri', | 15 'effectiveDirective': 'base-uri', |
16 'originalPolicy': 'base-uri \'self\'', | 16 'originalPolicy': 'base-uri \'self\'', |
17 'sourceFile': document.location.toString(), | 17 'sourceFile': document.location.toString(), |
18 'lineNumber': 24 | 18 'lineNumber': 24 |
19 }; | 19 }; |
20 | 20 |
21 function run() { | 21 function run() { |
22 var base = document.createElement('base'); | 22 var base = document.createElement('base'); |
23 base.href = 'http://example.com/base'; | 23 base.href = 'http://example.com/base'; |
24 document.head.appendChild(base); | 24 document.head.appendChild(base); |
25 | 25 |
26 shouldBe('document.baseURI', 'document.location.href'); | 26 shouldBe('document.baseURI', 'document.location.href'); |
27 } | 27 } |
28 </script> | 28 </script> |
29 </head> | 29 </head> |
30 <body> | 30 <body> |
31 </body> | 31 </body> |
32 </html> | 32 </html> |
OLD | NEW |