| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta http-equiv="Content-Security-Policy" content="script-src 'nonce-noncynonce'"> |
| <script nonce="noncynonce"> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| function done(msg) { |
| document.querySelector("pre").innerHTML = msg; |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| alert('PASS (1/2)'); |
| </script> |
| <script type="module" nonce="noncynonce noncynonce"> |
| alert('FAIL (1/3)'); |
| </script> |
| <script type="module"> |
| alert('FAIL (2/3)'); |
| </script> |
| <script type="module" nonce="noncynonceno?"> |
| alert('FAIL (3/3)'); |
| </script> |
| <script type="module" nonce=" noncynonce "> |
| alert('PASS (2/2)'); |
| done("PASS"); |
| </script> |
| </head> |
| <body> |
| <p> |
| This tests the effect of a valid script-nonce value. It passes if |
| three console warnings are visible, and the two PASS alerts are |
| executed. |
| </p> |
| <pre></pre> |
| </body> |
| </html> |