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

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

Issue 1236913004: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add to leak expectations. Created 5 years, 3 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>
11 11
12 if (!window.internals || !window.internals.runtimeFlags.scrollCustomizationEnabl ed) { 12 test(function() {
13 console.log("These tests only work with window.internals exposed, " + 13 assert_true('ScrollState' in window, "'ScrollState' in window");
14 "and require scroll customization."); 14 }, "These tests only work with scroll customization enabled.");
15 done(); 15
16 if ('ScrollState' in window) {
17 test(function() {
18 var scrollState = new ScrollState();
19 assert_equals(scrollState.deltaX, 0);
20 assert_equals(scrollState.deltaY, 0);
21 assert_equals(scrollState.deltaGranularity, 0);
22 assert_equals(scrollState.velocityX, 0);
23 assert_equals(scrollState.velocityY, 0);
24 assert_equals(scrollState.inInertialPhase, false);
25 assert_equals(scrollState.isBeginning, false);
26 assert_equals(scrollState.isEnding, false);
27 assert_equals(scrollState.fromUserInput, false);
28 assert_equals(scrollState.shouldPropagate, true);
29 }, "Empty constructor behaves correctly.");
30
31 test(function() {
32 var deltaX = 12.5;
33 var deltaY = 14.9;
34 var deltaGranularity = 148.3;
35 var velocityX = 23.7;
36 var velocityY = 2.5;
37 var inInertialPhase = true;
38 var isBeginning = true;
39 var isEnding = true;
40 var scrollState = new ScrollState(deltaX, deltaY, deltaGranularity, velocity X,
41 velocityY, inInertialPhase, isBeginning, i sEnding);
42 assert_equals(scrollState.deltaX, deltaX);
43 assert_equals(scrollState.deltaY, deltaY);
44 assert_equals(scrollState.deltaGranularity, deltaGranularity);
45 assert_equals(scrollState.velocityX, velocityX);
46 assert_equals(scrollState.velocityY, velocityY);
47 assert_equals(scrollState.inInertialPhase, inInertialPhase);
48 assert_equals(scrollState.isBeginning, isBeginning);
49 assert_equals(scrollState.isEnding, isEnding);
50 assert_equals(scrollState.fromUserInput, false);
51 assert_equals(scrollState.shouldPropagate, true);
52 }, "Constructor behaves correctly.");
53
54 test(function() {
55 var scrollState = new ScrollState();
56 scrollState.fromUserInput = true;
57 assert_equals(scrollState.fromUserInput, false);
58 }, "fromUserInput is read only");
16 } 59 }
17
18 test(function() {
19 var scrollState = new ScrollState();
20 assert_equals(scrollState.deltaX, 0);
21 assert_equals(scrollState.deltaY, 0);
22 assert_equals(scrollState.deltaGranularity, 0);
23 assert_equals(scrollState.velocityX, 0);
24 assert_equals(scrollState.velocityY, 0);
25 assert_equals(scrollState.inInertialPhase, false);
26 assert_equals(scrollState.isBeginning, false);
27 assert_equals(scrollState.isEnding, false);
28 assert_equals(scrollState.fromUserInput, false);
29 assert_equals(scrollState.shouldPropagate, true);
30 }, "Empty constructor behaves correctly.");
31
32 test(function() {
33 var deltaX = 12.5;
34 var deltaY = 14.9;
35 var deltaGranularity = 148.3;
36 var velocityX = 23.7;
37 var velocityY = 2.5;
38 var inInertialPhase = true;
39 var isBeginning = true;
40 var isEnding = true;
41 var scrollState = new ScrollState(deltaX, deltaY, deltaGranularity, velocityX,
42 velocityY, inInertialPhase, isBeginning, isEnd ing);
43 assert_equals(scrollState.deltaX, deltaX);
44 assert_equals(scrollState.deltaY, deltaY);
45 assert_equals(scrollState.deltaGranularity, deltaGranularity);
46 assert_equals(scrollState.velocityX, velocityX);
47 assert_equals(scrollState.velocityY, velocityY);
48 assert_equals(scrollState.inInertialPhase, inInertialPhase);
49 assert_equals(scrollState.isBeginning, isBeginning);
50 assert_equals(scrollState.isEnding, isEnding);
51 assert_equals(scrollState.fromUserInput, false);
52 assert_equals(scrollState.shouldPropagate, true);
53 }, "Constructor behaves correctly.");
54
55 test(function() {
56 var scrollState = new ScrollState();
57 scrollState.fromUserInput = true;
58 assert_equals(scrollState.fromUserInput, false);
59 }, "fromUserInput is read only");
60 </script> 60 </script>
61 </body> 61 </body>
62 </html> 62 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698