[WebRTC][Non-ACR] Remove useless event handler and code clean 42/287642/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Thu, 2 Feb 2023 02:35:01 +0000 (11:35 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Thu, 2 Feb 2023 02:35:01 +0000 (11:35 +0900)
Change-Id: Id9a0f226e7fdfd65cd8f6b98aef691ff4ac86fc7

tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSWebRTC.Events.IceConnectionStateChanged.cs
tct-suite-vs/Tizen.WebRTC.Tests/testcase/support/TestBase.cs

index 428232e..fd415dd 100755 (executable)
@@ -100,7 +100,7 @@ namespace Tizen.Multimedia.Remoting.Tests
 
         private void OfferIceConnectionStateChangeEventHandler(object s, WebRTCIceConnectionStateChangedEventArgs e)
         {
-            if (e.State == WebRTCIceConnectionState.Completed)
+            if (e.State == WebRTCIceConnectionState.Connected || e.State == WebRTCIceConnectionState.Completed)
             {
                 Log.Info(WebRTCTestLog.Tag, "[START] _tcsOfferIceConnectionState.TrySetResult(true)");
                 _tcsOfferIceConnectionState.TrySetResult(true);
@@ -127,7 +127,7 @@ namespace Tizen.Multimedia.Remoting.Tests
 
         private void AnswerIceConnectionStateChangeEventHandler(object s, WebRTCIceConnectionStateChangedEventArgs e)
         {
-            if (e.State == WebRTCIceConnectionState.Completed)
+            if (e.State == WebRTCIceConnectionState.Connected || e.State == WebRTCIceConnectionState.Completed)
             {
                 Log.Info(WebRTCTestLog.Tag, "[START] _tcsAnswerIceConnectionState.TrySetResult(true)");
                 _tcsAnswerIceConnectionState.TrySetResult(true);
index 5b36f9e..6c532fc 100644 (file)
@@ -148,34 +148,12 @@ namespace Tizen.Multimedia.Remoting.Tests
 
             var tasks = new List<Task>();
 
-            var tcsOfferIceConnectionState = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
-            var tcsAnswerIceConnectionState = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
             var tcsOfferPeeronnectionState = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
             var tcsAnswerPeeronnectionState = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
 
-            tasks.Add(tcsOfferIceConnectionState.Task);
-            tasks.Add(tcsAnswerIceConnectionState.Task);
             tasks.Add(tcsOfferPeeronnectionState.Task);
             tasks.Add(tcsAnswerPeeronnectionState.Task);
 
-            EventHandler<WebRTCIceConnectionStateChangedEventArgs> offerIceConnectionEventHandler = (s, e) =>
-            {
-                if (e.State == WebRTCIceConnectionState.Completed)
-                {
-                    Log.Info(WebRTCTestLog.Tag, $"[START] tcsOfferIceConnectionState [{e.State}]");
-                    tcsOfferIceConnectionState.TrySetResult(true);
-                    Log.Info(WebRTCTestLog.Tag, $"[END] tcsOfferIceConnectionState [{e.State}]");
-                }
-            };
-            EventHandler<WebRTCIceConnectionStateChangedEventArgs> answerIceConnectionEventHandler = (s, e) =>
-            {
-                if (e.State == WebRTCIceConnectionState.Completed)
-                {
-                    Log.Info(WebRTCTestLog.Tag, $"[START] tcsAnswerIceConnectionState [{e.State}]");
-                    tcsAnswerIceConnectionState.TrySetResult(true);
-                    Log.Info(WebRTCTestLog.Tag, $"[END] tcsAnswerIceConnectionState [{e.State}]");
-                }
-            };
             EventHandler<WebRTCPeerConnectionStateChangedEventArgs> offerPeerConnectionEventHandler = (s, e) =>
             {
                 if (e.State == WebRTCPeerConnectionState.Connected)
@@ -195,10 +173,7 @@ namespace Tizen.Multimedia.Remoting.Tests
                 }
             };
 
-            offerClient.IceConnectionStateChanged += offerIceConnectionEventHandler;
             offerClient.PeerConnectionStateChanged += offerPeerConnectionEventHandler;
-
-            answerClient.IceConnectionStateChanged += answerIceConnectionEventHandler;
             answerClient.PeerConnectionStateChanged += answerPeerConnectionEventHandler;
 
             if (stateChanged)
@@ -241,10 +216,7 @@ namespace Tizen.Multimedia.Remoting.Tests
             }
             finally
             {
-                offerClient.IceConnectionStateChanged -= offerIceConnectionEventHandler;
                 offerClient.PeerConnectionStateChanged -= offerPeerConnectionEventHandler;
-
-                answerClient.IceConnectionStateChanged -= answerIceConnectionEventHandler;
                 answerClient.PeerConnectionStateChanged -= answerPeerConnectionEventHandler;
 
                 if (stateChanged)