[MediaPlayer][Non-ACR][Created test object after setting precondition] 75/199375/3
authorSanghoon Lee <shooney.lee@samsung.com>
Mon, 11 Feb 2019 04:32:52 +0000 (13:32 +0900)
committerSanghoon Lee <shooney.lee@samsung.com>
Mon, 11 Feb 2019 04:36:04 +0000 (13:36 +0900)
Change-Id: I8d486b40d23ce5f75308f0baf6d7bc071139c29e

tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSAdaptiveVariants.cs
tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs
tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs

index 2ae62cd..94ed8df 100755 (executable)
@@ -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.");
index 7633bb6..cd9db86 100755 (executable)
@@ -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)
index 280b146..6f5aef6 100755 (executable)
@@ -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();