From 06f107b5bb4e51c0e59b05fbe12a11d9a59d0817 Mon Sep 17 00:00:00 2001 From: nam Date: Tue, 12 Jun 2018 13:37:12 +0900 Subject: [PATCH] [MediaPlayer][Non-ACR] fix to use user input for streaming test Change-Id: I52554aefddc6c7aabae4d37ba4372354faffabc2 --- .../Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs | 14 ++++++++++---- tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs | 13 ++++++++++--- .../Tizen.MediaPlayer.Tests/testcase/support/Constants.cs | 4 ---- .../testcase/support/PreconditionUtil.cs | 2 +- .../testcase/support/TestSources.cs | 3 +-- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs index 6d96930..458eb17 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSDownloadProgress.cs @@ -8,6 +8,13 @@ namespace Tizen.Multimedia.Tests [Description("Tizen.Multimedia.DownloadProgress Tests")] public class DownloadProgressTests : TestBase { + [OneTimeSetUp] + public static void Init() + { + PreconditionUtils.SetPrecondition(); + } + internal static readonly MediaUriSource StreamingSource = new MediaUriSource(PreconditionUtils.STREAMING_URI); + [Test] [Category("P1")] [Description("Constructor test")] @@ -29,7 +36,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task Start_CHECK_INIT() { - var player = await GetPlayingPlayer(Constants.StreamingSource); + var player = await GetPlayingPlayer(StreamingSource); Assert.That(player.GetDownloadProgress().Start, Is.Zero); } @@ -43,11 +50,10 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task Start_CHECK() { - var player = await GetPlayingPlayer(Constants.StreamingSource); + var player = await GetPlayingPlayer(StreamingSource); await player.SetPlayPositionAsync(Constants.StreamingVideoLength / 10, true); await Task.Delay(100); - Assert.That(Math.Abs(player.GetDownloadProgress().Start - 10), Is.LessThanOrEqualTo(2)); } @@ -60,7 +66,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task Current_CHECK() { - var player = await GetPlayingPlayer(Constants.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 52c7808..5cf677e 100644 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs @@ -11,6 +11,13 @@ namespace Tizen.Multimedia.Tests [Description("Tizen.Multimedia.Player tests")] public class PlayerTests : TestBase { + [OneTimeSetUp] + public static void Init() + { + PreconditionUtils.SetPrecondition(); + } + internal static readonly MediaUriSource StreamingSource = new MediaUriSource(PreconditionUtils.STREAMING_URI); + [Test] [Category("P1")] [Description("Player instantiation")] @@ -594,7 +601,7 @@ namespace Tizen.Multimedia.Tests { player.BufferingProgressChanged += eventWaiter; - player.SetSource(Constants.StreamingSource); + player.SetSource(StreamingSource); player.PrepareAsync(); @@ -969,7 +976,7 @@ namespace Tizen.Multimedia.Tests //[Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] //public async Task CaptureVideoAsync_RETURN_VIDEO_FRAME_WHEN_STREAMING() //{ - // IdlePlayer.SetSource(PlayerTestSupport.StreamingSource); + // IdlePlayer.SetSource(StreamingSource); // IdlePlayer.Display = new PlayerDisplay(PlayerTestSupport.CreateWindow()); // await IdlePlayer.PrepareAsync(); // IdlePlayer.Start(); @@ -1143,7 +1150,7 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] public async Task GetDownloadProgress_CHECK() { - var player = await GetPreparedPlayer(Constants.StreamingSource); + var player = await GetPreparedPlayer(StreamingSource); player.Start(); 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 8dd825c..a26094e 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Constants.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/Constants.cs @@ -2,8 +2,6 @@ using Tizen.Multimedia; internal static class Constants { - private const string StreamingUrl = "http://content.bitsontherun.com/videos/ntPYsD4L-1ahmry41.mp4"; - internal const int StreamingVideoLength = 596000; internal const int AudioLength = 33384; @@ -18,7 +16,5 @@ 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/PreconditionUtil.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs index a3d8fd1..11e78f6 100644 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs @@ -18,7 +18,7 @@ using NUnit.Framework.TUnit; using System; using System.IO; -namespace PreconditionUtils +namespace Tizen.Multimedia.Tests { public class PreconditionUtils { diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/TestSources.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/TestSources.cs index ca3798f..c964bf4 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/TestSources.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/TestSources.cs @@ -15,7 +15,6 @@ public static class TestSources if (video) { yield return Constants.VideoFileSource; - yield return Constants.StreamingSource; yield return new MediaBufferSource(File.ReadAllBytes(Constants.VideoFilePath)); } @@ -25,4 +24,4 @@ public static class TestSources yield return new MediaBufferSource(File.ReadAllBytes(Constants.AudioFilePath)); } } -} \ No newline at end of file +} -- 2.7.4