bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3ad0cf6c4606c5e0c94910003bdba39f681e6895

commit 3ad0cf6c4606c5e0c94910003bdba39f681e6895
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Mon Oct 21 10:34:57 2019 -0400

    tests/elm: add util functions for clicking objects/parts with event flags
    
    this is useful for synthesizing e.g., double click events
    
    Reviewed-by: Cedric BAIL <cedric.b...@free.fr>
    Differential Revision: https://phab.enlightenment.org/D10510
---
 src/tests/elementary/suite_helpers.c | 31 ++++++++++++++++++++++++++-----
 src/tests/elementary/suite_helpers.h |  3 +++
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/tests/elementary/suite_helpers.c 
b/src/tests/elementary/suite_helpers.c
index 8aebdcb3f0..9753d25bd8 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -430,23 +430,29 @@ attempt_to_find_the_right_point_for_mouse_positioning(Eo 
*obj, int dir)
 }
 
 static void
-click_object_internal(Eo *obj, int dir)
+click_object_internal(Eo *obj, int dir, int flags)
 {
    Evas *e = evas_object_evas_get(obj);
    Eina_Position2D pos = 
attempt_to_find_the_right_point_for_mouse_positioning(obj, dir);
    evas_event_feed_mouse_move(e, pos.x, pos.y, 0, NULL);
-   evas_event_feed_mouse_down(e, 1, 0, 0, NULL);
+   evas_event_feed_mouse_down(e, 1, flags, 0, NULL);
    evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
 }
 
 void
 click_object(Eo *obj)
 {
-   click_object_internal(obj, NONE);
+   click_object_internal(obj, NONE, 0);
 }
 
 void
-click_part(Eo *obj, const char *part)
+click_object_flags(Eo *obj, int flags)
+{
+   click_object_internal(obj, NONE, flags);
+}
+
+void
+click_part_flags(Eo *obj, const char *part, int flags)
 {
    Efl_Part *part_obj = efl_ref(efl_part(obj, part));
    Eo *content;
@@ -466,13 +472,19 @@ click_part(Eo *obj, const char *part)
         else if (strstr(part, "bottom"))
           dir |= BOTTOM;
      }
-   click_object_internal(content, dir);
+   click_object_internal(content, dir, flags);
    if (efl_isa(content, EFL_LAYOUT_SIGNAL_INTERFACE))
      edje_object_message_signal_process(content);
    edje_object_message_signal_process(obj);
    efl_unref(part_obj);
 }
 
+void
+click_part(Eo *obj, const char *part)
+{
+   click_part_flags(obj, part, 0);
+}
+
 static void
 wheel_object_internal(Eo *obj, int dir, Eina_Bool horiz, Eina_Bool down)
 {
@@ -546,6 +558,15 @@ click_object_at(Eo *obj, int x, int y)
    evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
 }
 
+void
+click_object_at_flags(Eo *obj, int x, int y, int flags)
+{
+   Evas *e = evas_object_evas_get(obj);
+   evas_event_feed_mouse_move(e, x, y, 0, NULL);
+   evas_event_feed_mouse_down(e, 1, flags, 0, NULL);
+   evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
+}
+
 void
 wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down)
 {
diff --git a/src/tests/elementary/suite_helpers.h 
b/src/tests/elementary/suite_helpers.h
index 928dda9637..e3b1758e37 100644
--- a/src/tests/elementary/suite_helpers.h
+++ b/src/tests/elementary/suite_helpers.h
@@ -12,8 +12,11 @@ void fail_on_errors_setup(void);
 
 void get_me_to_those_events(Eo *obj);
 void click_object(Eo *obj);
+void click_object_flags(Eo *obj, int flags);
 void click_part(Eo *obj, const char *part);
+void click_part_flags(Eo *obj, const char *part, int flags);
 void click_object_at(Eo *obj, int x, int y);
+void click_object_at_flags(Eo *obj, int x, int y, int flags);
 void wheel_object(Eo *obj, Eina_Bool horiz, Eina_Bool down);
 void wheel_part(Eo *obj, const char *part, Eina_Bool horiz, Eina_Bool down);
 void wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down);

-- 


Reply via email to