From: Ankit Date: Wed, 9 Feb 2022 10:01:29 +0000 (+0530) Subject: [ITC][webrtc][ACR-1677][added 3 new api cases] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=039bcc5dc96442b0afda459f7a44908d779d2dec;p=test%2Ftct%2Fnative%2Fapi.git [ITC][webrtc][ACR-1677][added 3 new api cases] Change-Id: Ic9eaecf6099fd008590ebf2b50cf37b8b82efe07 Signed-off-by: Ankit --- diff --git a/src/itc/webrtc/ITs-webrtc-common.h b/src/itc/webrtc/ITs-webrtc-common.h old mode 100755 new mode 100644 index c5c590ca5..74a77b79d --- a/src/itc/webrtc/ITs-webrtc-common.h +++ b/src/itc/webrtc/ITs-webrtc-common.h @@ -15,6 +15,7 @@ // #ifndef _ITS_WEBRTC_COMMON_H_ #define _ITS_WEBRTC_COMMON_H_ +#define TEST_BUFFERED_AMOUNT_THRESHOLD 65535 //Add test package related includes here #include "tct_common.h" diff --git a/src/itc/webrtc/ITs-webrtc.c b/src/itc/webrtc/ITs-webrtc.c old mode 100755 new mode 100644 index 4d141938f..f1ec5d197 --- a/src/itc/webrtc/ITs-webrtc.c +++ b/src/itc/webrtc/ITs-webrtc.c @@ -194,6 +194,16 @@ static bool webrtcTurnServerCB(const char *turn_server, void *user_data) return true; } +/** +* @function dataChannelBufferedAmountLowCB +* @parameter webrtc_data_channel_h channel, void *user_data +* @return NA +*/ +static void dataChannelBufferedAmountLowCB(webrtc_data_channel_h channel, void *user_data) +{ + FPRINTF("[Line : %d][%s] Callback checking\\n", __LINE__, API_NAMESPACE); +} + /** * @function ITs_webrtc_startup * @description Called before each test @@ -2090,5 +2100,127 @@ int ITc_media_webrtc_start_and_finish_negotiation_p(void) return 0; } + + +//& purpose: Gets the buffered amount of the data channel. +//& type: auto +/** +* @testcase ITc_media_webrtc_data_channel_get_buffered_amount_p +* @since_tizen 7.0 +* @author SRID(ankit.sri1) +* @reviewer SRID(shobhit.v) +* @type auto +* @description Gets the buffered amount of the data channel. +* @scenario Sets and Gets the display mode of the video track. +* @apicovered webrtc_create_data_chanel,webrtc_data_channel_get_buffered_amount, webrtc_destroy_data_channel +* @passcase If webrtc_data_channel_get_buffered_amount is successful +* @failcase If webrtc_data_channel_get_buffered_amount is unsuccessful +* @precondition NA +* @postcondition NA +*/ + +int ITc_media_webrtc_data_channel_get_buffered_amount_p(void) +{ + START_TEST; + + webrtc_data_channel_h hChannel; + char *pszChannel = "test data channel label"; + unsigned int nBufferedAmount; + + int nRet = webrtc_create_data_channel(g_hWebRtcHandle, pszChannel, NULL, &hChannel); + PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_create_data_channel", WebRtcGetError(nRet)); + CHECK_HANDLE(hChannel, "webrtc_create_data_channel"); + + nRet = webrtc_data_channel_get_buffered_amount(hChannel, &nBufferedAmount); + PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_get_buffered_amount", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel)); + + nRet = webrtc_destroy_data_channel(hChannel); + PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_destroy_data_channel", WebRtcGetError(nRet)); + + return 0; +} + +//& purpose: Set and unset the buffered amount of the data channel. +//& type: auto +/** +* @testcase ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p +* @since_tizen 7.0 +* @author SRID(ankit.sri1) +* @reviewer SRID(shobhit.v) +* @type auto +* @description Sets and unsets the buffered amount of the data channel. +* @scenario Sets and Gets the display mode of the video track. +* @apicovered webrtc_create_data_chanel,webrtc_data_channel_set_buffered_amount_low_cb, webrtc_data_channel_unset_buffered_amount_low_cb, webrtc_destroy_data_channel +* @passcase If webrtc_data_channel_set_buffered_amount_low_cb and webrtc_data_channel_unset_buffered_amount_low_cb is successful +* @failcase If webrtc_data_channel_set_buffered_amount_low_cb or webrtc_data_channel_unset_buffered_amount_low_cb fails +* @precondition NA +* @postcondition NA +*/ + +int ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p(void) +{ + START_TEST; + + webrtc_data_channel_h hChannel; + char *pszChannel = "test data channel label"; + + int nRet = webrtc_create_data_channel(g_hWebRtcHandle, pszChannel, NULL, &hChannel); + PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_create_data_channel", WebRtcGetError(nRet)); + CHECK_HANDLE(hChannel, "webrtc_create_data_channel"); + + nRet = webrtc_data_channel_set_buffered_amount_low_cb(hChannel, TEST_BUFFERED_AMOUNT_THRESHOLD, dataChannelBufferedAmountLowCB, NULL); + PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_set_buffered_amount_low_cb", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel)); + + nRet = webrtc_data_channel_unset_buffered_amount_low_cb(hChannel); + PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_unset_buffered_amount_low_cb", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel)); + + nRet = webrtc_destroy_data_channel(hChannel); + PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_destroy_data_channel", WebRtcGetError(nRet)); + + return 0; +} + +//& purpose: Get the buffered amount of the low threshold data channel. +//& type: auto +/** +* @testcase ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p +* @since_tizen 7.0 +* @author SRID(ankit.sri1) +* @reviewer SRID(shobhit.v) +* @type auto +* @description Get the buffered amount of the low threshold data channel. +* @scenario Get the buffered amount of the low threshold data channel. +* @apicovered webrtc_create_data_chanel,webrtc_data_channel_set_buffered_amount_low_cb,webrtc_data_channel_get_buffered_amount_low_threshold, webrtc_destroy_data_channel +* @passcase If webrtc_data_channel_set_buffered_amount_low_cb and webrtc_data_channel_get_buffered_amount_low_threshold is successful +* @failcase If webrtc_data_channel_set_buffered_amount_low_cb or webrtc_data_channel_get_buffered_amount_low_threshold fails +* @precondition NA +* @postcondition NA +*/ + +int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void) +{ + START_TEST; + + webrtc_data_channel_h hChannel; + char *pszChannel = "test data channel label"; + unsigned int nThreshold; + + int nRet = webrtc_create_data_channel(g_hWebRtcHandle, pszChannel, NULL, &hChannel); + PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_create_data_channel", WebRtcGetError(nRet)); + CHECK_HANDLE(hChannel, "webrtc_create_data_channel"); + + nRet = webrtc_data_channel_set_buffered_amount_low_cb(hChannel, TEST_BUFFERED_AMOUNT_THRESHOLD, dataChannelBufferedAmountLowCB, NULL); + PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_set_buffered_amount_low_cb", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel)); + + nRet = webrtc_data_channel_get_buffered_amount_low_threshold(hChannel, &nThreshold); + PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel)); + + PRINT_RESULT_CLEANUP(TEST_BUFFERED_AMOUNT_THRESHOLD, nThreshold, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel)); + + nRet = webrtc_destroy_data_channel(hChannel); + PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_destroy_data_channel", WebRtcGetError(nRet)); + + return 0; +} /** @} */ /** @} */ diff --git a/src/itc/webrtc/tct-webrtc-native_mobile.h b/src/itc/webrtc/tct-webrtc-native_mobile.h old mode 100755 new mode 100644 index a3fe1366f..f0e0483bb --- a/src/itc/webrtc/tct-webrtc-native_mobile.h +++ b/src/itc/webrtc/tct-webrtc-native_mobile.h @@ -78,6 +78,9 @@ extern int ITc_media_webrtc_set_get_ice_transport_policy_p(void); extern int ITc_media_webrtc_start_and_finish_negotiation_p(void); extern int ITc_webrtc_file_source_set_get_looping_p(void); extern int ITc_webrtc_file_source_set_path_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_p(void); +extern int ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void); testcase tc_array[] = { {"ITc_webrtc_create_destroy_p", ITc_webrtc_create_destroy_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, @@ -134,6 +137,9 @@ testcase tc_array[] = { {"ITc_media_webrtc_start_and_finish_negotiation_p", ITc_media_webrtc_start_and_finish_negotiation_p, NULL, NULL}, {"ITc_webrtc_file_source_set_get_looping_p", ITc_webrtc_file_source_set_get_looping_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, {"ITc_webrtc_file_source_set_path_p", ITc_webrtc_file_source_set_path_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, + {"ITc_media_webrtc_data_channel_get_buffered_amount_p", ITc_media_webrtc_data_channel_get_buffered_amount_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, + {"ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p", ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, + {"ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p",ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, {NULL, NULL} }; diff --git a/src/itc/webrtc/tct-webrtc-native_tizeniot.h b/src/itc/webrtc/tct-webrtc-native_tizeniot.h old mode 100755 new mode 100644 index a3fe1366f..11ccd592c --- a/src/itc/webrtc/tct-webrtc-native_tizeniot.h +++ b/src/itc/webrtc/tct-webrtc-native_tizeniot.h @@ -78,6 +78,9 @@ extern int ITc_media_webrtc_set_get_ice_transport_policy_p(void); extern int ITc_media_webrtc_start_and_finish_negotiation_p(void); extern int ITc_webrtc_file_source_set_get_looping_p(void); extern int ITc_webrtc_file_source_set_path_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_p(void); +extern int ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void); testcase tc_array[] = { {"ITc_webrtc_create_destroy_p", ITc_webrtc_create_destroy_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, @@ -134,6 +137,9 @@ testcase tc_array[] = { {"ITc_media_webrtc_start_and_finish_negotiation_p", ITc_media_webrtc_start_and_finish_negotiation_p, NULL, NULL}, {"ITc_webrtc_file_source_set_get_looping_p", ITc_webrtc_file_source_set_get_looping_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, {"ITc_webrtc_file_source_set_path_p", ITc_webrtc_file_source_set_path_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, + {"ITc_media_webrtc_data_channel_get_buffered_amount_p", ITc_media_webrtc_data_channel_get_buffered_amount_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, + {"ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p", ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, + {"ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p",ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, {NULL, NULL} }; diff --git a/src/itc/webrtc/tct-webrtc-native_tv.h b/src/itc/webrtc/tct-webrtc-native_tv.h old mode 100755 new mode 100644 index a3fe1366f..11ccd592c --- a/src/itc/webrtc/tct-webrtc-native_tv.h +++ b/src/itc/webrtc/tct-webrtc-native_tv.h @@ -78,6 +78,9 @@ extern int ITc_media_webrtc_set_get_ice_transport_policy_p(void); extern int ITc_media_webrtc_start_and_finish_negotiation_p(void); extern int ITc_webrtc_file_source_set_get_looping_p(void); extern int ITc_webrtc_file_source_set_path_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_p(void); +extern int ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void); testcase tc_array[] = { {"ITc_webrtc_create_destroy_p", ITc_webrtc_create_destroy_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, @@ -134,6 +137,9 @@ testcase tc_array[] = { {"ITc_media_webrtc_start_and_finish_negotiation_p", ITc_media_webrtc_start_and_finish_negotiation_p, NULL, NULL}, {"ITc_webrtc_file_source_set_get_looping_p", ITc_webrtc_file_source_set_get_looping_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, {"ITc_webrtc_file_source_set_path_p", ITc_webrtc_file_source_set_path_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, + {"ITc_media_webrtc_data_channel_get_buffered_amount_p", ITc_media_webrtc_data_channel_get_buffered_amount_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, + {"ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p", ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, + {"ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p",ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, {NULL, NULL} }; diff --git a/src/itc/webrtc/tct-webrtc-native_wearable.h b/src/itc/webrtc/tct-webrtc-native_wearable.h old mode 100755 new mode 100644 index a3fe1366f..11ccd592c --- a/src/itc/webrtc/tct-webrtc-native_wearable.h +++ b/src/itc/webrtc/tct-webrtc-native_wearable.h @@ -78,6 +78,9 @@ extern int ITc_media_webrtc_set_get_ice_transport_policy_p(void); extern int ITc_media_webrtc_start_and_finish_negotiation_p(void); extern int ITc_webrtc_file_source_set_get_looping_p(void); extern int ITc_webrtc_file_source_set_path_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_p(void); +extern int ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p(void); +extern int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void); testcase tc_array[] = { {"ITc_webrtc_create_destroy_p", ITc_webrtc_create_destroy_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, @@ -134,6 +137,9 @@ testcase tc_array[] = { {"ITc_media_webrtc_start_and_finish_negotiation_p", ITc_media_webrtc_start_and_finish_negotiation_p, NULL, NULL}, {"ITc_webrtc_file_source_set_get_looping_p", ITc_webrtc_file_source_set_get_looping_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, {"ITc_webrtc_file_source_set_path_p", ITc_webrtc_file_source_set_path_p, ITs_webrtc_startup, ITs_webrtc_cleanup}, + {"ITc_media_webrtc_data_channel_get_buffered_amount_p", ITc_media_webrtc_data_channel_get_buffered_amount_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, + {"ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p", ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, + {"ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p",ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p, ITs_webrtc_startup, ITs_webrtc_cleanup }, {NULL, NULL} };