[WebRTC][Non-ACR] Catch Exception when MediaCameraSource is not supported 18/279818/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Thu, 18 Aug 2022 06:55:44 +0000 (15:55 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Thu, 18 Aug 2022 08:54:45 +0000 (17:54 +0900)
Change-Id: Idaa3b7512fcda23068d0cbe97873fff934f7229e

tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSWebRTC.Events.ErrorOccurred.cs
tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSWebRTC.Events.TrackAdded.cs
tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSWebRTCErrorOccurredEventArgs.cs

index eb2b9db..99cd6ce 100755 (executable)
@@ -15,6 +15,7 @@
  */
 
 using NUnit.Framework;
+using System;
 using System.Threading.Tasks;
 
 namespace Tizen.Multimedia.Remoting.Tests
@@ -38,7 +39,16 @@ namespace Tizen.Multimedia.Remoting.Tests
                 var tcs = new TaskCompletionSource<bool>();
 
                 var cameraSource = new MediaCameraSource();
-                webRtc.AddSource(cameraSource);
+
+                try
+                {
+                    webRtc.AddSource(cameraSource);
+                }
+                catch (NotSupportedException e)
+                {
+                    Log.Info(WebRTCTestLog.Tag, e.ToString());
+                    Assert.Pass("CameraSource is not supported");
+                }
 
                 cameraSource.VideoFrameRate = 10000;
 
index 727e78f..8bc03ca 100755 (executable)
@@ -51,7 +51,6 @@ namespace Tizen.Multimedia.Remoting.Tests
 
                 Assert.That(await tcsAnswerTrackAdded.Task, "TrackAdded event Should be raised");
             }
-
         }
     }
 }
index 8b950a2..625372f 100755 (executable)
@@ -1,4 +1,3 @@
-using System;
 /*
  *  Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
  *
@@ -16,6 +15,7 @@ using System;
  */
 
 using NUnit.Framework;
+using System;
 using System.Threading.Tasks;
 
 namespace Tizen.Multimedia.Remoting.Tests
@@ -39,7 +39,16 @@ namespace Tizen.Multimedia.Remoting.Tests
                 var tcs = new TaskCompletionSource<bool>();
 
                 var cameraSource = new MediaCameraSource();
-                webRtc.AddSource(cameraSource);
+
+                try
+                {
+                    webRtc.AddSource(cameraSource);
+                }
+                catch (NotSupportedException e)
+                {
+                    Log.Info(WebRTCTestLog.Tag, e.ToString());
+                    Assert.Pass("CameraSource is not supported");
+                }
 
                 cameraSource.VideoFrameRate = 10000;
 
@@ -69,7 +78,16 @@ namespace Tizen.Multimedia.Remoting.Tests
                 var tcs = new TaskCompletionSource<bool>();
 
                 var cameraSource = new MediaCameraSource();
-                webRtc.AddSource(cameraSource);
+
+                try
+                {
+                    webRtc.AddSource(cameraSource);
+                }
+                catch (NotSupportedException e)
+                {
+                    Log.Info(WebRTCTestLog.Tag, e.ToString());
+                    Assert.Pass("CameraSource is not supported");
+                }
 
                 cameraSource.VideoFrameRate = 10000;
 
@@ -99,7 +117,16 @@ namespace Tizen.Multimedia.Remoting.Tests
                 var tcs = new TaskCompletionSource<bool>();
 
                 var cameraSource = new MediaCameraSource();
-                webRtc.AddSource(cameraSource);
+
+                try
+                {
+                    webRtc.AddSource(cameraSource);
+                }
+                catch (NotSupportedException e)
+                {
+                    Log.Info(WebRTCTestLog.Tag, e.ToString());
+                    Assert.Pass("CameraSource is not supported");
+                }
 
                 cameraSource.VideoFrameRate = 10000;