using System.Linq;
using System.Threading.Tasks;
using Tizen.System;
-using Xamarin.Forms;
-using Extension = Tizen.Xamarin.Forms.Extension;
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(
}
};
}
- catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.Camera) == false)
+ catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.VideoRecording) == false)
{
- _isCameraSupported = false;
+ _isVideoRecordingSupported = false;
}
}
[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;
}
[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;
}
[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;
}
[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;
}
-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";
}