Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html b/third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a04aae6c6a801fc26665cb4bde60d0a3bbcf5106 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/events/wheel/mouse-wheel-scroll-latching.html |
| @@ -0,0 +1,75 @@ |
| +<!DOCTYPE HTML> |
| +<script src="../../../resources/js-test.js"></script> |
| +<style> |
| + |
| + ::-webkit-scrollbar { |
| + display: none; |
| + } |
| + body { |
| + margin: 0px; |
| + height: 1000px; |
| + width: 1000px; |
| + } |
| + #parent { |
| + background-color: #FF7F7F; |
| + height: 600px; |
| + width: 600px; |
| + overflow: scroll; |
| + } |
| + #content1 { |
| + height: 700px; |
| + width: 700px; |
| + } |
| + #child { |
| + background-color: #84BE6A; |
| + height: 500px; |
| + width: 500px; |
| + overflow: scroll; |
| + } |
| + #content2 { |
| + height: 600px; |
| + width: 600px; |
| + } |
| +</style> |
| + |
| +<div id="parent"> |
| + <div id="content1"> |
| + <div id="child"> |
| + <div id="content2"> |
| + </div> |
| + </div> |
| + </div> |
| +</div> |
| + |
| +<script> |
| + |
| +window.jsTestIsAsync = true; |
| + |
| +var parent = document.getElementById('parent'); |
| +var child = document.getElementById('child'); |
| + |
| +function runTest() { |
| + if (!window.chrome || !chrome.gpuBenchmarking) { |
|
tdresser
2016/08/12 13:28:32
Should we output some kind of message that the tes
sahel
2016/08/12 15:45:29
Done.
|
| + finishJSTest(); |
| + } |
| + var rect = child.getBoundingClientRect(); |
| + chrome.gpuBenchmarking.smoothScrollBy(150, function() {}, |
|
tdresser
2016/08/12 13:28:32
Can you pass null instead of an empty function?
I
sahel
2016/08/12 15:45:29
Done.
|
| + rect.left, rect.right, |
| + 2, "down", 4000); |
| + |
| + debug("The child div scrolls till the end."); |
| + shouldBecomeEqual("child.scrollTop", "100", |
| + function () { |
| + // Wait for 0.5s and then check if the parent has scrolled. |
| + setTimeout(parentDivScrollCheck, 500); |
|
tdresser
2016/08/12 13:28:32
You might not need this setTimeout if you move to
sahel
2016/08/12 15:45:29
Done.
|
| + }); |
| +} |
| + |
| +function parentDivScrollCheck() { |
| + shouldBeZero("parent.scrollTop"); |
| + finishJSTest(); |
| +} |
| + |
| +window.onload = runTest(); |
| + |
| +</script> |