tor-browser

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

helper_bug1714934_mouseevent_buttons.html (1042B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1714934
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <meta name="viewport" content="width=device-width, initial-scale=1.0">
      9  <title>Test for Bug 1714934</title>
     10  <script src="/tests/SimpleTest/paint_listener.js"></script>
     11  <script src="/tests/SimpleTest/EventUtils.js"></script>
     12  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
     13  <script type="application/javascript" src="apz_test_utils.js"></script>
     14  <style>
     15    iframe {
     16      margin-top: 1000px;
     17    }
     18  </style>
     19 </head>
     20 <body>
     21  <script type="application/javascript">
     22 
     23 async function test() {
     24  let mousedownPromise = new Promise(resolve => {
     25    document.addEventListener("mousedown", e => {
     26      is(e.buttons, 1, "Mousedown event reports 1 button pressed")
     27      resolve();
     28    }, { once: true })
     29  });
     30  await synthesizeNativeTap(window, 100, 100);
     31  await mousedownPromise;
     32 }
     33 
     34 waitUntilApzStable()
     35 .then(test)
     36 .then(subtestDone, subtestFailed);
     37 
     38  </script>
     39 </body>
     40 </html>