From: Sanghoon Lee Date: Mon, 11 Feb 2019 04:32:52 +0000 (+0900) Subject: [MediaPlayer][Non-ACR][Created test object after setting precondition] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee7d7ad77e6067b001bb0c561aa5e798eb94e454;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaPlayer][Non-ACR][Created test object after setting precondition] Change-Id: I8d486b40d23ce5f75308f0baf6d7bc071139c29e --- diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSAdaptiveVariants.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSAdaptiveVariants.cs index 2ae62cde4..94ed8df3e 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSAdaptiveVariants.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSAdaptiveVariants.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using System.Threading.Tasks; using System.Linq; using System.Collections; @@ -10,12 +10,16 @@ namespace Tizen.Multimedia.Tests [Description("Tizen.Multimedia.AdaptiveVariants Tests")] public class AdaptiveVariantsTests : TestBase { + internal MediaUriSource _adaptiveStreamingSource = null; + [OneTimeSetUp] public void Init() { - PreconditionUtils.SetPrecondition(); + if (PreconditionUtils.ADAPTIVE_STREAMING_URI == null) + PreconditionUtils.SetPrecondition(); + + _adaptiveStreamingSource = new MediaUriSource(PreconditionUtils.ADAPTIVE_STREAMING_URI); } - internal readonly MediaUriSource AdaptiveStreamingSource = new MediaUriSource(PreconditionUtils.ADAPTIVE_STREAMING_URI); [Test] [Category("P1")] @@ -118,7 +122,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] public async Task AvailableAdaptiveVariants_PROPERTY_READ_ONLY() { - var player = await GetPreparedPlayer(AdaptiveStreamingSource, DefaultDisplay); + var player = await GetPreparedPlayer(_adaptiveStreamingSource, DefaultDisplay); IList result = player.AdaptiveVariants.AvailableAdaptiveVariants.ToList(); Assert.IsNotNull(result, "The list of adaptive variants should not be null."); Assert.IsNotEmpty(result, "The list of adaptive variants should not be empty."); diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs index 7633bb6cc..cd9db86b4 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs @@ -8,12 +8,16 @@ namespace Tizen.Multimedia.Tests [Description("Tizen.Multimedia.DownloadProgress Tests")] public class DownloadProgressTests : TestBase { + internal MediaUriSource _streamingSource = null; + [OneTimeSetUp] public void Init() { - PreconditionUtils.SetPrecondition(); + if (PreconditionUtils.STREAMING_URI == null) + PreconditionUtils.SetPrecondition(); + + _streamingSource = new MediaUriSource(PreconditionUtils.STREAMING_URI); } - internal readonly MediaUriSource StreamingSource = new MediaUriSource(PreconditionUtils.STREAMING_URI); [Test] [Category("P1")] @@ -36,7 +40,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task Start_CHECK_INIT() { - var player = await GetPlayingPlayer(StreamingSource); + var player = await GetPlayingPlayer(_streamingSource); Assert.That(player.GetDownloadProgress().Start, Is.Zero); } @@ -50,7 +54,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task Start_CHECK() { - var player = await GetPlayingPlayer(StreamingSource); + var player = await GetPlayingPlayer(_streamingSource); await player.SetPlayPositionAsync(player.StreamInfo.GetDuration() / 10, true); await Task.Delay(100); @@ -67,7 +71,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task Current_CHECK() { - var player = await GetPlayingPlayer(StreamingSource); + var player = await GetPlayingPlayer(_streamingSource); bool currentNotZero = false; for (int tryConut = 0; tryConut < 10; ++tryConut) diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs index 280b146a6..6f5aef6b9 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs @@ -11,15 +11,18 @@ namespace Tizen.Multimedia.Tests [Description("Tizen.Multimedia.Player tests")] public class PlayerTests : TestBase { + private const long Unit = 1_000_000; /* 1 Millisecond = 1,000,000 Nanoseconds */ + private long ConvertMillisecondsToNanoseconds(int milliseconds) => milliseconds * Unit; + MediaUriSource _streamingSource = null; + [OneTimeSetUp] public void Init() { - PreconditionUtils.SetPrecondition(); - } - internal readonly MediaUriSource StreamingSource = new MediaUriSource(PreconditionUtils.STREAMING_URI); + if (PreconditionUtils.STREAMING_URI == null) + PreconditionUtils.SetPrecondition(); - private const long Unit = 1_000_000; /* 1 Millisecond = 1,000,000 Nanoseconds */ - private long ConvertMillisecondsToNanoseconds(int milliseconds) => milliseconds * Unit; + _streamingSource = new MediaUriSource(PreconditionUtils.STREAMING_URI); + } [Test] [Category("P1")] @@ -726,7 +729,7 @@ namespace Tizen.Multimedia.Tests { player.BufferingProgressChanged += eventWaiter; - player.SetSource(StreamingSource); + player.SetSource(_streamingSource); player.PrepareAsync(); @@ -1427,7 +1430,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task GetDownloadProgress_CHECK() { - var player = await GetPreparedPlayer(StreamingSource); + var player = await GetPreparedPlayer(_streamingSource); player.Start();