e_test_main: turn off "always on display" after test done. 23/212723/2
authorJunseok, Kim <juns.kim@samsung.com>
Mon, 26 Aug 2019 08:51:29 +0000 (17:51 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Mon, 2 Sep 2019 05:41:06 +0000 (14:41 +0900)
Change-Id: I4696bc2e265bf84c5eb4ac8ac6b6664363b8aa21

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

index a68bf75..4c9f34c 100644 (file)
@@ -667,28 +667,53 @@ etRunner::setDpms(Eina_Bool on)
 }
 
 Eina_Bool
-etRunner::setDevctlDisplayStop(Eina_Bool on)
+etRunner::setDevctlDisplayLock(Eina_Bool lock)
 {
    Eldbus_Pending *p = NULL;
-   if (on)
+
+   if (lock)
      {
         p = eldbus_proxy_call(dbus.deviced_proxy,
-                              "stop",
+                              "lockstate",
                               NULL,
                               NULL,
                               -1,
-                              "");
+                              "sssi",
+                              "lcdon",
+                              "gotostatenow",
+                              "holdkeyblock",
+                              "0");
      }
    else
      {
         p = eldbus_proxy_call(dbus.deviced_proxy,
-                              "start",
+                              "unlockstate",
                               NULL,
                               NULL,
                               -1,
-                              "");
+                              "ss",
+                              "lcdon",
+                              "resettimer");
      }
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(p != NULL, EINA_FALSE);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(p != NULL, EINA_FALSE);
+
+   return EINA_TRUE;
+}
+
+Eina_Bool
+etRunner::setDevctlDisplayOn(Eina_Bool on)
+{
+   Eldbus_Pending *p = NULL;
+
+   p = eldbus_proxy_call(dbus.deviced_proxy,
+                         "changestate",
+                         NULL,
+                         NULL,
+                         -1,
+                         "s",
+                         on? "lcdon" : "lcdoff");
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(p != NULL, EINA_FALSE);
+
    return EINA_TRUE;
 }
 
index 1557553..bf85268 100644 (file)
@@ -143,7 +143,8 @@ 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     setDevctlDisplayLock(Eina_Bool lock);
+   Eina_Bool     setDevctlDisplayOn(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 eac3857..5427136 100644 (file)
@@ -13,13 +13,12 @@ elm_main(int argc, char **argv)
    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().setDevctlDisplayOn(EINA_TRUE);
    etRunner::get().work(0.5);
 
-   // keep display on
-   etRunner::get().setDevctlDisplayStop(EINA_TRUE);
+   // display lock
+   etRunner::get().setDevctlDisplayLock(EINA_TRUE);
+   etRunner::get().work(0.5);
 
    // kill Lockscreen
    etRunner::get().requestKillWinByName("LOCKSCREEN");
@@ -27,6 +26,9 @@ elm_main(int argc, char **argv)
    ::testing::InitGoogleTest(&argc, argv);
    ret = RUN_ALL_TESTS();
 
+   // display unlock
+   etRunner::get().setDevctlDisplayLock(EINA_FALSE);
+
    etRunner::get().shutdown();
 
    return ret;