element-removal.https.tentative.html (1024B)
1 <!DOCTYPE html> 2 <title> 3 On-going subresource loading should fail immediately when the web bundle 4 element is removed 5 </title> 6 <link 7 rel="help" 8 href="https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md" 9 /> 10 <script src="/resources/testharness.js"></script> 11 <script src="/resources/testharnessreport.js"></script> 12 <script src="../resources/test-helpers.js"></script> 13 <body> 14 <script> 15 setup(() => { 16 assert_true(HTMLScriptElement.supports("webbundle")); 17 }); 18 19 promise_test(async () => { 20 const element = createWebBundleElement( 21 "/xhr/resources/delay.py?ms=100000", 22 ["/xhr/resources/dummy"] 23 ); 24 document.body.appendChild(element); 25 const waitUntilFail = new Promise((resolve) => { 26 fetch("/xhr/resources/dummy").then(() => {}, resolve); 27 }); 28 document.body.removeChild(element); 29 await waitUntilFail; 30 }, "On-going subresource loading should fail immediately when the element is " + "removed."); 31 </script> 32 </body>