Skip to content

Commit 5f26fc4

Browse files
yezhizhenjdm
authored andcommitted
allow duration 0 for testdriver-actions
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
1 parent 6a91c61 commit 5f26fc4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

resources/testdriver-actions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
*/
253253
addTick: function(duration) {
254254
this.tickIdx += 1;
255-
if (duration) {
255+
if (duration !== undefined && duration !== null) {
256256
this.pause(duration);
257257
}
258258
return this;
@@ -544,7 +544,7 @@
544544
tick = actions.addTick().tickIdx;
545545
}
546546
let moveAction = {type: "pointerMove", x, y, origin};
547-
if (duration) {
547+
if (duration !== undefined && duration !== null) {
548548
moveAction.duration = duration;
549549
}
550550
let actionProperties = setPointerProperties(moveAction, width, height, pressure,
@@ -589,7 +589,7 @@
589589
tick = actions.addTick().tickIdx;
590590
}
591591
this.actions.set(tick, {type: "scroll", x, y, deltaX, deltaY, origin});
592-
if (duration) {
592+
if (duration !== undefined && duration !== null) {
593593
this.actions.get(tick).duration = duration;
594594
}
595595
},

0 commit comments

Comments
 (0)