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

Unified Diff: LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-basic.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: Clean up static map. 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-basic.html
diff --git a/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-basic.html b/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-basic.html
index 6fe3caf1c67bc107ad7bd3e946e0beddc4442158..ad320eb03746887c8cea25c667d7befe9c39e292 100644
--- a/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-basic.html
+++ b/LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-basic.html
@@ -9,54 +9,54 @@
<body>
<script>
-if (!window.internals || !window.internals.runtimeFlags.scrollCustomizationEnabled) {
- console.log("These tests only work with window.internals exposed, " +
- "and require scroll customization.");
- done();
-}
-
test(function() {
- var scrollState = new ScrollState();
- assert_equals(scrollState.deltaX, 0);
- assert_equals(scrollState.deltaY, 0);
- assert_equals(scrollState.deltaGranularity, 0);
- assert_equals(scrollState.velocityX, 0);
- assert_equals(scrollState.velocityY, 0);
- assert_equals(scrollState.inInertialPhase, false);
- assert_equals(scrollState.isBeginning, false);
- assert_equals(scrollState.isEnding, false);
- assert_equals(scrollState.fromUserInput, false);
- assert_equals(scrollState.shouldPropagate, true);
-}, "Empty constructor behaves correctly.");
+ assert_true('ScrollState' in window, "'ScrollState' in window");
+}, "These tests only work with scroll customization enabled.");
-test(function() {
- var deltaX = 12.5;
- var deltaY = 14.9;
- var deltaGranularity = 148.3;
- var velocityX = 23.7;
- var velocityY = 2.5;
- var inInertialPhase = true;
- var isBeginning = true;
- var isEnding = true;
- var scrollState = new ScrollState(deltaX, deltaY, deltaGranularity, velocityX,
- velocityY, inInertialPhase, isBeginning, isEnding);
- assert_equals(scrollState.deltaX, deltaX);
- assert_equals(scrollState.deltaY, deltaY);
- assert_equals(scrollState.deltaGranularity, deltaGranularity);
- assert_equals(scrollState.velocityX, velocityX);
- assert_equals(scrollState.velocityY, velocityY);
- assert_equals(scrollState.inInertialPhase, inInertialPhase);
- assert_equals(scrollState.isBeginning, isBeginning);
- assert_equals(scrollState.isEnding, isEnding);
- assert_equals(scrollState.fromUserInput, false);
- assert_equals(scrollState.shouldPropagate, true);
-}, "Constructor behaves correctly.");
+if ('ScrollState' in window) {
+ test(function() {
+ var scrollState = new ScrollState();
+ assert_equals(scrollState.deltaX, 0);
+ assert_equals(scrollState.deltaY, 0);
+ assert_equals(scrollState.deltaGranularity, 0);
+ assert_equals(scrollState.velocityX, 0);
+ assert_equals(scrollState.velocityY, 0);
+ assert_equals(scrollState.inInertialPhase, false);
+ assert_equals(scrollState.isBeginning, false);
+ assert_equals(scrollState.isEnding, false);
+ assert_equals(scrollState.fromUserInput, false);
+ assert_equals(scrollState.shouldPropagate, true);
+ }, "Empty constructor behaves correctly.");
-test(function() {
- var scrollState = new ScrollState();
- scrollState.fromUserInput = true;
- assert_equals(scrollState.fromUserInput, false);
-}, "fromUserInput is read only");
+ test(function() {
+ var deltaX = 12.5;
+ var deltaY = 14.9;
+ var deltaGranularity = 148.3;
+ var velocityX = 23.7;
+ var velocityY = 2.5;
+ var inInertialPhase = true;
+ var isBeginning = true;
+ var isEnding = true;
+ var scrollState = new ScrollState(deltaX, deltaY, deltaGranularity, velocityX,
+ velocityY, inInertialPhase, isBeginning, isEnding);
+ assert_equals(scrollState.deltaX, deltaX);
+ assert_equals(scrollState.deltaY, deltaY);
+ assert_equals(scrollState.deltaGranularity, deltaGranularity);
+ assert_equals(scrollState.velocityX, velocityX);
+ assert_equals(scrollState.velocityY, velocityY);
+ assert_equals(scrollState.inInertialPhase, inInertialPhase);
+ assert_equals(scrollState.isBeginning, isBeginning);
+ assert_equals(scrollState.isEnding, isEnding);
+ assert_equals(scrollState.fromUserInput, false);
+ assert_equals(scrollState.shouldPropagate, true);
+ }, "Constructor behaves correctly.");
+
+ test(function() {
+ var scrollState = new ScrollState();
+ scrollState.fromUserInput = true;
+ assert_equals(scrollState.fromUserInput, false);
+ }, "fromUserInput is read only");
+}
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698