Chromium Code Reviews| Index: LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js |
| diff --git a/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js b/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c30ed980a4fb85b9cf21c0aca1a7a4c907725d93 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js |
| @@ -0,0 +1,26 @@ |
| +function isBoxOfColor(givenColor) |
| +{ |
| + return function(e, quiet) |
| + { |
| + var color = window.getComputedStyle(e).backgroundColor; |
| + if (color == givenColor) |
| + return true; |
| + if (!quiet) |
| + testFailed('Box had backgroundColor: ' + color); |
|
Rick Byers
2014/03/14 17:01:02
seems like it would be a lot more understandable i
|
| + return false; |
| + } |
| +} |
| + |
| +function elementCenter(e) |
| +{ |
| + return { |
| + x: e.offsetLeft + e.offsetWidth / 2, |
| + y: e.offsetTop + e.offsetHeight / 2 |
| + } |
| +} |
| + |
| +// Generate methods |
| +window.isBoxDefault = isBoxOfColor("rgb(0, 0, 255)"); |
| +window.isBoxHovered = isBoxOfColor("rgb(255, 0, 0)"); |
|
Rick Byers
2014/03/14 17:01:02
the name of this function and that below is a litt
|
| +window.isBoxActive = isBoxOfColor("rgb(0, 255, 0)"); |
| +window.isBoxHoveredAndActive = isBoxOfColor("rgb(255, 255, 0)"); |