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

Unified 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, 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html
diff --git a/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html b/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html
new file mode 100644
index 0000000000000000000000000000000000000000..ec328003a093aec3ab6c97680eb0ffc6811ce9e5
--- /dev/null
+++ b/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>ScrollState consumeDelta</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+
+if (!window.internals || !window.internals.runtimeFlags.scrollCustomizationEnabled) {
+ console.log("These tests only work with window.internals exposed, " +
+ "and require scroll customization.");
+ done();
+}
+
+function deltaShouldBe(scrollState, x, y, testName) {
+ test(function() {
+ assert_equals(scrollState.deltaX, x);
+ assert_equals(scrollState.deltaY, y);
+ }, testName);
+}
+
+var scrollState = new ScrollState(10, -20);
+deltaShouldBe(scrollState, 10, -20, "Unconsumed deltas");
+scrollState.consumeDelta(2, -3);
+deltaShouldBe(scrollState, 8, -17, "Partially consumed deltas");
+scrollState.consumeDelta(8, -17);
+deltaShouldBe(scrollState, 0, 0, "Fully consumed deltas");
+</script>
+</body>
+</html>
« 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