tor-browser

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

helper_dommousescroll.html (1096B)


      1 <head>
      2  <meta name="viewport" content="width=device-width; initial-scale=1.0">
      3  <title>Test that Direct Manipulation generated pan gesture events generate DOMMouseScroll events with reasonable line scroll amounts</title>
      4  <script src="apz_test_native_event_utils.js"></script>
      5  <script src="apz_test_utils.js"></script>
      6  <script src="/tests/SimpleTest/paint_listener.js"></script>
      7 </head>
      8 <body>
      9  <script type="application/javascript">
     10 async function test() {
     11  let numLines = 0;
     12  window.addEventListener("DOMMouseScroll", function (event) { numLines += event.detail; }, { passive: false });
     13  let promise = new Promise(resolve => {
     14    window.addEventListener("DOMMouseScroll", resolve, { passive: false });
     15  });
     16  await promiseApzFlushedRepaints();
     17 
     18  await synthesizeTouchpadPan(20, 100, [0,0,0], [10,100,0], {});
     19 
     20  await waitToClearOutAnyPotentialScrolls(window);
     21  await promise;
     22 
     23  info(numLines + " numLines");
     24  ok(numLines < 10, "not too many lines");
     25  ok(numLines > 0, "some lines");
     26 }
     27 
     28 waitUntilApzStable()
     29 .then(test)
     30 .then(subtestDone, subtestFailed);
     31 
     32  </script>
     33 </body>