[ITC][webrtc][ACR-1677][added 3 new api cases] 19/270819/5
authorAnkit <ankit.sri1@samsung.com>
Wed, 9 Feb 2022 10:01:29 +0000 (15:31 +0530)
committershobhit verma <shobhit.v@samsung.com>
Thu, 10 Feb 2022 09:25:21 +0000 (09:25 +0000)
Change-Id: Ic9eaecf6099fd008590ebf2b50cf37b8b82efe07
Signed-off-by: Ankit <ankit.sri1@samsung.com>
src/itc/webrtc/ITs-webrtc-common.h [changed mode: 0755->0644]
src/itc/webrtc/ITs-webrtc.c [changed mode: 0755->0644]
src/itc/webrtc/tct-webrtc-native_mobile.h [changed mode: 0755->0644]
src/itc/webrtc/tct-webrtc-native_tizeniot.h [changed mode: 0755->0644]
src/itc/webrtc/tct-webrtc-native_tv.h [changed mode: 0755->0644]
src/itc/webrtc/tct-webrtc-native_wearable.h [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index c5c590c..74a77b7
@@ -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"
old mode 100755 (executable)
new mode 100644 (file)
index 4d14193..f1ec5d1
@@ -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)\r
+{\r
+       FPRINTF("[Line : %d][%s] Callback checking\\n", __LINE__, API_NAMESPACE);\r
+}
+
 /**
  * @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)\r
+{\r
+       START_TEST;\r
+\r
+       webrtc_data_channel_h hChannel;
+       char *pszChannel = "test data channel label";\r
+       unsigned int nThreshold;\r
+\r
+       int nRet = webrtc_create_data_channel(g_hWebRtcHandle, pszChannel, NULL, &hChannel);\r
+       PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_create_data_channel", WebRtcGetError(nRet));
+       CHECK_HANDLE(hChannel, "webrtc_create_data_channel");\r
+\r
+       nRet = webrtc_data_channel_set_buffered_amount_low_cb(hChannel, TEST_BUFFERED_AMOUNT_THRESHOLD, dataChannelBufferedAmountLowCB, NULL);\r
+       PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_set_buffered_amount_low_cb", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));\r
+\r
+       nRet = webrtc_data_channel_get_buffered_amount_low_threshold(hChannel, &nThreshold);\r
+       PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));\r
+\r
+       PRINT_RESULT_CLEANUP(TEST_BUFFERED_AMOUNT_THRESHOLD, nThreshold, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));\r
+\r
+       nRet = webrtc_destroy_data_channel(hChannel);
+       PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_destroy_data_channel", WebRtcGetError(nRet));\r
+\r
+       return 0;\r
+}
 /** @} */
 /** @} */
old mode 100755 (executable)
new mode 100644 (file)
index a3fe136..f0e0483
@@ -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}
 };
 
old mode 100755 (executable)
new mode 100644 (file)
index a3fe136..11ccd59
@@ -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}
 };
 
old mode 100755 (executable)
new mode 100644 (file)
index a3fe136..11ccd59
@@ -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}
 };
 
old mode 100755 (executable)
new mode 100644 (file)
index a3fe136..11ccd59
@@ -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}
 };