tor-browser

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

drag_on_added_range_input.html (1221B)


      1 <!DOCTYPE html>
      2 <title>Mouse dragging on added range-input</title>
      3 <script src='/resources/testharness.js'></script>
      4 <script src='/resources/testharnessreport.js'></script>
      5 <script src='/resources/testdriver.js'></script>
      6 <script src='/resources/testdriver-actions.js'></script>
      7 <script src='/resources/testdriver-vendor.js'></script>
      8 
      9 <body>Replaced body text</body>
     10 
     11 <script>
     12 "use strict";
     13 
     14 promise_test(async t => {
     15  document.body.innerHTML = '<input type="range" min="0" max="10" value="5">';
     16  const range = document.getElementsByTagName("input")[0];
     17  assert_equals(parseInt(range.value), 5, "initial value");
     18 
     19  const x = range.getBoundingClientRect().x;
     20  const y = range.getBoundingClientRect().y;
     21  const width = range.getBoundingClientRect().width;
     22  const height = range.getBoundingClientRect().height;
     23 
     24  await new test_driver.Actions()
     25    .addPointer("pointer1", "mouse")
     26    .pointerMove(x + width / 2, y + height / 2)
     27    .pointerDown()
     28    .pointerMove(x + width - 3, y + height / 2)
     29    .pointerUp()
     30    .send();
     31 
     32  // TODO(crbug.com/469041917): Does Blink update the range input value?
     33  assert_equals(parseInt(range.value), 10, "final value");
     34 }, 'Drag on an added range input element.');
     35 </script>