Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js

Issue 197923006: Refactor touch hit-testing hover/active tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 function isBoxOfColor(givenColor)
2 {
3 return function(e, quiet)
4 {
5 var color = window.getComputedStyle(e).backgroundColor;
6 if (color == givenColor)
7 return true;
8 if (!quiet)
9 testFailed('Box had backgroundColor: ' + color);
Rick Byers 2014/03/14 17:01:02 seems like it would be a lot more understandable i
10 return false;
11 }
12 }
13
14 function elementCenter(e)
15 {
16 return {
17 x: e.offsetLeft + e.offsetWidth / 2,
18 y: e.offsetTop + e.offsetHeight / 2
19 }
20 }
21
22 // Generate methods
23 window.isBoxDefault = isBoxOfColor("rgb(0, 0, 255)");
24 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
25 window.isBoxActive = isBoxOfColor("rgb(0, 255, 0)");
26 window.isBoxHoveredAndActive = isBoxOfColor("rgb(255, 255, 0)");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698