Commit 94a3f87c authored by Mario Bianucci's avatar Mario Bianucci Committed by Commit Bot

Splitting mouse-cursor-image-set into two tests

My change should not have any impact on a .PNG case that is now failing.
While trying to figure out what is causing things to fail, split the new
SVG cases out into their own test, with the hope that this will allow
the original test to be re-enabled. Hopefully this will also have the
side-effect of fixing the SVG cases as well.

Possibly related to crbug.com/652536

Bug: 1113521
Change-Id: I885e531968dfabdaa11e4219e2b73b2cd40c7b51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354666
Commit-Queue: Mario Bianucci <mabian@microsoft.com>
Reviewed-by: default avatarOlga Gerchikov <gerchiko@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#798752}
parent b7704b43
......@@ -6728,7 +6728,6 @@ crbug.com/1113791 [ Win ] media/video-zoom.html [ Pass Failure ]
# Sheriff 2020-08-11
crbug.com/1095540 virtual/threaded-prefer-compositing/fast/scrolling/resize-corner-tracking-touch.html [ Pass Failure ]
crbug.com/1113521 [ Mac ] fast/events/mouse-cursor-image-set.html [ Pass Crash ]
crbug.com/1046784 http/tests/devtools/network/network-content-replacement-xhr.js [ Pass Failure ]
# Sheriff 2020-08-14
......
......@@ -12,82 +12,42 @@ TEST CASE: 25x25 image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 SVG image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
TEST CASE: 25x25 SVG image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
TEST CASE: 25x25 image at 1x, 30x30 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 SVG image at 1x, 30x30 SVG image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=1.5
TEST CASE: 25x25 SVG image at 1.5x, 30x30 SVG image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=1.5
TEST CASE: Invalid tiny scale with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Invalid tiny scale on SVG with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Over-large image with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Over-large SVG image with fallback to pointer
Cursor Info: type=Hand
TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
TEST CASE: 200x200 SVG image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
TEST CASE: Non-existent image in image-set with fallback to 25x25 image
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: Non-existent SVG image in image-set with fallback to 25x25 SVG image
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
Cursor Info: type=Custom hotSpot=5,3 image=25x25
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x - SVG
Cursor Info: type=Custom hotSpot=5,3 image=25x25
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - SVG - should round to nearest integer
Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
TEST CASE: Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x
Cursor Info: type=Custom hotSpot=5,4 image=25x25
......@@ -98,82 +58,42 @@ TEST CASE: 25x25 image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 SVG image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=50x50 scale=2
TEST CASE: 25x25 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
TEST CASE: 25x25 SVG image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=50x50 scale=4
TEST CASE: 25x25 image at 1x, 30x30 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=30x30 scale=2
TEST CASE: 25x25 SVG image at 1x, 30x30 SVG image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=60x60 scale=4
TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=30x30 scale=5
TEST CASE: 25x25 SVG image at 1.5x, 30x30 SVG image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=60x60 scale=10
TEST CASE: Invalid tiny scale with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Invalid tiny scale on SVG with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Over-large image with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Over-large SVG image with fallback to pointer
Cursor Info: type=Hand
TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
TEST CASE: 200x200 SVG image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=400x400 scale=8
TEST CASE: Non-existent image in image-set with fallback to 25x25 image
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: Non-existent SVG image in image-set with fallback to 25x25 SVG image
Cursor Info: type=Custom hotSpot=0,0 image=50x50 scale=2
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
Cursor Info: type=Custom hotSpot=10,6 image=30x30 scale=2
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x - SVG
Cursor Info: type=Custom hotSpot=20,12 image=60x60 scale=4
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - SVG - should round to nearest integer
Cursor Info: type=Custom hotSpot=20,8 image=60x60 scale=2.8
TEST CASE: Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x
Cursor Info: type=Custom hotSpot=28,3 image=30x30 scale=2
......
Test that mouse cursors are applied correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Checking cursors with device pixel ratio of 1
----------------------------------------------
TEST CASE: 25x25 image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
TEST CASE: 25x25 image at 1x, 30x30 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=1.5
TEST CASE: Invalid tiny scale on with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Over-large image with fallback to pointer
Cursor Info: type=Hand
TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
TEST CASE: Non-existent image in image-set with fallback to 25x25 image
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
Cursor Info: type=Custom hotSpot=5,3 image=25x25
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
Checking cursors with device pixel ratio of 2
----------------------------------------------
TEST CASE: 25x25 image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=50x50 scale=2
TEST CASE: 25x25 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=50x50 scale=4
TEST CASE: 25x25 image at 1x, 30x30 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=60x60 scale=4
TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=60x60 scale=10
TEST CASE: Invalid tiny scale on with fallback to pointer
Cursor Info: type=Hand
TEST CASE: Over-large image with fallback to pointer
Cursor Info: type=Hand
TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=400x400 scale=8
TEST CASE: Non-existent image in image-set with fallback to 25x25 image
Cursor Info: type=Custom hotSpot=0,0 image=50x50 scale=2
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
Cursor Info: type=Custom hotSpot=20,12 image=60x60 scale=4
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
Cursor Info: type=Custom hotSpot=20,8 image=60x60 scale=2.8
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="../js/resources/image-preload-helper.js"></script>
<style type="text/css">
</style>
</head>
<body>
<p id="description"></p>
<div id="test-container">
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1x), pointer'>25x25 image at 1x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 2x), pointer'>25x25 image at 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1x, url(resources/greenbox30.svg) 2x), pointer'>25x25 image at 1x, 30x30 image at 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1.5x, url(resources/greenbox30.svg) 5x), pointer'>25x25 image at 1.5x, 30x30 image at 5x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 0.0001x), pointer'>Invalid tiny scale on with fallback to pointer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox200.svg) 1x), pointer'>Over-large image with fallback to pointer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox200.svg) 4x), pointer'>200x200 image at 4x (not over-large in UI pixels)</div>
<div style='cursor: -webkit-image-set(url(doesntexist.svg) 1x), url(resources/greenbox.svg), pointer'>Non-existent image in image-set with fallback to 25x25 image</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1x, url(resources/greenbox30.svg) 2x) 5 3, pointer'>Explicit hotspot at (5,3) logical in 1x and 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 0.7x, url(resources/greenbox30.svg) 1.4x) 7 3, pointer'>Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer</div>
</div>
<br/>
<div id="console"></div>
<script>
var testContainer = document.getElementById('test-container');
function checkCursors() {
debug('Checking cursors with device pixel ratio of ' + window.devicePixelRatio);
debug('----------------------------------------------');
var nodesToTest = document.querySelectorAll('#test-container > div');
for (var i = 0; i < nodesToTest.length; i++) {
var node = nodesToTest[i];
debug('TEST CASE: ' + node.textContent);
// Make sure the node is visible and move the mouse over top of it.
document.documentElement.scrollTop = node.offsetTop - 50;
eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.documentElement.scrollTop + 3);
// Get details of the current mouse cursor.
// Note that we could return structured data which we then validate, but that's a lot more
// work and is redundant with relying on the expected output anyway. Better to just dump
// it and inspect that it matches the description.
debug('Cursor Info: ' + internals.getCurrentCursorInfo());
debug('');
}
}
function runTests() {
if (window.eventSender) {
checkCursors();
// Repeat in high-dpi mode
testRunner.setBackingScaleFactor(2, function() {
// Failed images are apparently reset on scale factor change.
loadImages([{ url: 'doesntexist.svg', error: true }],
function() {
checkCursors();
testContainer.style.display = 'none';
finishJSTest();
});
});
} else {
finishJSTest();
}
}
description("Test that mouse cursors are applied correctly.");
if (!window.eventSender) {
testFailed('This test requires DumpRenderTree');
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
window.jsTestIsAsync = true;
}
// Now wait for each image to load or fail to load before starting tests.
// Without this we can get null images in the cursors - eg. no known size.
preloadImagesFromStyle(testContainer, 4, runTests, /doesntexist/);
</script>
</script>
</body>
</html>
......@@ -11,37 +11,26 @@
<p><a href=https://bugs.webkit.org/show_bug.cgi?id=99493>Bug 99493</a></p>
<div id="test-container">
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1x), pointer'>25x25 image at 1x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1x), pointer'>25x25 SVG image at 1x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 2x), pointer'>25x25 image at 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 2x), pointer'>25x25 SVG image at 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1x, url(resources/greenbox30.png) 2x), pointer'>25x25 image at 1x, 30x30 image at 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1x, url(resources/greenbox30.svg) 2x), pointer'>25x25 SVG image at 1x, 30x30 SVG image at 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1.5x, url(resources/greenbox30.png) 5x), pointer'>25x25 image at 1.5x, 30x30 image at 5x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1.5x, url(resources/greenbox30.svg) 5x), pointer'>25x25 SVG image at 1.5x, 30x30 SVG image at 5x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 0.0001x), pointer'>Invalid tiny scale with fallback to pointer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 0.0001x), pointer'>Invalid tiny scale on SVG with fallback to pointer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox200.png) 1x), pointer'>Over-large image with fallback to pointer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox200.svg) 1x), pointer'>Over-large SVG image with fallback to pointer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox200.png) 4x), pointer'>200x200 image at 4x (not over-large in UI pixels)</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox200.svg) 4x), pointer'>200x200 SVG image at 4x (not over-large in UI pixels)</div>
<div style='cursor: -webkit-image-set(url(doesntexist.png) 1x), url(resources/greenbox.png), pointer'>Non-existent image in image-set with fallback to 25x25 image</div>
<div style='cursor: -webkit-image-set(url(doesntexist.svg) 1x), url(resources/greenbox.svg), pointer'>Non-existent SVG image in image-set with fallback to 25x25 SVG image</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1x, url(resources/greenbox30.png) 2x) 5 3, pointer'>Explicit hotspot at (5,3) logical in 1x and 2x</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 1x, url(resources/greenbox30.svg) 2x) 5 3, pointer'>Explicit hotspot at (5,3) logical in 1x and 2x - SVG</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.png) 0.7x, url(resources/greenbox30.png) 1.4x) 7 3, pointer'>Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox.svg) 0.7x, url(resources/greenbox30.svg) 1.4x) 7 3, pointer'>Explicit hotspot at (7,3) logical in 0.7x and 1.4x - SVG - should round to nearest integer</div>
<div style='cursor: -webkit-image-set(url(resources/greenbox-hotspot5-4.cur) 1x, url(resources/greenbox30-hotspot28-3.cur) 2x), pointer'>Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x</div>
</div>
<br/>
<div id="console"></div>
<script>
var imagesLeftToLoad = 0;
var testContainer = document.getElementById('test-container');
function checkCursors() {
debug('Checking cursors with device pixel ratio of ' + window.devicePixelRatio);
debug('Checking cursors with device pixel ratio of ' + window.devicePixelRatio);
debug('----------------------------------------------');
var nodesToTest = document.querySelectorAll('#test-container > div');
for (var i = 0; i < nodesToTest.length; i++) {
var node = nodesToTest[i];
......@@ -64,15 +53,14 @@ function runTests() {
checkCursors();
// Repeat in high-dpi mode
testRunner.setBackingScaleFactor(2, function() {
// Failed images are apparently reset on scale factor change.
loadImages([{ url: 'doesntexist.png', error: true },
{ url: 'doesntexist.svg', error: true }],
// Failed images are apparently reset on scale factor change.
loadImages([{ url: 'doesntexist.png', error: true }],
function() {
checkCursors();
testContainer.style.display = 'none';
finishJSTest();
});
});
});
} else {
finishJSTest();
}
......@@ -92,7 +80,7 @@ if (window.testRunner) {
// Now wait for each image to load or fail to load before starting tests.
// Without this we can get null images in the cursors - eg. no known size.
preloadImagesFromStyle(testContainer, 10, runTests, /doesntexist/);
preloadImagesFromStyle(testContainer, 6, runTests, /doesntexist/);
</script>
</body>
......
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