| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Script element has error on bad script-src</title> |
| <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'"> |
| <script src="/js-test-resources/testharness.js"></script> |
| <script src="/js-test-resources/testharnessreport.js"></script> |
| <script> |
| window.result = false; |
| function scriptError() { |
| assert_equals(result, false, "Value should not be set"); |
| done(); |
| } |
| function scriptLoad() { |
| assert_unreached("Script loaded"); |
| done(); |
| } |
| </script> |
| </head> |
| <body> |
| <script> |
| let script = document.createElement("script"); |
| script.src = "http://localhost:8000/security/contentSecurityPolicy/resources/script-set-value.js"; |
| script.onerror = scriptError; |
| script.onload = scriptLoad; |
| document.body.appendChild(script); |
| </script> |
| </body> |
| </html> |