Skip to content

Commit

Permalink
Do mousemove timing in javascript, rather than in java. This is getti…
Browse files Browse the repository at this point in the history
…ng intermittent failures on Tree_dnd.html but I think I can resolve them after the next checkin, where I monitor events on the document to tell when java robot actually executes each command. Refs #15590 !strict.

git-svn-id: http://svn.dojotoolkit.org/src/dojo/trunk@29202 560b804f-0ae3-0310-86f3-f6aa0a117693
  • Loading branch information
wkeese committed Jul 13, 2012
1 parent afecf8e commit 0eb6042
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,24 @@ lang.mixin(robot, {
// y offset relative to the node, in pixels, to move the mouse. The default is half the node's height.

robot._assertRobot();
duration = duration||100;

// Schedule an action to scroll the node into view, then calculate it's center point
var point = {};
this.sequence(function(){
node=robot._resolveNode(node);
node = robot._resolveNode(node);
robot._scrollIntoView(node);
var pos = robot._position(node);
if(offsetY === undefined){
offsetX = pos.w/2;
offsetY = pos.h/2;
}
var x = pos.x+offsetX;
var y = pos.y+offsetY;
robot._mouseMove(x, y, false, duration);
}, delay, duration);
point.x = pos.x+offsetX;
point.y = pos.y+offsetY;
}, delay);

// Schedule a bunch of actions to move the mouse from the current position to point.
// These actions won't run until after the above callback.
this.mouseMoveTo(point, 0, duration, false);
}
});

Expand Down

0 comments on commit 0eb6042

Please sign in to comment.