Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-distribute-to-scroll-chain-descendant.html

Issue 1646663002: Refactor Scroll Customization to share cc::ScrollStateData with blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linking. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>ScrollState constructor behaves correctly</title> 5 <title>ScrollState constructor behaves correctly</title>
6 <script src="../../../resources/testharness.js"></script> 6 <script src="../../../resources/testharness.js"></script>
7 <script src="../../../resources/testharnessreport.js"></script> 7 <script src="../../../resources/testharnessreport.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
(...skipping 15 matching lines...) Expand all
26 var elements = []; 26 var elements = [];
27 for (var i = 0; i < elementCount; ++i) { 27 for (var i = 0; i < elementCount; ++i) {
28 var element = document.createElement("div"); 28 var element = document.createElement("div");
29 element.creationOrder = i; 29 element.creationOrder = i;
30 element.setDistributeScroll(distributeScroll.bind(element), "disable-native-sc roll"); 30 element.setDistributeScroll(distributeScroll.bind(element), "disable-native-sc roll");
31 elements.push(element); 31 elements.push(element);
32 } 32 }
33 33
34 if ('ScrollState' in window && window.internals) { 34 if ('ScrollState' in window && window.internals) {
35 test(function() { 35 test(function() {
36 var scrollState = new ScrollState(100, 0, 0, 0, 0, false, false); 36 var scrollState = new ScrollState({deltaX: 100});
37 window.internals.setScrollChain(scrollState, elements); 37 window.internals.setScrollChain(scrollState, elements);
38 scrollState.distributeToScrollChainDescendant(); 38 scrollState.distributeToScrollChainDescendant();
39 assert_equals(0, remainingNumberOfTimesToBeCalled); 39 assert_equals(0, remainingNumberOfTimesToBeCalled);
40 for (var i = 0; i < elementCount; ++i) { 40 for (var i = 0; i < elementCount; ++i) {
41 assert_equals(elements[i].creationOrder, elements[i].calledOrder); 41 assert_equals(elements[i].creationOrder, elements[i].calledOrder);
42 } 42 }
43 }, "distributeToScrollChainDescendant propagates correctly."); 43 }, "distributeToScrollChainDescendant propagates correctly.");
44 44
45 test(function() { 45 test(function() {
46 var scrollState = new ScrollState(100, 0, 0, 0, 0, false, false); 46 var scrollState = new ScrollState({deltaX: 100});
47 window.internals.setScrollChain(scrollState, []); 47 window.internals.setScrollChain(scrollState, []);
48 assert_equals(0, remainingNumberOfTimesToBeCalled); 48 assert_equals(0, remainingNumberOfTimesToBeCalled);
49 scrollState.distributeToScrollChainDescendant(); 49 scrollState.distributeToScrollChainDescendant();
50 assert_equals(0, remainingNumberOfTimesToBeCalled); 50 assert_equals(0, remainingNumberOfTimesToBeCalled);
51 }, "distributeToScrollChainDescendant with empty scroll chain does nothing."); 51 }, "distributeToScrollChainDescendant with empty scroll chain does nothing.");
52 } 52 }
53 </script> 53 </script>
54 </body> 54 </body>
55 </html> 55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698