1 // Wait until any mouse cursor update has completed, then verify the cursor info
2 // is what's expected and call the provided continuation.
3 // We need to poll to ensure EventHandler's cursor update timer has had a chance to fire.
4 function expectCursorUpdate(expectedInfo
, completion
) {
5 // Need to give style application a chance to take effect first.
6 requestAnimationFrame(function() {
7 // Note that cursorUpdatePending should (almost?) always be true at this
8 // point, but we probably shouldn't depend on that in case scheduler changes
9 // result in rAF not firing until after the cursor update timer as already
11 var onFrame = function() {
12 if (internals
.cursorUpdatePending
) {
13 requestAnimationFrame(onFrame
);
15 shouldBeEqualToString('internals.getCurrentCursorInfo()', expectedInfo
);
19 requestAnimationFrame(onFrame
);