tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

destroyed-context.html (910B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script>
      6 // This is a regression test for crbug.com/860063.
      7 window.controller = new AbortController();
      8 async_test(t => {
      9  onmessage = t.step_func(event => {
     10    assert_equals(event.data, 'started');
     11    const iframe = document.querySelector('iframe');
     12    document.body.removeChild(iframe);
     13    controller.abort();
     14    t.done();
     15  });
     16 }, 'aborting a fetch in a destroyed context should not crash');
     17 </script>
     18 <iframe srcdoc="
     19                <!DOCTYPE html>
     20                <meta charset=utf-8>
     21                <script>
     22                fetch('../resources/infinite-slow-response.py', { signal: parent.controller.signal }).then(() => {
     23                  parent.postMessage('started', '*');
     24                });
     25                </script>
     26                ">
     27 </iframe>