tor-browser

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

window-indexed-properties-delete-no-cache.html (909B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <meta name=timeout content=long>
      4 <title>Deletion of WindowProxy's indexed properties is not cached</title>
      5 <link rel="help" href="https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-delete">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <div id=log></div>
      9 <script>
     10 const iframe = document.createElement("iframe");
     11 iframe.srcdoc = "";
     12 
     13 test(() => {
     14  assert_equals(window.length, 0);
     15  for (let i = 0; i < 1e5; i++) {
     16    assert_true(delete window[0]);
     17  }
     18 
     19  document.body.append(iframe);
     20  assert_false(delete window[0]);
     21 }, "Absence of index '0' is not cached");
     22 
     23 test(() => {
     24  assert_equals(window.length, 1);
     25  for (let i = 0; i < 1e5; i++) {
     26    assert_false(delete window[0]);
     27  }
     28 
     29  iframe.remove();
     30  assert_true(delete window[0]);
     31 }, "Presence of index '0' is not cached");
     32 </script>