| 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-pre.js"></scrip
t> | 5 <script src="http://localhost:8000/js-test-resources/js-test-pre.js"></scrip
t> |
| 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', | 13 'blockedURI': 'http://example.com', |
| 14 'violatedDirective': 'base-uri \'self\'', | 14 'violatedDirective': 'base-uri \'self\'', |
| 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/'; | 23 base.href = 'http://example.com/'; |
| 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 <script src="http://localhost:8000/js-test-resources/js-test-post.js"></scri
pt> | |
| 30 </head> | 29 </head> |
| 31 <body> | 30 <body> |
| 32 </body> | 31 </body> |
| 33 </html> | 32 </html> |
| OLD | NEW |