OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script> |
| 7 if (window.testRunner) |
| 8 testRunner.overridePreference("WebKitAllowRunningInsecureContent", false
); |
| 9 |
| 10 async_test(t => { |
| 11 fetch("http://127.0.0.1:8000/xmlhttprequest/resources/access-control-all
ow-lists.php?origin=*", {method: "POST"}) |
| 12 .then(t.step_func(r => r.json())) |
| 13 .then(t.step_func_done(j => assert_equals("127.0.0.1:8000", j.host))
) |
| 14 .catch(t.unreached_func("Fetch should not be blocked.")); |
| 15 }, "Fetching 'http://127.0.0.1/' should not be blocked."); |
| 16 |
| 17 async_test(t => { |
| 18 fetch("http://example.test:8000/xmlhttprequest/resources/access-control-
allow-lists.php?origin=*", {method: "POST"}) |
| 19 .then(t.unreached_func("Fetch should be blocked.")) |
| 20 .catch(t.step_func_done(e => assert_equals(e.message, "Failed to fet
ch"))); |
| 21 }, "Fetching 'http://example.test/' should be blocked."); |
| 22 </script> |
| 23 </body> |
| 24 </html> |
OLD | NEW |