tor-browser

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

clear-site-data-cache.https.html (1421B)


      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 verify that hints were set.
      8 // Step 2 (second window) Alert first window of client hints present.
      9 // Step 3 (first window) Asserts client hints were present.
     10 // Step 4 (first window) Navigate other window to page that clears cache data.
     11 // Step 5 (second window) Navigate to a page that can check client hints still sent.
     12 // Step 6 (second window) Alert first window of client hints present.
     13 // Step 7 (first window) Asserts client hints were not present.
     14 async_test(t => {
     15    var new_window;
     16 
     17    // Step 3
     18    window.addEventListener("message", t.step_func(e => {
     19        assert_equals(e.data, "HadDeviceMemory");
     20 
     21        // Step 7
     22        window.addEventListener("message", t.step_func(e => {
     23            assert_equals(e.data, "MissingDeviceMemory");
     24            t.done();
     25        }), {once: true});
     26 
     27        // Step 4
     28        new_window.location.href = "/client-hints/clear-site-data/resources/clear-site-data.py?target=cache";
     29    }), {once: true});
     30 
     31    // Step 1
     32    new_window = window.open("/client-hints/clear-site-data/resources/check-client-hints.py");
     33    t.add_cleanup(() => new_window.close());
     34 }, "Clear-Site-Data for cache should remove all client hints.");
     35 </script>
     36 </body>
     37 </html>