tor-browser

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

keypress.html (704B)


      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="../resources/helpers.js"></script>
      8 
      9 <body>
     10 <script>
     11 promise_test(async t => {
     12  let events = [];
     13  let watcher = createRecordingCloseWatcher(t, events);
     14 
     15  window.onkeypress = e => e.preventDefault();
     16 
     17  await sendEscKey();
     18 
     19  assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
     20 }, "A keypress listener can NOT prevent the Esc keypress from being interpreted as a close request");
     21 </script>