--- /dev/null
+using NUnit.Framework;
+
+namespace Tizen.Multimedia.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.DirectionOfView tests")]
+ public static class DirectionOfViewTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Constructor test")]
+ [Property("SPEC", "Tizen.Multimedia.DirectionOfView.DirectionOfView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void DirectionOfView_CHECK_RETURN()
+ {
+ Assert.DoesNotThrow(() => new DirectionOfView(0.0f, 0.0f));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Yaw Read/Write")]
+ [Property("SPEC", "Tizen.Multimedia.DirectionOfView.Yaw A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void Yaw_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<DirectionOfView>(nameof(DirectionOfView.Yaw));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Pitch Read/Write")]
+ [Property("SPEC", "Tizen.Multimedia.DirectionOfView.Pitch A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void Pitch_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<DirectionOfView>(nameof(DirectionOfView.Pitch));
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+
+namespace Tizen.Multimedia.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.FieldOfView tests")]
+ public static class FieldOfViewTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Constructor test")]
+ [Property("SPEC", "Tizen.Multimedia.FieldOfView.FieldOfView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void FieldOfView_CHECK_RETURN()
+ {
+ Assert.DoesNotThrow(() => new FieldOfView(0, 0));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("HorizontalDegrees Read/Write")]
+ [Property("SPEC", "Tizen.Multimedia.FieldOfView.HorizontalDegrees A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void HorizontalDegrees_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<FieldOfView>(nameof(FieldOfView.HorizontalDegrees));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("VerticalDegrees Read/Write")]
+ [Property("SPEC", "Tizen.Multimedia.FieldOfView.VerticalDegrees A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void VerticalDegrees_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<FieldOfView>(nameof(FieldOfView.VerticalDegrees));
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.IO;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.SphericalVideo Tests")]
+ public class SphericalVideoTests : TestBase
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ if (FeatureChecker.IsSupported(Features.OpenGl) == false
+ || FeatureChecker.IsSupported(Features.SphericalVideo) == false)
+ {
+ Assert.Pass($"The feature is not supported.");
+ }
+ }
+
+ private static class DefaultValues
+ {
+ public const float Yaw = 0.0f;
+ public const float Pitch = 0.0f;
+ public const float level = 1.0f;
+ public const int HorizontalDegrees = 120;
+ public const int VerticalDegrees = 67;
+ }
+
+ protected async Task<SphericalVideo> GetSphericalVideo()
+ {
+ return (await GetPlayingPlayer(Constants.SphericalVideoSource, DefaultDisplay)).SphericalVideo;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Player always not null")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.Player A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PDV")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task Player_CHECK()
+ {
+ Assert.That((await GetSphericalVideo()).Player, Is.Not.Null);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether IsEnabled is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsEnabled_SET_GET()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.SphericalVideoPath), DefaultDisplay);
+
+ const bool newValue = true;
+
+ player.SphericalVideo.IsEnabled = newValue;
+ Assert.That(player.SphericalVideo.IsEnabled, Is.EqualTo(newValue), "Invalid value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("IsSphericalContent throws if the video is spherical content")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsSphericalContent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsSphericalContent_TRUE()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.SphericalVideoPath), DefaultDisplay);
+
+ Assert.That(player.SphericalVideo.IsSphericalContent(), Is.True, "Invalid value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("IsSphericalContent throws if the video is not spherical content")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsSphericalContent B")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsSphericalContent_FALSE()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
+
+ Assert.That(player.SphericalVideo.IsSphericalContent(), Is.False, "Invalid value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check default value of DirectionOfView")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.GetDirectionOfView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void GetDirectionOfView_DEFAULT()
+ {
+ var player = new Player();
+
+ Assert.That(player.SphericalVideo.GetDirectionOfView().Yaw, Is.EqualTo(DefaultValues.Yaw), "Invalid value.");
+ Assert.That(player.SphericalVideo.GetDirectionOfView().Pitch, Is.EqualTo(DefaultValues.Pitch), "Invalid value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Gets and sets direction of view for spherical video")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.SetDirectionOfView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void SetDirectionOfView_CHECK()
+ {
+ var player = new Player();
+
+ const float pi = 3.141592f;
+ const float halfPi = 1.570796f;
+
+ DirectionOfView dov = new DirectionOfView(pi, -halfPi);
+
+ Assert.That(() => player.SphericalVideo.SetDirectionOfView(dov), Throws.Nothing);
+ Assert.That(player.SphericalVideo.GetDirectionOfView(), Is.EqualTo(dov), "Invalid value.");
+ }
+
+
+ [Test]
+ [Category("P1")]
+ [Description("Check default value of zoom")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.GetZoom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void GetZoom_DEFAULT()
+ {
+ var player = new Player();
+
+ Assert.That(player.SphericalVideo.GetZoom(), Is.EqualTo(DefaultValues.level), "Invalid value");
+ }
+
+
+ [Test]
+ [Category("P1")]
+ [Description("Gets and sets zoom for spherical video")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.SetZoom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void SetZoom_CHECK()
+ {
+ var player = new Player();
+
+ const float newValue = 3.5f;
+
+ player.SphericalVideo.SetZoom(newValue);
+ Assert.That(player.SphericalVideo.GetZoom(), Is.EqualTo(newValue), "Invalid value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check default value of FieldOfView")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.GetFieldOfView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void GetFieldOfView_DEFAULT()
+ {
+ var player = new Player();
+
+ Assert.That(player.SphericalVideo.GetFieldOfView().HorizontalDegrees, Is.EqualTo(DefaultValues.HorizontalDegrees), "Invalid value.");
+ Assert.That(player.SphericalVideo.GetFieldOfView().VerticalDegrees, Is.EqualTo(DefaultValues.VerticalDegrees), "Invalid value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Gets and sets field of view for spherical video")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.SetFieldOfView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void SetFieldOfView_CHECK()
+ {
+ var player = new Player();
+
+ FieldOfView fov = new FieldOfView(180, 100);
+
+ Assert.That(() => player.SphericalVideo.SetFieldOfView(fov), Throws.Nothing);
+ Assert.That(player.SphericalVideo.GetFieldOfView(), Is.EqualTo(fov), "Invalid value.");
+ }
+ }
+}