[ITC][app-manager][ACR-1408][Add TCs for app-manager ambient API] 72/215372/3
authorABHISHEK JAIN <j.abhishek@samsung.com>
Mon, 7 Oct 2019 11:36:00 +0000 (17:06 +0530)
committershobhit verma <shobhit.v@samsung.com>
Mon, 7 Oct 2019 11:55:30 +0000 (11:55 +0000)
Change-Id: If8f9d931c4b9d871db1198d9c379b9cc1285dc28
Signed-off-by: ABHISHEK JAIN <j.abhishek@samsung.com>
src/itc/app-manager/ITs-app-manager.c
src/itc/app-manager/tct-app-manager-native_mobile.h
src/itc/app-manager/tct-app-manager-native_tizeniot.h
src/itc/app-manager/tct-app-manager-native_wearable.h

index 2283303d78674943708a5a6d24664ed0927e43fd..c6c6b003cfcf49d50a7d80633b6697d8d65e5e4a 100755 (executable)
@@ -867,5 +867,43 @@ int ITc_app_manager_set_unset_event_cb_p(void)
        return 0;
 }
 
+/**
+  @testcase                    ITc_app_info_is_support_ambient_p
+* @author                      SRID(mohit.m)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @since_tizen                 5.5
+* @description         `       checks whether the application supports ambient mode.
+* @scenario                    Create the app info handle and get the application information in this handle \N
+*                              checks whether handle supports ambient mode \n
+*                              Destroy the handle and check for Pass/Fail
+* @apicovered                  app_manager_get_app_info, app_info_is_support_ambient,app_info_destroy
+* @passcase                    app_info_is_support_ambient returns 0
+* @failcase                    app_info_is_support_ambient returns 1
+* @precondition                        app info handle should be created
+* @postcondition               app info handle should be destroyed
+*/
+int ITc_app_info_is_support_ambient_p(void)
+{
+       START_TEST;
+
+       app_info_h hAppInfo = NULL;
+       bool bIsSupported = false;
+       int nRet = APP_MANAGER_ERROR_NONE;
+
+       nRet = app_manager_get_app_info((const char *)TEST_TESTAPPLICATION_APPID, &hAppInfo);
+       PRINT_RESULT(APP_MANAGER_ERROR_NONE, nRet, "app_manager_get_app_info", AppManagerGetError(nRet));
+       CHECK_HANDLE(hAppInfo, "app_manager_get_app_info");
+
+       //Target API
+       nRet = app_info_is_support_ambient(hAppInfo, &bIsSupported);
+       PRINT_RESULT_CLEANUP(APP_MANAGER_ERROR_NONE, nRet, "app_info_is_support_ambient", AppManagerGetError(nRet),app_info_destroy(hAppInfo));
+
+       nRet = app_info_destroy(hAppInfo);
+       PRINT_RESULT_NORETURN(APP_MANAGER_ERROR_NONE, nRet, "app_info_destroy", AppManagerGetError(nRet));
+
+       return 0;
+}
+
 /** @} */
 /** @} */
index 2c8af57ba91ab66a684155cd993e392a8d7f0d86..3fa844c087d2a37ef3d85588f0c85092fb77a048 100755 (executable)
@@ -72,6 +72,7 @@ extern int ITc_app_manager_app_context_get_package_id_p(void);
 extern int ITc_app_manager_app_context_get_app_state_p(void);
 extern int ITc_app_manager_app_context_is_sub_app_p(void);
 extern int ITc_app_manager_app_info_get_app_component_type_p(void);
