tor-browser

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

nyyyn-dialog.html (2217B)


      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  const watcher1 = createRecordingCloseWatcher(t, events, "watcher1", type);
     17  const watcher2 = await createBlessedRecordingCloseWatcher(t, events, "watcher2", type, watcher1);
     18  const watcher3 = await createBlessedRecordingCloseWatcher(t, events, "watcher3", type, watcher2);
     19  await createBlessedRecordingCloseWatcher(t, events, "watcher4", type, watcher3);
     20  createRecordingCloseWatcher(t, events, "watcher5", type);
     21 
     22  await sendCloseRequest();
     23  await waitForPotentialCloseEvent();
     24  assert_array_equals(events, ["watcher5 cancel[cancelable=false]", "watcher4 cancel[cancelable=false]", "watcher5 close", "watcher4 close"]);
     25 
     26  await sendCloseRequest();
     27  await waitForPotentialCloseEvent();
     28  assert_array_equals(events, ["watcher5 cancel[cancelable=false]", "watcher4 cancel[cancelable=false]", "watcher5 close", "watcher4 close", "watcher3 cancel[cancelable=false]", "watcher3 close"]);
     29 
     30  await sendCloseRequest();
     31  await waitForPotentialCloseEvent();
     32  assert_array_equals(events, ["watcher5 cancel[cancelable=false]", "watcher4 cancel[cancelable=false]", "watcher5 close", "watcher4 close", "watcher3 cancel[cancelable=false]", "watcher3 close", "watcher2 cancel[cancelable=false]", "watcher2 close"]);
     33 
     34  await sendCloseRequest();
     35  await waitForPotentialCloseEvent();
     36  assert_array_equals(events, ["watcher5 cancel[cancelable=false]", "watcher4 cancel[cancelable=false]", "watcher5 close", "watcher4 close", "watcher3 cancel[cancelable=false]", "watcher3 close", "watcher2 cancel[cancelable=false]", "watcher2 close", "watcher1 cancel[cancelable=false]", "watcher1 close"]);
     37 }, "Create a close watcher without user activation; create three close watchers with user activation; create a close watcher without user activation");
     38 </script>