tor-browser

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

ready-state-destroyed-execution-context.html (983B)


      1 <!DOCTYPE html>
      2 <meta charset=utf-8>
      3 <title>readyState is valid when the execution context is destroyed</title>
      4 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbrequest-readystate">
      5 <script src=/resources/testharness.js></script>
      6 <script src=/resources/testharnessreport.js></script>
      7 <script src=resources/support.js></script>
      8 <script>
      9 
     10 function load_iframe() {
     11    return new Promise(resolve => {
     12        const iframe = document.createElement('iframe');
     13        iframe.onload = () => { resolve(iframe); };
     14        document.documentElement.appendChild(iframe);
     15    });
     16 }
     17 
     18 promise_test(async t => {
     19    const iframe = await load_iframe();
     20    const dbname = location + '-' + t.name;
     21    const openRequest = iframe.contentWindow.indexedDB.open(dbname);
     22    assert_equals(openRequest.readyState, 'pending');
     23    iframe.remove();
     24    assert_equals(typeof openRequest.readyState, 'string');
     25 }, 'readyState accessor is valid after execution context is destroyed');
     26 
     27 </script>