Commit ed18472c authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Fix flaky mouse cursor change test

The image source may not get loaded immediately so the size was reported
as 0x0. Turn test into one that waits for the expected condition or
timesout.

Reland dfdb0486 with the removal of the
initial pointer type check since it varies depending on platform.

BUG=652536

Change-Id: I6f74c8db8d4f59e5e4d5c6bd6c8b20c8b107ea44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127411Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754568}
parent 3050191e
......@@ -2022,7 +2022,6 @@ crbug.com/613672 [ Mac ] virtual/threaded/synthetic_gestures/synthetic-pinch-zoo
crbug.com/613672 [ Mac ] virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchscreen-zoom-in-slow-desktop.html [ Skip ]
crbug.com/613672 [ Mac ] virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchscreen-desktop.html [ Skip ]
crbug.com/652536 fast/events/mouse-cursor-change-after-image-load.html [ Failure Pass Crash ]
crbug.com/520188 [ Win ] http/tests/local/fileapi/file-last-modified-after-delete.html [ Failure Pass ]
crbug.com/520611 [ Debug ] fast/filesystem/workers/file-writer-events-shared-worker.html [ Failure Pass ]
crbug.com/520194 http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-overridesexpires.html [ Failure Pass ]
......
......@@ -18,8 +18,6 @@ var cursorTest = async_test('Test cursor update after image loaded');
cursorTest.step(function() {
assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
assert_equals(internals.getCurrentCursorInfo(), "type=Pointer");
var target = document.getElementById('target');
var rect = target.getBoundingClientRect();
eventSender.mouseMoveTo(rect.left + 3, rect.top + 3);
......@@ -34,10 +32,8 @@ cursorTest.step(function() {
}
function testSetCursorImage(url, expectedCursorInfo, complete) {
const currentCursorInfo = internals.getCurrentCursorInfo();
target.style.cursor = `url(${url}),auto`;
waitForCondition(() => internals.getCurrentCursorInfo() != currentCursorInfo, cursorTest.step_func(() => {
assert_equals(internals.getCurrentCursorInfo(), expectedCursorInfo);
waitForCondition(() => internals.getCurrentCursorInfo() != expectedCursorInfo, cursorTest.step_func(() => {
complete();
}));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment