tor-browser

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

set-cookie-before-clear-cookies.https.html (849B)


      1 <!DOCTYPE html>
      2 <body>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script>
      6 // Here's the set-up for this test:
      7 // Step 1 (first window) Open new window to try setting cookie and clearing site data.
      8 // Step 2 (second window) Message first window with cookies present after load.
      9 // Step 3 (first window) Asserts cookies not present.
     10 async_test(t => {
     11    // Step 3
     12    window.addEventListener("message", t.step_func(e => {
     13        assert_equals(e.data, "");
     14        t.done();
     15    }), {once: true});
     16 
     17    // Step 1
     18    new_window = window.open("/clear-site-data/support/clear-site-data-cookie.py?location=before&target=cookies");
     19    t.add_cleanup(new_window.close);
     20 }, "Setting a cookie before Clear-Site-Data for cookies shouldn't allow the cookie to take.");
     21 </script>
     22 </body>
     23 </html>