gfx/layers/apz/test/mochitest/helper_bug1714934_mouseevent_buttons.html
author Dana Keeler <dkeeler@mozilla.com>
Fri, 27 Jan 2023 04:07:10 +0000
changeset 650755 f75c73066b887c2379158c73c994b5ef95460238
parent 616557 918ef225713fa9fc188f42355a6cd4a2bfb3b64c
permissions -rw-r--r--
Bug 1811633 - use updated, vendored version of PKI.js, remove old version r=Gijs This also converts certDecoder.jsm to an ES module (as certDecoder.mjs) and updates all uses of it. Differential Revision: https://phabricator.services.mozilla.com/D167466

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1714934
-->
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Test for Bug 1714934</title>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <style>
    iframe {
      margin-top: 1000px;
    }
  </style>
</head>
<body>
  <script type="application/javascript">

async function test() {
  let mousedownPromise = new Promise(resolve => {
    document.addEventListener("mousedown", e => {
      is(e.buttons, 1, "Mousedown event reports 1 button pressed")
      resolve();
    }, { once: true })
  });
  await synthesizeNativeTap(window, 100, 100);
  await mousedownPromise;
}

waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);

  </script>
</body>
</html>