From: Daehyeon Jung Date: Tue, 1 Oct 2019 05:42:36 +0000 (+0900) Subject: [UTC][app-manager][ACR-1408][Add Ambient API tests] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=beadfa466e9991ef98720ac1c2f2a86ffe9e1c86;p=test%2Ftct%2Fnative%2Fapi.git [UTC][app-manager][ACR-1408][Add Ambient API tests] Change-Id: Icf0ba6ba1bb63e4633aacd7a712a7f95acf517ce --- diff --git a/src/utc/app-manager/public.list b/src/utc/app-manager/public.list index 93b24aea8..9fafc90eb 100755 --- a/src/utc/app-manager/public.list +++ b/src/utc/app-manager/public.list @@ -28,6 +28,7 @@ app_info_is_equal app_info_is_nodisplay app_info_is_onboot app_info_is_preload +app_info_is_support_ambient app_info_metadata_filter_add app_info_metadata_filter_create app_info_metadata_filter_destroy diff --git a/src/utc/app-manager/tct-app-manager-core_mobile.h b/src/utc/app-manager/tct-app-manager-core_mobile.h index 2207da613..493121ba7 100755 --- a/src/utc/app-manager/tct-app-manager-core_mobile.h +++ b/src/utc/app-manager/tct-app-manager-core_mobile.h @@ -168,6 +168,8 @@ extern int utc_app_info_is_onboot_p(void); extern int utc_app_info_is_onboot_n(void); extern int utc_app_info_is_preload_p(void); extern int utc_app_info_is_preload_n(void); +extern int utc_app_info_is_support_ambient_p(void); +extern int utc_app_info_is_support_ambient_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); @@ -319,6 +321,8 @@ testcase tc_array[] = { {"utc_app_info_is_onboot_n",utc_app_info_is_onboot_n,utc_app_manager_startup,utc_app_manager_cleanup}, {"utc_app_info_is_preload_p",utc_app_info_is_preload_p,utc_app_manager_startup,utc_app_manager_cleanup}, {"utc_app_info_is_preload_n",utc_app_info_is_preload_n,utc_app_manager_startup,utc_app_manager_cleanup}, + {"utc_app_info_is_support_ambient_p",utc_app_info_is_support_ambient_p,utc_app_manager_startup,utc_app_manager_cleanup}, + {"utc_app_info_is_support_ambient_n",utc_app_info_is_support_ambient_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}, diff --git a/src/utc/app-manager/tct-app-manager-core_tizeniot.h b/src/utc/app-manager/tct-app-manager-core_tizeniot.h index 2207da613..493121ba7 100755 --- a/src/utc/app-manager/tct-app-manager-core_tizeniot.h +++ b/src/utc/app-manager/tct-app-manager-core_tizeniot.h @@ -168,6 +168,8 @@ extern int utc_app_info_is_onboot_p(void); extern int utc_app_info_is_onboot_n(void); extern int utc_app_info_is_preload_p(void); extern int utc_app_info_is_preload_n(void); +extern int utc_app_info_is_support_ambient_p(void); +extern int utc_app_info_is_support_ambient_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); @@ -319,6 +321,8 @@ testcase tc_array[] = { {"utc_app_info_is_onboot_n",utc_app_info_is_onboot_n,utc_app_manager_startup,utc_app_manager_cleanup}, {"utc_app_info_is_preload_p",utc_app_info_is_preload_p,utc_app_manager_startup,utc_app_manager_cleanup}, {"utc_app_info_is_preload_n",utc_app_info_is_preload_n,utc_app_manager_startup,utc_app_manager_cleanup}, + {"utc_app_info_is_support_ambient_p",utc_app_info_is_support_ambient_p,utc_app_manager_startup,utc_app_manager_cleanup}, + {"utc_app_info_is_support_ambient_n",utc_app_info_is_support_ambient_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}, diff --git a/src/utc/app-manager/tct-app-manager-core_wearable.h b/src/utc/app-manager/tct-app-manager-core_wearable.h index 2207da613..493121ba7 100755 --- a/src/utc/app-manager/tct-app-manager-core_wearable.h +++ b/src/utc/app-manager/tct-app-manager-core_wearable.h @@ -168,6 +168,8 @@ extern int utc_app_info_is_onboot_p(void); extern int utc_app_info_is_onboot_n(void); extern int utc_app_info_is_preload_p(void); extern int utc_app_info_is_preload_n(void); +extern int utc_app_info_is_support_ambient_p(void); +extern int utc_app_info_is_support_ambient_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); @@ -319,6 +321,8 @@ testcase tc_array[] = { {"utc_app_info_is_onboot_n",utc_app_info_is_onboot_n,utc_app_manager_startup,utc_app_manager_cleanup}, {"utc_app_info_is_preload_p",utc_app_info_is_preload_p,utc_app_manager_startup,utc_app_manager_cleanup}, {"utc_app_info_is_preload_n",utc_app_info_is_preload_n,utc_app_manager_startup,utc_app_manager_cleanup}, + {"utc_app_info_is_support_ambient_p",utc_app_info_is_support_ambient_p,utc_app_manager_startup,utc_app_manager_cleanup}, + {"utc_app_info_is_support_ambient_n",utc_app_info_is_support_ambient_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}, diff --git a/src/utc/app-manager/utc-app-manager.c b/src/utc/app-manager/utc-app-manager.c index b9aa0afeb..9629d9fa1 100755 --- a/src/utc/app-manager/utc-app-manager.c +++ b/src/utc/app-manager/utc-app-manager.c @@ -3386,6 +3386,50 @@ int utc_app_info_is_preload_n(void) return 0; } +/** + * @testcase utc_app_info_is_support_ambient_p + * @since_tizen 5.5 + * @description Checks whether application is ambient supported. + * @scenario Get app_info handle for TEST_APPID and get preload value from app_info_is_preload func.\n + * Check wheter result is APP_MANAGER_ERROR_NONE. + */ +int utc_app_info_is_support_ambient_p(void) +{ + int ret = APP_MANAGER_ERROR_NONE; + app_info_h app_info = NULL; + bool ambient_supported = false; + + ret = app_manager_get_app_info(TEST_APPID, &app_info); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE); + assert_with_exit(app_info); + + ret = app_info_is_support_ambient(app_info, &ambient_supported); + app_info_destroy(app_info); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE); + normal_exit(0); + + return 0; +} + +/** + * @testcase utc_app_info_is_support_ambient_n + * @since_tizen 5.5 + * @description If there is no app_info handle, func has to return an error. + * @scenario Call app_info_is_support_ambient func with no handle.\n + * Check whether result is APP_MANAGER_ERROR_INVALID_PARAMETER. + */ +int utc_app_info_is_support_ambient_n(void) +{ + int ret = APP_MANAGER_ERROR_NONE; + bool ambient_supported = false; + + ret = app_info_is_support_ambient(NULL, &ambient_supported); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_INVALID_PARAMETER); + normal_exit(0); + + return 0; +} + /** * @testcase utc_app_multi_resolution_icon_test_p * @since_tizen 3.0