-using NUnit.Framework;
+using NUnit.Framework;
using System.Threading.Tasks;
using System.Linq;
using System.Collections;
[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")]
[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.");
[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")]
[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);
}
[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);
[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)
[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")]
{
player.BufferingProgressChanged += eventWaiter;
- player.SetSource(StreamingSource);
+ player.SetSource(_streamingSource);
player.PrepareAsync();
[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();