5 <title>ScrollState constructor behaves correctly
</title>
6 <script src=
"../../../resources/testharness.js"></script>
7 <script src=
"../../../resources/testharnessreport.js"></script>
13 assert_true('ScrollState' in window
, "'ScrollState' in window");
14 }, "These tests only work with scroll customization enabled.");
16 if ('ScrollState' in window
) {
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.");
34 var deltaGranularity
= 148.3;
37 var inInertialPhase
= true;
38 var isBeginning
= true;
40 var scrollState
= new ScrollState(deltaX
, deltaY
, deltaGranularity
, velocityX
,
41 velocityY
, inInertialPhase
, isBeginning
, isEnding
);
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.");
55 var scrollState
= new ScrollState();
56 scrollState
.fromUserInput
= true;
57 assert_equals(scrollState
.fromUserInput
, false);
58 }, "fromUserInput is read only");