[Multimedia.Manual][Non-ACR] Fix bugs of checking camera/recording feature 51/212851/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 27 Aug 2019 09:11:13 +0000 (18:11 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Tue, 27 Aug 2019 09:11:13 +0000 (18:11 +0900)
Change-Id: I43dc25ef670175c26b1e82af144dc972da2fb459

tct-suite-vs/Tizen.Multimedia.Manual.Tests/testcase/Recorder/TSRecorder.cs [changed mode: 0755->0644]
tct-suite-vs/Tizen.Multimedia.Manual.Tests/testcase/support/Features.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 8cd2122..954e8a4
@@ -4,8 +4,6 @@ using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
 using Tizen.System;
-using Xamarin.Forms;
-using Extension = Tizen.Xamarin.Forms.Extension;
 
 namespace Tizen.Multimedia.Tests
 {
@@ -15,10 +13,29 @@ namespace Tizen.Multimedia.Tests
     {
         private Recorder _videoRecorder;
         private string _filePath;
+        protected bool _isVideoRecordingSupported = true;
+
+        private async Task<bool> CheckVideoRecordingSupported(string msg)
+        {
+            if (_isVideoRecordingSupported == false)
+            {
+                await NotSupportedHelper.DisplayNotSupportedLabel(msg);
+                return true;
+            }
+
+            return false;
+        }
 
         [SetUp]
         public void SetUp()
         {
+            if (_isCameraSupported == false)
+            {
+                // If camera feature is not supported,
+                // we can't create VideoRecorder instance and test recorder TCs.
+                return;
+            }
+
             try
             {
                 var supportedVideoCodec = VideoRecorder.GetSupportedVideoCodecs().First(
@@ -37,9 +54,9 @@ namespace Tizen.Multimedia.Tests
                     }
                 };
             }
-            catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.Camera) == false)
+            catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.VideoRecording) == false)
             {
-                _isCameraSupported = false;
+                _isVideoRecordingSupported = false;
             }
         }
 
@@ -171,7 +188,8 @@ namespace Tizen.Multimedia.Tests
         [Postcondition(1, "NA")]
         public async Task Start_CHANGE_STATUS()
         {
-            if (await CheckCameraSupported(nameof(Start_CHANGE_STATUS)))
+            if (await CheckCameraSupported(nameof(Start_CHANGE_STATUS)) ||
+                await CheckVideoRecordingSupported(nameof(Start_CHANGE_STATUS)))
             {
                 return;
             }
@@ -222,7 +240,8 @@ namespace Tizen.Multimedia.Tests
         [Postcondition(1, "NA")]
         public async Task Pause_CHANGE_STATUS()
         {
-            if (await CheckCameraSupported(nameof(Pause_CHANGE_STATUS)))
+            if (await CheckCameraSupported(nameof(Start_CHANGE_STATUS)) ||
+                await CheckVideoRecordingSupported(nameof(Start_CHANGE_STATUS)))
             {
                 return;
             }
@@ -283,7 +302,8 @@ namespace Tizen.Multimedia.Tests
         [Postcondition(1, "NA")]
         public async Task Commit_CHANGE_STATUS()
         {
-            if (await CheckCameraSupported(nameof(Commit_CHANGE_STATUS)))
+            if (await CheckCameraSupported(nameof(Start_CHANGE_STATUS)) ||
+                await CheckVideoRecordingSupported(nameof(Start_CHANGE_STATUS)))
             {
                 return;
             }
@@ -339,7 +359,8 @@ namespace Tizen.Multimedia.Tests
         [Postcondition(1, "NA")]
         public async Task Cancel_CHANGE_STATUS()
         {
-            if (await CheckCameraSupported(nameof(Cancel_CHANGE_STATUS)))
+            if (await CheckCameraSupported(nameof(Start_CHANGE_STATUS)) ||
+                await CheckVideoRecordingSupported(nameof(Start_CHANGE_STATUS)))
             {
                 return;
             }
old mode 100755 (executable)
new mode 100644 (file)
index 8604aff..d6c493f
@@ -1,7 +1,8 @@
-public static class Features
+public static class Features
 {
     public const string Camera = "http://tizen.org/feature/camera";
     public const string Radio = "http://tizen.org/feature/fmradio";
     public const string ScreenMirroring = "http://tizen.org/feature/wifi.direct.display";
     public const string WifiDirect = "http://tizen.org/feature/network.wifi.direct";
+    public const string VideoRecording = "http://tizen.org/feature/media.video_recording";
 }