From: Junseok Kim Date: Thu, 13 Jun 2024 07:05:36 +0000 (+0900) Subject: e_test_event: Add method for set/unset output_resolution X-Git-Tag: accepted/tizen/unified/20240727.112808~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ff7c2d7932b7bad7397bdcf477f1ad0c0d5351e;p=platform%2Fcore%2Fuifw%2Fe-tizen-testcase.git e_test_event: Add method for set/unset output_resolution Change-Id: Ifd228a7c582f3515159be63207cf6810679e05fd --- diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 4c362e8..3de9977 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -107,6 +107,7 @@ static void _cb_method_set_tc_start_end(void *data, const Eldbus_Message *msg, E static void _cb_method_set_tc_timeout(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); static void _cb_method_transient_for_below(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); static void _cb_method_aux_hint_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); +static void _cb_method_configured_output_resolution(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); /* callbacks - signal */ static void _cb_signal_vis_changed(void *data, const Eldbus_Message *msg); @@ -415,6 +416,92 @@ etRunner::requestKillWinByName(const char *name) return EINA_TRUE; } +Eina_Bool +etRunner::setConfiguredOutputResolution(int width, int height) +{ + Eldbus_Pending *p = NULL; + int coutres_set = EINA_FALSE; + + EINA_SAFETY_ON_TRUE_RETURN_VAL(width == 0, EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(height == 0, EINA_FALSE); + + p = eldbus_proxy_call(dbus.ds_proxy, + "SetConfiguredOutputResolution", + _cb_method_configured_output_resolution, + &coutres_set, + -1, + "iii", + 1, width, height); + EINA_SAFETY_ON_NULL_RETURN_VAL(p, EINA_FALSE); + + work(); + + return !!coutres_set; +} + +Eina_Bool +etRunner::unsetConfiguredOutputResolution() +{ + Eldbus_Pending *p = NULL; + int coutres_set = EINA_FALSE; + + p = eldbus_proxy_call(dbus.ds_proxy, + "SetConfiguredOutputResolution", + _cb_method_configured_output_resolution, + &coutres_set, + -1, + "iii", + 0, 0, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(p, EINA_FALSE); + + work(); + + return !!coutres_set; +} + +Eina_Bool +etRunner::setBaseOutputResolution(pid_t pid, int width, int height) +{ + Eldbus_Pending *p = NULL; + int coutres_set = EINA_FALSE; + + EINA_SAFETY_ON_TRUE_RETURN_VAL(width == 0, EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(height == 0, EINA_FALSE); + + p = eldbus_proxy_call(dbus.ds_proxy, + "SetBasedOutputResolution", + _cb_method_configured_output_resolution, + &coutres_set, + -1, + "iiii", + pid, 1, width, height); + EINA_SAFETY_ON_NULL_RETURN_VAL(p, EINA_FALSE); + + work(); + + return !!coutres_set; +} + +Eina_Bool +etRunner::unsetBaseOutputResolution(pid_t pid) +{ + Eldbus_Pending *p = NULL; + int coutres_set = EINA_FALSE; + + p = eldbus_proxy_call(dbus.ds_proxy, + "SetBasedOutputResolution", + _cb_method_configured_output_resolution, + &coutres_set, + -1, + "iiii", + pid, 0, 0, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(p, EINA_FALSE); + + work(); + + return !!coutres_set; +} + Eina_Bool etRunner::setWinIconic(etWin *tw, Eina_Bool set) @@ -2093,6 +2180,31 @@ finish: etRunner::get().finishWork(); } +static void +_cb_method_configured_output_resolution(void *data, + const Eldbus_Message *msg, + Eldbus_Pending *p) +{ + const char *name = NULL, *text = NULL; + Eina_Bool res = EINA_FALSE; + int *set_coutres = (int *)data; + + *set_coutres = 0; + + res = eldbus_message_error_get(msg, &name, &text); + EINA_SAFETY_ON_TRUE_GOTO(res, finish); + + res = eldbus_message_arguments_get(msg, "i", set_coutres); + +finish: + if ((name) || (text)) + { + ERR("errname: %s errmsg: %s\n", name, text); + } + + etRunner::get().finishWork(); +} + /* callbacks - signal */ static void _cb_signal_vis_changed(void *data, diff --git a/src/e_test_event.h b/src/e_test_event.h index 3894755..9771410 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -330,6 +330,10 @@ public: std::shared_ptr getAuxHint(etWin *tw, const char *hint); std::shared_ptr waitEvent(etWin *win, E_TC_Event_Type ev_type); Eina_Bool requestKillWinByName(const char *name); + Eina_Bool setConfiguredOutputResolution(int width, int height); + Eina_Bool unsetConfiguredOutputResolution(); + Eina_Bool setBaseOutputResolution(pid_t pid, int width, int height); + Eina_Bool unsetBaseOutputResolution(pid_t pid); void flushEventQueue(); Eina_Bool insertEventQueue(std::shared_ptr item);