e_test_event: add display device control dbus and method 03/191003/9
authorJunseok, Kim <juns.kim@samsung.com>
Fri, 19 Jul 2019 05:12:13 +0000 (14:12 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Fri, 26 Jul 2019 08:34:14 +0000 (17:34 +0900)
Added device control dbus and display always on/off method.
and using it when the whole test init.
(Call wait() method to prevent abnormal action)

Change-Id: I4f05ddbca47f3e99f339b921d964392f2259bf39

src/e_test_event.cpp
src/e_test_event.h
src/e_test_main.cpp

index d196be1..100629e 100644 (file)
@@ -155,6 +155,15 @@ etRunner::init()
                                  "org.enlightenment.wm.Test");
    EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.ds_proxy, EINA_FALSE);
 
+   dbus.deviced_obj = eldbus_object_get(dbus.conn,
+                                        "org.tizen.system.deviced",
+                                        "/Org/Tizen/System/DeviceD/Display");
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.deviced_obj, EINA_FALSE);
+
+   dbus.deviced_proxy = eldbus_proxy_get(dbus.deviced_obj,
+                                         "org.tizen.system.deviced.display");
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.deviced_proxy, EINA_FALSE);
+
    // reset registered window of e_test_helper
    res = resetRegisterWin();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE);
@@ -208,6 +217,8 @@ etRunner::shutdown()
      }
 
    // deinit eldbus
+   eldbus_proxy_unref(dbus.deviced_proxy);
+   eldbus_object_unref(dbus.deviced_obj);
    eldbus_proxy_unref(dbus.ds_proxy);
    eldbus_object_unref(dbus.ds_obj);
    eldbus_connection_unref(dbus.conn);
@@ -656,6 +667,32 @@ etRunner::setDpms(Eina_Bool on)
 }
 
 Eina_Bool
+etRunner::setDevctlDisplayStop(Eina_Bool on)
+{
+   Eldbus_Pending *p = NULL;
+   if (on)
+     {
+        p = eldbus_proxy_call(dbus.deviced_proxy,
+                              "stop",
+                              NULL,
+                              NULL,
+                              -1,
+                              "");
+     }
+   else
+     {
+        p = eldbus_proxy_call(dbus.deviced_proxy,
+                              "start",
+                              NULL,
+                              NULL,
+                              -1,
+                              "");
+     }
+   EINA_SAFETY_ON_NULL_RETURN_VAL(p != NULL, EINA_FALSE);
+   return EINA_TRUE;
+}
+
+Eina_Bool
 etRunner::feedMouseDown(int x, int y)
 {
    Eldbus_Pending *p = NULL;
index 4e86325..1557553 100644 (file)
@@ -24,6 +24,8 @@ private:
       dbus.conn = NULL;
       dbus.ds_proxy = NULL;
       dbus.ds_obj = NULL;
+      dbus.deviced_proxy = NULL;
+      dbus.deviced_obj = NULL;
       listWinInfo = NULL;
       output = {0,};
    };
@@ -48,6 +50,8 @@ private:
         Eldbus_Connection *conn;
         Eldbus_Proxy      *ds_proxy; // display server proxy
         Eldbus_Object     *ds_obj;   // display server obj
+        Eldbus_Proxy      *deviced_proxy; // deviced proxy
+        Eldbus_Object     *deviced_obj;   // deviced obj
      } dbus;
 
    struct tizen_policy  *tzPolicy;
@@ -139,6 +143,7 @@ public:
    Ecore_Window  getWinId(Evas_Object *elm_win);
    struct wl_surface *getWlSurface(Evas_Object *elm_win);
    Eina_Bool     setDpms(Eina_Bool on);
+   Eina_Bool     setDevctlDisplayStop(Eina_Bool on);
    Eina_Bool     feedMouseDown(int x, int y);
    Eina_Bool     feedMouseMove(int x, int y);
    Eina_Bool     feedMouseUp(int x, int y);
index ee0dca8..eac3857 100644 (file)
@@ -12,6 +12,15 @@ elm_main(int argc, char **argv)
    res = etRunner::get().init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, 1);
 
+   // display on
+   etRunner::get().setDevctlDisplayStop(EINA_TRUE);
+   etRunner::get().work(0.5);
+   etRunner::get().setDevctlDisplayStop(EINA_FALSE);
+   etRunner::get().work(0.5);
+
+   // keep display on
+   etRunner::get().setDevctlDisplayStop(EINA_TRUE);
+
    // kill Lockscreen
    etRunner::get().requestKillWinByName("LOCKSCREEN");