diff options
Diffstat (limited to 'testing/web-platform/tests/fetch/api/abort/destroyed-context.html')
-rw-r--r-- | testing/web-platform/tests/fetch/api/abort/destroyed-context.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/api/abort/destroyed-context.html b/testing/web-platform/tests/fetch/api/abort/destroyed-context.html new file mode 100644 index 0000000000..161d39bd9c --- /dev/null +++ b/testing/web-platform/tests/fetch/api/abort/destroyed-context.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +// This is a regression test for crbug.com/860063. +window.controller = new AbortController(); +async_test(t => { + onmessage = t.step_func(event => { + assert_equals(event.data, 'started'); + const iframe = document.querySelector('iframe'); + document.body.removeChild(iframe); + controller.abort(); + t.done(); + }); +}, 'aborting a fetch in a destroyed context should not crash'); +</script> +<iframe srcdoc=" + <!DOCTYPE html> + <meta charset=utf-8> + <script> + fetch('../resources/infinite-slow-response.py', { signal: parent.controller.signal }).then(() => { + parent.postMessage('started', '*'); + }); + </script> + "> +</iframe> |