+extern int ITc_app_info_is_support_ambient_p(void);
 
 testcase tc_array[] = {
        {"ITc_app_manager_request_terminate_bg_app_p",ITc_app_manager_request_terminate_bg_app_p,ITs_app_manager_startup,ITs_app_manager_cleanup},
@@ -120,6 +121,7 @@ testcase tc_array[] = {
        {"ITc_app_manager_app_context_get_app_state_p",ITc_app_manager_app_context_get_app_state_p,ITs_app_manager_context_startup,ITs_app_manager_context_cleanup},
        {"ITc_app_manager_app_context_is_sub_app_p",ITc_app_manager_app_context_is_sub_app_p,ITs_app_manager_context_startup,ITs_app_manager_context_cleanup},
        {"ITc_app_manager_app_info_get_app_component_type_p",ITc_app_manager_app_info_get_app_component_type_p,ITs_app_manager_info_startup,ITs_app_manager_info_cleanup},
+       {"ITc_app_info_is_support_ambient_p",ITc_app_info_is_support_ambient_p,ITs_app_manager_startup,ITs_app_manager_cleanup},
        {NULL, NULL}
 };
 
index 2c8af57ba91ab66a684155cd993e392a8d7f0d86..3fa844c087d2a37ef3d85588f0c85092fb77a048 100755 (executable)
@@ -72,6 +72,7 @@ extern int ITc_app_manager_app_context_get_package_id_p(void);
 extern int ITc_app_manager_app_context_get_app_state_p(void);
 extern int ITc_app_manager_app_context_is_sub_app_p(void);
 extern int ITc_app_manager_app_info_get_app_component_type_p(void);
+extern int ITc_app_info_is_support_ambient_p(void);
 
 testcase tc_array[] = {
        {"ITc_app_manager_request_terminate_bg_app_p",ITc_app_manager_request_terminate_bg_app_p,ITs_app_manager_startup,ITs_app_manager_cleanup},
@@ -120,6 +121,7 @@ testcase tc_array[] = {
        {"ITc_app_manager_app_context_get_app_state_p",ITc_app_manager_app_context_get_app_state_p,ITs_app_manager_context_startup,ITs_app_manager_context_cleanup},
        {"ITc_app_manager_app_context_is_sub_app_p",ITc_app_manager_app_context_is_sub_app_p,ITs_app_manager_context_startup,ITs_app_manager_context_cleanup},
        {"ITc_app_manager_app_info_get_app_component_type_p",ITc_app_manager_app_info_get_app_component_type_p,ITs_app_manager_info_startup,ITs_app_manager_info_cleanup},
+       {"ITc_app_info_is_support_ambient_p",ITc_app_info_is_support_ambient_p,ITs_app_manager_startup,ITs_app_manager_cleanup},
        {NULL, NULL}
 };
 
index 2c8af57ba91ab66a684155cd993e392a8d7f0d86..3fa844c087d2a37ef3d85588f0c85092fb77a048 100755 (executable)
@@ -72,6 +72,7 @@ extern int ITc_app_manager_app_context_get_package_id_p(void);
 extern int ITc_app_manager_app_context_get_app_state_p(void);
 extern int ITc_app_manager_app_context_is_sub_app_p(void);
 extern int ITc_app_manager_app_info_get_app_component_type_p(void);
+extern int ITc_app_info_is_support_ambient_p(void);
 
 testcase tc_array[] = {
        {"ITc_app_manager_request_terminate_bg_app_p",ITc_app_manager_request_terminate_bg_app_p,ITs_app_manager_startup,ITs_app_manager_cleanup},
@@ -120,6 +121,7 @@ testcase tc_array[] = {
        {"ITc_app_manager_app_context_get_app_state_p",ITc_app_manager_app_context_get_app_state_p,ITs_app_manager_context_startup,ITs_app_manager_context_cleanup},
        {"ITc_app_manager_app_context_is_sub_app_p",ITc_app_manager_app_context_is_sub_app_p,ITs_app_manager_context_startup,ITs_app_manager_context_cleanup},
        {"ITc_app_manager_app_info_get_app_component_type_p",ITc_app_manager_app_info_get_app_component_type_p,ITs_app_manager_info_startup,ITs_app_manager_info_cleanup},
+       {"ITc_app_info_is_support_ambient_p",ITc_app_info_is_support_ambient_p,ITs_app_manager_startup,ITs_app_manager_cleanup},
        {NULL, NULL}
 };