From: ruble Date: Tue, 3 Sep 2019 04:39:54 +0000 (+0900) Subject: [MediaPlayer][TCSACR-266] add TCs for exporting video frames X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F23%2F213223%2F1;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaPlayer][TCSACR-266] add TCs for exporting video frames Change-Id: I529bbbde060b353631ab46bad17965d6508d6496 --- 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