tor-browser

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

nyyn-dialog.html (1758B)


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