From: ABHISHEK JAIN Date: Mon, 6 Apr 2020 13:25:00 +0000 (+0530) Subject: [ITC][notification-ex][ACR-1479][Added TC and enums for APIs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bfc517fde80691c7a5dd864fe831d08b7097c00;p=test%2Ftct%2Fnative%2Fapi.git [ITC][notification-ex][ACR-1479][Added TC and enums for APIs] Change-Id: I90e7ab42944c579966b33d2bc6b1003d65d3b381 Signed-off-by: ABHISHEK JAIN --- diff --git a/src/itc/notification/ITs-notification-ex.c b/src/itc/notification/ITs-notification-ex.c index 338bfd3c8..bdca8a5f6 100755 --- a/src/itc/notification/ITs-notification-ex.c +++ b/src/itc/notification/ITs-notification-ex.c @@ -1190,7 +1190,8 @@ int ITc_noti_ex_item_chat_message_create_p(void) noti_ex_item_chat_message_type_e eChatMsgType[] = { NOTI_EX_ITEM_CHAT_MESSAGE_TYPE_USER, - NOTI_EX_ITEM_CHAT_MESSAGE_TYPE_SENDER + NOTI_EX_ITEM_CHAT_MESSAGE_TYPE_SENDER, + NOTI_EX_ITEM_CHAT_MESSAGE_TYPE_NONE }; int nEnumSize = sizeof(eChatMsgType) / sizeof(eChatMsgType[0]); @@ -2642,7 +2643,8 @@ int ITc_noti_ex_item_set_get_policy_p(void) { NOTI_EX_ITEM_POLICY_NONE, NOTI_EX_ITEM_POLICY_ON_BOOT_CLEAR, - NOTI_EX_ITEM_POLICY_SIM_MODE + NOTI_EX_ITEM_POLICY_SIM_MODE, + NOTI_EX_ITEM_POLICY_DISABLE_AUTO_DELETE }; nRet = CreateButton(); @@ -6849,5 +6851,66 @@ int ITc_noti_ex_item_checkbox_set_get_check_state_p(void) return 0; } +//& type : auto +//& purpose: Sets and gets extenasion data for notification_ex item. +/** +* @testcase ITc_noti_ex_item_set_get_extension_data_p +* @since_tizen 5.5 +* @author SRID(j.abhishek) +* @reviewer SRID(shobhit.v) +* @type auto +* @description Sets and gets extenasion data for notification_ex item. +* @scenario Creates the notification_ex text item and create bundle value.\n +* Set items extension, Get it again with the same key and check for Pass/Fail. +* @apicovered noti_ex_item_set_extension_data, noti_ex_item_get_extension_data +* @passcase noti_ex_item_set_extension_data, noti_ex_item_get_extension_data are successful and return correct value +* @failcase noti_ex_item_set_extension_data, noti_ex_item_get_extension_data failed. +* @precondition NA +* @postcondition free bundle and Destroy handle. +*/ +int ITc_noti_ex_item_set_get_extension_data_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + noti_ex_item_h hItemText = NULL; + + const char *pszTextID = "text_id"; + const char *pszTextTitle = "textTitle"; + const char *pszTextHyperLink = "testHyperLink"; + const char *pszKey = "TEST_KEY"; + const char *pszVal = "TEST_VALUE"; + const char *pszExtKey = "key"; + + nRet = noti_ex_item_text_create(&hItemText, pszTextID, pszTextTitle, pszTextHyperLink); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemText, "noti_ex_item_text_create"); + + bundle *retBundleVal = NULL; + bundle *BundleVal = NULL; + + BundleVal = bundle_create(); + CHECK_HANDLE_CLEANUP(BundleVal, "bundle_create", noti_ex_item_destroy(hItemText)); + + nRet = bundle_add_str(BundleVal, pszKey, pszVal); + PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRet, "bundle_add_str", NotificationExGetError(nRet), bundle_free(BundleVal);noti_ex_item_destroy(hItemText)); + + //Target API + nRet = noti_ex_item_set_extension_data(hItemText, pszExtKey, BundleVal); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_set_extension_data", NotificationExGetError(nRet), bundle_free(BundleVal);noti_ex_item_destroy(hItemText)); + bundle_free(BundleVal); + + //Target API + nRet = noti_ex_item_get_extension_data(hItemText, pszExtKey, &retBundleVal); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_extension_data", NotificationExGetError(nRet), bundle_free(retBundleVal);noti_ex_item_destroy(hItemText)); + CHECK_HANDLE_CLEANUP(retBundleVal, "noti_ex_item_get_extension_data", noti_ex_item_destroy(hItemText); bundle_free(retBundleVal)); + bundle_free(retBundleVal); + + nRet = noti_ex_item_destroy(hItemText); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + /** @} */ //end of itc-notification-ex /** @} */ //end of itc-notification-testcases diff --git a/src/itc/notification/tct-notification-native_mobile.h b/src/itc/notification/tct-notification-native_mobile.h index 1669f44a2..798afe6a0 100755 --- a/src/itc/notification/tct-notification-native_mobile.h +++ b/src/itc/notification/tct-notification-native_mobile.h @@ -177,6 +177,7 @@ extern int ITc_noti_ex_item_text_set_multi_language_p(void); extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void); extern int ITc_noti_ex_item_entry_set_multi_language_p(void); extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void); +extern int ITc_noti_ex_item_set_get_extension_data_p(void); testcase tc_array[] = { {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup}, @@ -331,6 +332,7 @@ testcase tc_array[] = { {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_extension_data_p", ITc_noti_ex_item_set_get_extension_data_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {NULL, NULL} }; diff --git a/src/itc/notification/tct-notification-native_tizeniot.h b/src/itc/notification/tct-notification-native_tizeniot.h index 1669f44a2..798afe6a0 100755 --- a/src/itc/notification/tct-notification-native_tizeniot.h +++ b/src/itc/notification/tct-notification-native_tizeniot.h @@ -177,6 +177,7 @@ extern int ITc_noti_ex_item_text_set_multi_language_p(void); extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void); extern int ITc_noti_ex_item_entry_set_multi_language_p(void); extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void); +extern int ITc_noti_ex_item_set_get_extension_data_p(void); testcase tc_array[] = { {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup}, @@ -331,6 +332,7 @@ testcase tc_array[] = { {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_extension_data_p", ITc_noti_ex_item_set_get_extension_data_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {NULL, NULL} }; diff --git a/src/itc/notification/tct-notification-native_wearable.h b/src/itc/notification/tct-notification-native_wearable.h index ba39b4cc4..0e895c9ae 100755 --- a/src/itc/notification/tct-notification-native_wearable.h +++ b/src/itc/notification/tct-notification-native_wearable.h @@ -177,6 +177,7 @@ extern int ITc_noti_ex_item_text_set_multi_language_p(void); extern int ITc_noti_ex_item_entry_set_multi_language_p(void); extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void); extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void); +extern int ITc_noti_ex_item_set_get_extension_data_p(void); testcase tc_array[] = { {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup}, @@ -331,6 +332,7 @@ testcase tc_array[] = { {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_extension_data_p", ITc_noti_ex_item_set_get_extension_data_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {NULL, NULL} };