From: NAMJEONGYOON Date: Thu, 10 May 2018 08:28:56 +0000 (+0900) Subject: [MediaPlayer][ACR-145] add 360 APIs and feature X-Git-Tag: tct5.0_m2~204^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F178521%2F7;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaPlayer][ACR-145] add 360 APIs and feature Change-Id: I30b3350506ea27a21fd414c5e9b42ae939fc1682 --- diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/res/test_360.mp4 b/tct-suite-vs/Tizen.MediaPlayer.Tests/res/test_360.mp4 new file mode 100755 index 0000000..294fe32 Binary files /dev/null and b/tct-suite-vs/Tizen.MediaPlayer.Tests/res/test_360.mp4 differ diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDirectionOfView.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDirectionOfView.cs new file mode 100755 index 0000000..53590f5 --- /dev/null +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDirectionOfView.cs @@ -0,0 +1,45 @@ +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(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(nameof(DirectionOfView.Pitch)); + } + } +} diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSFieldOfView.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSFieldOfView.cs new file mode 100755 index 0000000..3458f70 --- /dev/null +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSFieldOfView.cs @@ -0,0 +1,45 @@ +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(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(nameof(FieldOfView.VerticalDegrees)); + } + } +} diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs index 0c486b4..52c7808 100644 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs @@ -1354,5 +1354,19 @@ namespace Tizen.Multimedia.Tests } } #endregion + + #region SphericalVideo + [Test] + [Category("P1")] + [Description("SphericalVideo default value")] + [Property("SPEC", "Tizen.Multimedia.Player.SphericalVideo A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PDV")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public void SphericalVideo_DEFAULT() + { + Assert.That(TestPlayer.SphericalVideo, Is.Not.Null); + } + #endregion } } diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSSphericalVideo.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSSphericalVideo.cs new file mode 100755 index 0000000..18b02b8 --- /dev/null +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSSphericalVideo.cs @@ -0,0 +1,196 @@ +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 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."); + } + } +} diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Constants.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Constants.cs index fe1087b..8dd825c 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Constants.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Constants.cs @@ -10,6 +10,7 @@ internal static class Constants internal const string AudioFilePath = "/opt/usr/home/owner/share/res/test.mp3"; internal const string PushFilePath = "/opt/usr/home/owner/share/res/test.h264"; // no pts internal const string VideoFilePath = "/opt/usr/home/owner/share/res/test_meta.mp4"; + internal const string SphericalVideoPath = "/opt/usr/home/owner/share/res/test_360.mp4"; internal const string SubtitlePath = "/opt/usr/home/owner/share/res/test.smi"; internal const string SubtitlePathInvalid = "/opt/usr/home/owner/share/res/test_invalid.smi"; @@ -18,5 +19,6 @@ internal static class Constants internal static readonly MediaUriSource AudioFileSource = new MediaUriSource(AudioFilePath); internal static readonly MediaUriSource VideoFileSource = new MediaUriSource(VideoFilePath); internal static readonly MediaUriSource StreamingSource = new MediaUriSource(StreamingUrl); + internal static readonly MediaUriSource SphericalVideoSource = new MediaUriSource(SphericalVideoPath); } diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Features.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Features.cs index c22e2aa..3bb47de 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Features.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Features.cs @@ -3,4 +3,6 @@ internal static class Features internal const string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect"; internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video"; internal const string StreamInfo = "http://tizen.org/feature/multimedia.player.stream_info"; + internal const string OpenGl = "http://tizen.org/feature/opengles.version.2_0"; + internal const string SphericalVideo = "http://tizen.org/feature/multimedia.player.spherical_video"; }