ecore_evas_focus: remove wayland dependency 56/238056/2
authorYeongjong Lee <yj34.lee@samsung.com>
Wed, 8 Jul 2020 03:44:45 +0000 (12:44 +0900)
committerYeongjong Lee <yj34.lee@samsung.com>
Wed, 8 Jul 2020 04:32:51 +0000 (13:32 +0900)
Changing visibility of Ecore_Evas does not ensure that Ecore_Evas focus is
changed. previous test case was working with 'wl_keyboard_listener' from wayland
even if it is not to test wayland listener.
To avoid failure caused by wl_xxx_listener that should be handled on wayland, it
changes the focus explicitly instead of using ecore_evas_show for another Ecore_Evas.

Change-Id: I6298e06dd3c73f6ee2fc19b60cb241e568b23801

TC/ecore/ecore_evas/utc_ecore_evas_callback_focus_out_set.c

index f77730a42e95efcbbe4aef8436022ab35426bf3c..a5fa3c28f5d110c70d0108088243c3c2c93aa7a8 100644 (file)
@@ -6,7 +6,7 @@
 #include "../utc_ecore_common.h"
 
 #include "../../utc_negative_unitest.h"
-static Ecore_Evas *ee1 = NULL, *ee2 = NULL;
+static Ecore_Evas *ee1 = NULL;
 
 static Eina_Bool startup_status = EINA_FALSE;
 static int callback_counter = 0;
@@ -52,8 +52,7 @@ setup(void)
      }
    else
      {
-        ee2 = ecore_evas_new(NULL, 0, 0, 200, 200, NULL);
-        startup_status = ((ee2 == NULL) ? EINA_FALSE : EINA_TRUE);
+        startup_status = EINA_TRUE;
      }
 }
 
@@ -69,10 +68,6 @@ teardown(void)
      {
         ecore_evas_free(ee1);
      }
-   if (ee2 != NULL)
-     {
-        ecore_evas_free(ee2);
-     }
    ecore_evas_shutdown();
 }
 
@@ -86,11 +81,8 @@ teardown(void)
  * @procedure
  * @step 1 Initialize callback_counter to 0.
  * @step 2 Set focus-out event callback for first Ecore_Evas object (ee1).
- * @step 3 Call ecore_evas_show() and ecore_evas_focus_set() with EINA_TRUE for first Ecore_Evas object (ee1).
- * @step 4 Call ecore_evas_show() and ecore_evas_focus_set() with EINA_TRUE for second Ecore_Evas object (ee2).
- * @step 5 Set timer for preschedule termination of main loop if tested callback wasn't executed.
- * @step 6 Start of main loop and wait for tested callback executing.
- * @step 7 Check value of static variable named callback_counter. If this variable is more or equal to 1, that callback was executed, and this is well. In other cases we watch error.
+ * @step 3 Call ecore_evas_show() and ecore_evas_focus_set() with EINA_FALSE for first Ecore_Evas object (ee1).
+ * @step 4 Check value of static variable named callback_counter. If this variable is more or equal to 1, that callback was executed, and this is well. In other cases we watch error.
  *
  * @passcondition
  * The callback_counter variable must be more or equal 1, and there is no segmentation fault.
@@ -105,7 +97,6 @@ START_TEST(utc_ecore_evas_callback_focus_out_set_p)
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed (startup was been executed unsuccessfully)..", __FILE__,__LINE__);
      }
    Evas_Object *bg1;
-   Evas_Object *bg2;
    callback_counter = 0;
 
    ecore_evas_callback_focus_out_set(ee1, callback_function);
@@ -118,29 +109,7 @@ START_TEST(utc_ecore_evas_callback_focus_out_set_p)
    evas_object_show(bg1);
 
    ecore_evas_focus_set(ee1, EINA_TRUE);
-
-   timer = ecore_timer_add(5.0, _quit_timer_cb, NULL);
-   if (timer == NULL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed (timer cannot be created for testing)..", __FILE__, __LINE__);
-     }
-   ecore_main_loop_begin();
-
-   ecore_evas_show(ee2);
-
-   bg2 = evas_object_rectangle_add(ecore_evas_get(ee2));
-   evas_object_color_set(bg2, 128, 255, 0, 255);
-   evas_object_resize(bg2, 9999, 9999);
-   evas_object_show(bg2);
-
-   ecore_evas_focus_set(ee2, EINA_TRUE);
-
-   timer = ecore_timer_add(5.0, _quit_timer_cb, NULL);
-   if (timer == NULL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed (timer cannot be created for testing)..", __FILE__, __LINE__);
-     }
-   ecore_main_loop_begin();
+   ecore_evas_focus_set(ee1, EINA_FALSE);
 
    if (callback_counter < 1)
      {