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