From ca66539a244d3c50cf543cb1e51b156d8b2b7e81 Mon Sep 17 00:00:00 2001 From: ruble Date: Tue, 3 Sep 2019 13:39:54 +0900 Subject: [PATCH] [MediaPlayer][TCSACR-266] add TCs for exporting video frames Change-Id: I529bbbde060b353631ab46bad17965d6508d6496 --- .../Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs | 157 ++++++++++++++++++++- 1 file changed, 155 insertions(+), 2 deletions(-) diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs index 2661172..a617735 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs @@ -1848,7 +1848,7 @@ namespace Tizen.Multimedia.Tests [Test] [Category("P1")] - [Description("VideoFrameDecoded test")] + [Description("Check if VideoFrameDecoded event is raised")] [Property("SPEC", "Tizen.Multimedia.Player.VideoFrameDecoded E")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "EVL")] @@ -1857,7 +1857,10 @@ namespace Tizen.Multimedia.Tests { try { - var player = await GetPreparedPlayer(Constants.VideoFileSource); + var player = GetIdlePlayer(); + player.SetSource(Constants.VideoFileSource); + player.EnableExportingVideoFrame(); + await player.PrepareAsync(); using (var eventWaiter = EventAwaiter.Create()) { @@ -1874,6 +1877,156 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P1")] + [Description("Check EnableExportingVideoFrame does not throw exceptions")] + [Property("SPEC", "Tizen.Multimedia.Player.EnableExportingVideoFrame M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public void EnableExportingVideoFrame_CHECK() + { + try + { + var player = GetIdlePlayer(); + player.SetSource(Constants.VideoFileSource); + + Assert.That(() => player.EnableExportingVideoFrame(), Throws.Nothing); + } + catch(NotSupportedException) + { + if (FeatureChecker.IsSupported(Features.RawVideo) == false) + { + Assert.Pass($"The feature({Features.RawVideo} is not supported."); + } + } + } + + [Test] + [Category("P2")] + [Description("EnableExportingVideoFrame throw exception if the player is not in a valid state")] + [Property("SPEC", "Tizen.Multimedia.Player.EnableExportingVideoFrame M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public async Task EnableExportingVideoFrame_THROWS_IF_NOT_VALID_STATE() + { + try + { + var player = await GetPreparedPlayer(Constants.VideoFileSource); + + Assert.That(() => player.EnableExportingVideoFrame(), + Throws.InvalidOperationException); + } + catch (NotSupportedException) + { + if (FeatureChecker.IsSupported(Features.RawVideo) == false) + { + Assert.Pass($"The feature({Features.RawVideo} is not supported."); + } + } + } + + [Test] + [Category("P2")] + [Description("Any attempt to access the EnableExportingVideoFrame if the player has been disposed of")] + [Property("SPEC", "Tizen.Multimedia.Player.EnableExportingVideoFrame M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public void EnableExportingVideoFrame_DISPOSED() + { + try + { + GetIdlePlayer().Dispose(); + + Assert.That(() => TestPlayer.EnableExportingVideoFrame(), + Throws.TypeOf()); + } + catch (NotSupportedException) + { + if (FeatureChecker.IsSupported(Features.RawVideo) == false) + { + Assert.Pass($"The feature({Features.RawVideo} is not supported."); + } + } + } + + [Test] + [Category("P1")] + [Description("Check DisableExportingVideoFrame does not throw exceptions")] + [Property("SPEC", "Tizen.Multimedia.Player.DisableExportingVideoFrame M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public async Task DisableExportingVideoFrame_CHECK() + { + try + { + var player = GetIdlePlayer(); + Assert.That(() => player.DisableExportingVideoFrame(), Throws.Nothing); + + player.SetSource(Constants.VideoFileSource); + await player.PrepareAsync(); + Assert.That(() => player.DisableExportingVideoFrame(), Throws.Nothing); + } + catch (NotSupportedException) + { + if (FeatureChecker.IsSupported(Features.RawVideo) == false) + { + Assert.Pass($"The feature({Features.RawVideo} is not supported."); + } + } + } + + [Test] + [Category("P2")] + [Description("DisableExportingVideoFrame throw exception if the player is not in a valid state")] + [Property("SPEC", "Tizen.Multimedia.Player.DisableExportingVideoFrame M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public async Task DisableExportingVideoFrame_THROWS_IF_NOT_VALID_STATE() + { + try + { + var player = await GetPlayingPlayer(Constants.VideoFileSource); + + Assert.That(() => player.DisableExportingVideoFrame(), + Throws.InvalidOperationException); + } + catch (NotSupportedException) + { + if (FeatureChecker.IsSupported(Features.RawVideo) == false) + { + Assert.Pass($"The feature({Features.RawVideo} is not supported."); + } + } + } + + [Test] + [Category("P2")] + [Description("Any attempt to access the DisableExportingVideoFrame if the player has been disposed of")] + [Property("SPEC", "Tizen.Multimedia.Player.DisableExportingVideoFrame M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] + public void DisableExportingVideoFrame_DISPOSED() + { + try + { + GetIdlePlayer().Dispose(); + + Assert.That(() => TestPlayer.DisableExportingVideoFrame(), Throws.TypeOf()); + } + catch (NotSupportedException) + { + if (FeatureChecker.IsSupported(Features.RawVideo) == false) + { + Assert.Pass($"The feature({Features.RawVideo} is not supported."); + } + } + } #endregion #region VideoStreamChanged -- 2.7.4