[UTC][app-manager][Non-ACR][Add a missing testcase] 26/214126/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 6 Sep 2019 05:12:29 +0000 (14:12 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 18 Sep 2019 08:31:38 +0000 (17:31 +0900)
Adds:
 - utc_app_manager_unset_app_context_event_cb_p()

Change-Id: Ia8c077e8a0426288475e72e3fbbc96e454cb99cd
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/utc/app-manager/tct-app-manager-core_mobile.h
src/utc/app-manager/tct-app-manager-core_wearable.h
src/utc/app-manager/utc-app-manager.c

index 47f696f..dfed39d 100755 (executable)
@@ -167,6 +167,7 @@ extern int utc_app_info_is_preload_p(void);
 extern int utc_app_info_is_preload_n(void);
 extern int utc_app_multi_resolution_icon_test_p(void);
 extern int utc_app_multi_resolution_icon_test_n(void);
+extern int utc_app_manager_unset_app_context_event_cb_p(void);
 
 testcase tc_array[] = {
        {"utc_app_manager_app_context_clone_p",utc_app_manager_app_context_clone_p,utc_app_manager_startup,utc_app_manager_cleanup},
@@ -314,6 +315,7 @@ testcase tc_array[] = {
        {"utc_app_info_is_preload_n",utc_app_info_is_preload_n,utc_app_manager_startup,utc_app_manager_cleanup},
        {"utc_app_multi_resolution_icon_test_p",utc_app_multi_resolution_icon_test_p,utc_app_manager_startup,utc_app_manager_cleanup},
        {"utc_app_multi_resolution_icon_test_n",utc_app_multi_resolution_icon_test_n,utc_app_manager_startup,utc_app_manager_cleanup},
+       {"utc_app_manager_unset_app_context_event_cb_p",utc_app_manager_unset_app_context_event_cb_p,utc_app_manager_startup,utc_app_manager_cleanup},
        {NULL, NULL}
 };
 
index 47f696f..dfed39d 100755 (executable)
@@ -167,6 +167,7 @@ extern int utc_app_info_is_preload_p(void);
 extern int utc_app_info_is_preload_n(void);
 extern int utc_app_multi_resolution_icon_test_p(void);
 extern int utc_app_multi_resolution_icon_test_n(void);
+extern int utc_app_manager_unset_app_context_event_cb_p(void);
 
 testcase tc_array[] = {
        {"utc_app_manager_app_context_clone_p",utc_app_manager_app_context_clone_p,utc_app_manager_startup,utc_app_manager_cleanup},
@@ -314,6 +315,7 @@ testcase tc_array[] = {
        {"utc_app_info_is_preload_n",utc_app_info_is_preload_n,utc_app_manager_startup,utc_app_manager_cleanup},
        {"utc_app_multi_resolution_icon_test_p",utc_app_multi_resolution_icon_test_p,utc_app_manager_startup,utc_app_manager_cleanup},
        {"utc_app_multi_resolution_icon_test_n",utc_app_multi_resolution_icon_test_n,utc_app_manager_startup,utc_app_manager_cleanup},
+       {"utc_app_manager_unset_app_context_event_cb_p",utc_app_manager_unset_app_context_event_cb_p,utc_app_manager_startup,utc_app_manager_cleanup},
        {NULL, NULL}
 };
 
index ce1eba6..1369ffe 100755 (executable)
 #include <glib.h>
 #include "tct_app_common.h"
 
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "NativeTCT"
+
 #define TEST_APPID "org.tizen.helloworld"
 #define TEST_APPID2 "org.tizen.helloworld2"
 #define TEST_MULTIRES_ICON_APPID "org.tizen.multiresolutionicon"
@@ -2757,6 +2762,33 @@ int utc_app_manager_set_app_context_event_cb_n(void)
 }
 
 /**
+ * @testcase            utc_app_manager_unset_app_context_event_cb_p
+ * @since_tizen         2.4
+ * @description         Unregisters the callback function.
+ * @scenario            Calls app_manager_set_app_context_event_cb().
+ *                      And then, calls app_manager_unset_app_context_event_cb().
+ */
+int utc_app_manager_unset_app_context_event_cb_p(void)
+{
+       int ret;
+
+       /* Precondition */
+       ret = app_manager_set_app_context_event_cb(app_context_event_cb,
+                       "launched");
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG,
+                               "Failed to set app_context event callback");
+               normal_exit(1);
+               return;
+       }
+
+       /* Test */
+       app_manager_unset_app_context_event_cb();
+       normal_exit(0);
+       return 0;
+}
+
+/**
  * @testcase           utc_app_manager_event_create_p
  * @since_tizen                3.0
  * @description                Creates the app manager event handle