x_equals(target_div.scrollTop, max_target_div_scroll_top, 1,
        "target_div should be fully scrolled down");

      scrollend_promise = waitForScrollendEventNoTimeout(window);
      target_div.addEventListener("scrollend", fail);
      // Scroll up on target div and wait for the doc to get scrollend event.
      await scrollElementDown(target_div, target_div.clientHeight + 25);
      await scrollend_promise;

      target_div.removeEventListener("scrollend", fail);
      assert_greater_than(document.sc