[UTC][app-manager][Non-ACR][Add a missing testcase] 06/213506/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 6 Sep 2019 05:12:29 +0000 (14:12 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 9 Sep 2019 11:25:08 +0000 (20:25 +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_tizeniot.h
src/utc/app-manager/tct-app-manager-core_wearable.h
src/utc/app-manager/utc-app-manager.c

index f7524f0fd31b85bcac338b5b1403ff844ea9650c..2207da613ba653d0c291f92d1ed200b5b8d30599 100755 (executable)
@@ -170,6 +170,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},
@@ -320,6 +321,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 f7524f0fd31b85bcac338b5b1403ff844ea9650c..2207da613ba653d0c291f92d1ed200b5b8d30599 100755 (executable)
@@ -170,6 +170,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},
@@ -320,6 +321,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 f7524f0fd31b85bcac338b5b1403ff844ea9650c..2207da613ba653d0c291f92d1ed200b5b8d30599 100755 (executable)
@@ -170,6 +170,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},
@@ -320,6 +321,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 b5752408c5bacfa9206bab1c1ea0f6349c9b805b..b9aa0afeb6add59dd882a6641d9745bdf1155ea9 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"
@@ -2910,6 +2915,33 @@ int utc_app_manager_set_app_context_event_cb_n(void)
        return 0;
 }
 
+/**
+ * @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