tor-browser

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

nynn-destroy.html (1504B)


      1 <!doctype html>
      2 <meta name=variant content="?dialog">
      3 <meta name=variant content="?CloseWatcher">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 <script src="/resources/testdriver-actions.js"></script>
      9 <script src="../resources/helpers.js"></script>
     10 
     11 <body>
     12 <script>
     13 const type = location.search.substring(1);
     14 
     15 promise_test(async t => {
     16  const events = [];
     17 
     18  const watcher1 = createRecordingCloseWatcher(t, events, "watcher1");
     19  const watcher2 = await createBlessedRecordingCloseWatcher(t, events, "watcher2", type, watcher1);
     20  createRecordingCloseWatcher(t, events, "watcher3");
     21  createRecordingCloseWatcher(t, events, "watcher4");
     22 
     23  destroyCloseWatcher(watcher2);
     24 
     25  await sendCloseRequest();
     26  await waitForPotentialCloseEvent();
     27  assert_array_equals(events, ["watcher4 cancel[cancelable=false]", "watcher4 close", "watcher3 cancel[cancelable=false]", "watcher3 close"]);
     28 
     29  await sendCloseRequest();
     30  await waitForPotentialCloseEvent();
     31  assert_array_equals(events, ["watcher4 cancel[cancelable=false]", "watcher4 close", "watcher3 cancel[cancelable=false]", "watcher3 close", "watcher1 cancel[cancelable=false]", "watcher1 close"]);
     32 }, "Create a close watcher without user activation; create a close watcher with user activation; create two close watchers without user activation; remove the second close watcher");
     33 </script>