Title: [222517] trunk/LayoutTests
- Revision
- 222517
- Author
- [email protected]
- Date
- 2017-09-26 13:24:19 -0700 (Tue, 26 Sep 2017)
Log Message
Add helper functions to write better selection tests
https://bugs.webkit.org/show_bug.cgi?id=177403
Reviewed by Tim Horton.
Selection tests are finicky to write, so having some more helper functions
that can assist in double checking where we think we are selecting, or where we
think words are located in helpful.
* fast/events/touch/ios/resources/ui-debugging.js: Added.
(debugDot):
(removeDebugDot):
(debugRect):
(removeDebugRect):
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (222516 => 222517)
--- trunk/LayoutTests/ChangeLog 2017-09-26 20:22:19 UTC (rev 222516)
+++ trunk/LayoutTests/ChangeLog 2017-09-26 20:24:19 UTC (rev 222517)
@@ -1,3 +1,20 @@
+2017-09-26 Megan Gardner <[email protected]>
+
+ Add helper functions to write better selection tests
+ https://bugs.webkit.org/show_bug.cgi?id=177403
+
+ Reviewed by Tim Horton.
+
+ Selection tests are finicky to write, so having some more helper functions
+ that can assist in double checking where we think we are selecting, or where we
+ think words are located in helpful.
+
+ * fast/events/touch/ios/resources/ui-debugging.js: Added.
+ (debugDot):
+ (removeDebugDot):
+ (debugRect):
+ (removeDebugRect):
+
2017-09-26 Ryan Haddad <[email protected]>
Update TestExpectations for http/tests/local/blob/send-hybrid-blob-using-open-panel.html.
Added: trunk/LayoutTests/fast/events/touch/ios/resources/ui-debugging.js (0 => 222517)
--- trunk/LayoutTests/fast/events/touch/ios/resources/ui-debugging.js (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/resources/ui-debugging.js 2017-09-26 20:24:19 UTC (rev 222517)
@@ -0,0 +1,58 @@
+// To double check location of touches or other x,y coordinates
+function debugDot(x, y, element = document.body)
+{
+ var dotSize = 10;
+ var dot = document.getElementById("debugDot");
+ if (!dot) {
+ dot = document.createElement("div");
+ dot.id = "debugDot";
+ }
+
+ dot.style.pointerEvents = "none";
+
+ dot.style.position = "absolute";
+ dot.style.height = dotSize + "px";
+ dot.style.width = dotSize + "px";
+ dot.style.backgroundColor = "DeepPink";
+ dot.style.borderRadius = "100%";
+ dot.style.left = (x - dotSize/2)+"px";
+ dot.style.top = (y - dotSize/2)+"px";
+
+ element.appendChild(dot);
+}
+
+function removeDebugDot()
+{
+ var dot = document.getElementById("debugDot");
+ if (dot.parentNode)
+ dot.parentNode.removeChild(dot);
+}
+
+// To double check location of word boxes or other x,y coordinates
+function debugRect(x, y, width, height, element = document.body)
+{
+ var rect = document.getElementById("debugRect");
+ if (!rect) {
+ rect = document.createElement("div");
+ rect.id = "debugRect";
+ }
+
+ rect.style.pointerEvents = "none";
+
+ rect.style.position = "absolute";
+ rect.style.height = height + "px";
+ rect.style.width = width + "px";
+ rect.style.backgroundColor = "rgba(255,0,255,0.5)";
+ rect.style.top = y + "px";
+ rect.style.left = x + "px";
+
+ element.appendChild(rect);
+}
+
+function removeDebugRect()
+{
+ var rect = document.getElementById("debugRect");
+ if (rect.parentNode)
+ rect.parentNode.removeChild(rect);
+}
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes