OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../resources/testharness.js"></script> | |
5 <script src="../resources/testharnessreport.js"></script> | |
6 </head> | |
7 <body> | |
8 <script type="text/javascript"> | |
9 if (window.testRunner) { | |
10 // Inject a subresource filter to disallow the script. | |
Mike West
2016/06/03 13:48:51
Ditto.
engedy
2016/06/06 13:36:00
Done.
| |
11 testRunner.setDisallowedSubresourcePathSuffixes(["included-script.js"]); | |
12 } | |
13 | |
14 async_test(t => { | |
15 var s = document.createElement("script"); | |
16 s.onload = t.unreached_func("The script should not load."); | |
17 s.onerror = t.step_func_done(_ => { | |
18 assert_false(!!document.scriptExecuted, "The script should not run."); | |
19 }); | |
20 s.src = "http://localhost:8000/resources/redirect.php?url=../subresource_filte r/resources/included-script.js.png&code=302"; | |
Mike West
2016/06/03 13:48:51
Nit: Drop the `..`. `/` is enough, since the `subr
engedy
2016/06/06 13:36:00
Done.
| |
21 document.body.appendChild(s); | |
22 }, "Resource disallowed after redirect."); | |
23 </script> | |
24 </body> | |
25 </html> | |
OLD | NEW |