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

Side by Side Diff: LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html

Issue 850443002: Scroll Customization Prototype (Not for review, WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase / cleanup / minor bug fixes Created 5 years, 9 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
« no previous file with comments | « no previous file | LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas-throw.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>ScrollState consumeDelta</title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10
11 if (!window.internals || !window.internals.runtimeFlags.scrollCustomizationEnabl ed) {
12 console.log("These tests only work with window.internals exposed, " +
13 "and require scroll customization.");
14 done();
15 }
16
17 function deltaShouldBe(scrollState, x, y, testName) {
18 test(function() {
19 assert_equals(scrollState.deltaX, x);
20 assert_equals(scrollState.deltaY, y);
21 }, testName);
22 }
23
24 var scrollState = new ScrollState(10, -20);
25 deltaShouldBe(scrollState, 10, -20, "Unconsumed deltas");
26 scrollState.consumeDelta(2, -3);
27 deltaShouldBe(scrollState, 8, -17, "Partially consumed deltas");
28 scrollState.consumeDelta(8, -17);
29 deltaShouldBe(scrollState, 0, 0, "Fully consumed deltas");
30 </script>
31 </body>
32 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas-throw.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698