summaryrefslogtreecommitdiffstats
path: root/layout/generic/test/selection_cross_shadow_boundary_helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'layout/generic/test/selection_cross_shadow_boundary_helper.js')
-rw-r--r--layout/generic/test/selection_cross_shadow_boundary_helper.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/layout/generic/test/selection_cross_shadow_boundary_helper.js b/layout/generic/test/selection_cross_shadow_boundary_helper.js
new file mode 100644
index 0000000000..b2a596a27f
--- /dev/null
+++ b/layout/generic/test/selection_cross_shadow_boundary_helper.js
@@ -0,0 +1,28 @@
+// Helper file for test_selection_cross_shadow_boundary_* related tests
+
+function drag(
+ fromTarget,
+ fromX,
+ fromY,
+ toTarget,
+ toX,
+ toY,
+ withAccelKey = false
+) {
+ synthesizeMouse(fromTarget, fromX, fromY, {
+ type: "mousemove",
+ accelKey: withAccelKey,
+ });
+ synthesizeMouse(fromTarget, fromX, fromY, {
+ type: "mousedown",
+ accelKey: withAccelKey,
+ });
+ synthesizeMouse(toTarget, toX, toY, {
+ type: "mousemove",
+ accelKey: withAccelKey,
+ });
+ synthesizeMouse(toTarget, toX, toY, {
+ type: "mouseup",
+ accelKey: withAccelKey,
+ });
+}