summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-precise-deltas-dont-animate.html
blob: a71993bf54106aad8eb9e165fad870f583c5f948 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<style>

#container {
  width: 200px;
  height: 200px;
  overflow: scroll;
}

#content {
  width: 750px;
  height: 10000px;
  background-color: blue;
}

</style>
<script src="../../resources/js-test.js"></script>
<div id="container">
  <div id="content"></div>
</div>
<div id="console"></div>
<script>

jsTestIsAsync = true;
element = document.getElementById("container");

var prevScrollTop;
var scrollStart;

function runTest() {
    internals.settings.setScrollAnimatorEnabled(true);

    element.addEventListener("scroll", onElementScroll);

    testRunner.layoutAndPaintAsyncThen(function() {
        // Give the container focus.
        eventSender.mouseMoveTo(100, 100);
        eventSender.mouseScrollBy(0, -20, /* paged */ false,
            /* preciseDeltas */ true);
    });
}

function onElementScroll() {
    shouldBe("element.scrollTop",
             "800");
    finishJSTest();
}

description("Tests that overflow scrolls with precise deltas aren't animated.");

if (window.eventSender)
    runTest();
else
    debug("FAIL: This test requires window.eventSender.");

</script>