Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-boundary-behavior.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-boundary-behavior.html b/third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-boundary-behavior.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..00523b7f8e7773991d53835b7b450d29ffd25a23 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-boundary-behavior.html |
| @@ -0,0 +1,73 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<div id='space1' style='height: 300px; width: 1000px;'></div> |
| +<div id='container' style='height: 400px; width: 500px; overflow: scroll; will-change: transform'> |
| + <div id='red' style='height: 300px; width: 1000px; background-color: red; will-change: transform'></div> |
| + <div id='blue' style='height: 300px; background-color: blue; will-change: transform'></div> |
| +</div> |
| +<div id='space2' style='height: 1000px;'></div> |
| + |
| +<script> |
| +var container = document.getElementById('container'); |
| +var test = async_test('scroll-boundary-behavior-y: none should only prevent scroll propagation on y axis'); |
| +container.style.scrollBoundaryBehaviorX = 'auto'; |
| +container.style.scrollBoundaryBehaviorY = 'none'; |
| +test.step(function () { |
| + window.scrollBy(100, 100); |
| + assert_equals(window.scrollY, 100); |
| + assert_equals(window.scrollX, 100); |
| + chrome.gpuBenchmarking.smoothDrag(100, 400, 100, 500, |
|
bokan
2017/05/26 16:32:03
Please file a bug to add wheel scrolling to gpuBen
|
| + function() { |
| + assert_equals(window.scrollY, 100); |
| + chrome.gpuBenchmarking.smoothDrag(100, 400, 200, 400, |
| + function() { |
| + assert_equals(window.scrollX, 15); |
| + test_func1(); |
| + test.done(); |
| + }); |
| + }); |
| +}); |
| + |
| +function test_func1() { |
| + var test1 = async_test('scroll-boundary-behavior-x: none should only prevent scroll propagation on x axis'); |
| + container.style.scrollBoundaryBehaviorX = 'none'; |
| + container.style.scrollBoundaryBehaviorY = 'auto'; |
| + window.scrollTo(0, 0); |
| + container.scrollTo(0, 0); |
| + test1.step(function () { |
| + window.scrollBy(100, 100); |
| + assert_equals(window.scrollY, 100); |
| + assert_equals(window.scrollX, 100); |
| + chrome.gpuBenchmarking.smoothDrag(100, 400, 200, 400, |
| + function() { |
| + assert_equals(window.scrollX, 100); |
| + chrome.gpuBenchmarking.smoothDrag(100, 400, 100, 500, |
| + function() { |
| + assert_equals(window.scrollY, 15); |
| + test_func2(); |
| + test1.done(); |
| + }); |
| + }); |
| + }); |
| +} |
| + |
| +function test_func2() { |
| + var test2 = async_test('scroll-boundary-behavior should not affect scrolling inside the applied container'); |
| + container.style.scrollBoundaryBehaviorX = 'none'; |
| + container.style.scrollBoundaryBehaviorY = 'none'; |
| + window.scrollTo(0, 0); |
| + container.scrollTo(0, 0); |
| + test2.step(function () { |
| + assert_equals(container.scrollTop, 0); |
| + assert_equals(container.scrollLeft, 0); |
| + chrome.gpuBenchmarking.smoothDrag(100, 400, 0, 300, |
| + function() { |
| + assert_equals(container.scrollTop, 89); |
| + assert_equals(container.scrollLeft, 89); |
| + test2.done(); |
| + }); |
| + }); |
| +} |
| + |
| +</script> |