OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <title>SRI with bad options</title> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <script> |
| 9 var tests = [ |
| 10 "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?", |
| 11 "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foobar", |
| 12 "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foo=bar?", |
| 13 "sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=?foo&bar?", |
| 14 ]; |
| 15 |
| 16 var success; |
| 17 |
| 18 function addTest() { |
| 19 var next_test = tests.shift(); |
| 20 if (next_test) |
| 21 async_test(makeTest(next_test)); |
| 22 } |
| 23 |
| 24 function makeTest(integrity) { |
| 25 return function() { |
| 26 var script = document.createElement('script'); |
| 27 success = this.step_func(function() { |
| 28 assert_unreached(); |
| 29 addTest(); |
| 30 this.done(); |
| 31 }); |
| 32 var scriptError = this.step_func(function() { |
| 33 addTest(); |
| 34 this.done(); |
| 35 }); |
| 36 script.src = 'call-success.js'; |
| 37 script.onerror = scriptError; |
| 38 script.integrity = integrity; |
| 39 document.body.appendChild(script); |
| 40 }; |
| 41 } |
| 42 |
| 43 async_test(makeTest(tests.shift())); |
| 44 </script> |
| 45 </body> |
OLD | NEW |