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

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

Issue 1209183004: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address skobes' nits. Created 5 years, 5 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
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
index ec328003a093aec3ab6c97680eb0ffc6811ce9e5..f37b597e89b3dc0ffa2dfa339d26f8ba18f95177 100644
--- a/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html
+++ b/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html
@@ -8,12 +8,6 @@
<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);
@@ -21,12 +15,18 @@ function deltaShouldBe(scrollState, x, y, testName) {
}, 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");
+test(function() {
+ assert_true('ScrollState' in window, "'ScrollState' in window");
+}, "These tests only work with scroll customization enabled.");
+
+if ('ScrollState' in window) {
+ 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>

Powered by Google App Engine
This is Rietveld 408576698