chromium/third_party/blink/web_tests/fast/events/touch/gesture/touch-gesture-noscroll-div.html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<script src="../../../../resources/testharness.js"></script>
<script src="../../../../resources/testharnessreport.js"></script>
<script src="../../../../resources/gesture-util.js"></script>
<style type="text/css">
#touchtarget {
  width: 100px;
  height: 100px;
  background: white;
  overflow:hidden;
}

::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

#greenbox {
  width: 100px;
  height: 100px;
  background: green;
  padding: 0px;
  margin: 0px;
}

#redbox {
  width: 100px;
  height: 100px;
  background: red;
  padding: 0px;
  margin: 0px;
}

td {
  padding: 0px;
}
</style>
<body style="margin:0">
<div id="touchtarget">
  <table border="0" cellspacing="0px" id="tablefoo">
    <tr>
      <td><div id="redbox"></div></td>
      <td><div id="greenbox"></div></td>
    </tr>
    <tr>
      <td><div id="greenbox"></div></td>
      <td><div id="greenbox"></div></td>
    </tr>
  </table>
</div>
</body>

<script type="text/javascript">
var movingdiv = document.getElementById('touchtarget');
var expectedGesturesTotal = 2;
var gesturesOccurred = 0;
var scrollAmountX = [0, 0];
var scrollAmountY = [0, 0];
var scrollEventsOccurred = 0;
var expectedScrollEventsOccurred = 0;
var scrolledElement = movingdiv;

var x = 95;
var y = 12;
function firstGestureScroll() {
  return smoothScroll(90, x, y, GestureSourceType.TOUCH_INPUT, "right",
      SPEED_INSTANT);
}

function secondGestureScroll() {
  y = 97;
  return smoothScroll(95, x, y, GestureSourceType.TOUCH_INPUT, "down",
      SPEED_INSTANT);
}

promise_test (async () => {
  movingdiv.addEventListener("scroll", recordScroll);

  await firstGestureScroll();
  await conditionHolds(() => { return notScrolled(); });
  await secondGestureScroll();
  await conditionHolds(() => { return notScrolled(); });
  assert_equals(scrollEventsOccurred, expectedScrollEventsOccurred);
}, 'This tests that a non-scrollable div cannot be scrolled with touch.');
</script>