[Test]
[Category("P2")]
- [Description("SetPlayPositionAsync throws if the player is in the idle state")]
+ [Description("SetPlayPositionAsync throws exception if the player is in the idle state")]
[Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionAsync M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MEX")]
[Test]
[Category("P2")]
- [Description("SetPlayPositionAsync throws if the specified position is invalid")]
+ [Description("SetPlayPositionAsync throws exception if the specified position is invalid")]
[Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionAsync M")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
+ [Property("CRITERIA", "MAR")]
[Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
public async Task SetPlayPositionAsync_GREATER_THAN_LIMIT()
{
[Test]
[Category("P2")]
- [Description("SetPlayPositionAsync throws if the specified position is invalid")]
+ [Description("SetPlayPositionAsync throws exception if the specified position is invalid")]
[Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionAsync M")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
+ [Property("CRITERIA", "MAR")]
[Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
public async Task SetPlayPositionAsync_LESS_THAN_ZERO()
{
Assert.That(() => task, Throws.TypeOf<ArgumentOutOfRangeException>());
}
+ [Test]
+ [Category("P1")]
+ [Description("GetPlayPosition test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.GetPlayPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task GetPlayPositionNanoseconds_CHECK()
+ {
+ var player = await GetPreparedPlayer();
+
+ Assert.That(player.GetPlayPositionNanoseconds(), Is.Zero);
+
+ await player.SetPlayPositionNanosecondsAsync(5000, true);
+
+ Assert.That(player.GetPlayPositionNanoseconds(), Is.EqualTo(5000));
+
+ await player.SetPlayPositionNanosecondsAsync(15000, true);
+
+ Assert.That(player.GetPlayPositionNanoseconds(), Is.EqualTo(15000));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Any attempt to access the GetPlayPositionNanoseconds if the player has been disposed of")]
+ [Property("SPEC", "Tizen.Multimedia.Player.GetPlayPositionNanoseconds M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void GetPlayPositionNanoseconds_DISPOSED()
+ {
+ GetIdlePlayer().Dispose();
+
+ Assert.That(() => TestPlayer.GetPlayPositionNanoseconds(),
+ Throws.TypeOf<ObjectDisposedException>());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("GetPlayPositionNanoseconds throws exception if the player is in the idle state")]
+ [Property("SPEC", "Tizen.Multimedia.Player.GetPlayPositionNanoseconds M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void GetPlayPositionNanoseconds_THROWS_IN_IDLE_STATE()
+ {
+ Assert.That(() => TestPlayer.GetPlayPositionNanoseconds(), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("SetPlayPositionNanosecondsAsync without accuracy")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionNanosecondsAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task SetPlayPositionNanosecondsAsync_INACCURATE()
+ {
+ var player = await GetPreparedPlayer();
+
+ const int targetPos = 700000;
+
+ await player.SetPlayPositionNanosecondsAsync(targetPos, false);
+
+ Assert.That(Math.Abs(targetPos - player.GetPlayPositionNanoseconds()), Is.LessThan(100000),
+ "The difference is too big.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("SetPlayPositionNanosecondsAsync with accuracy")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionNanosecondsAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task SetPlayPositionNanosecondsAsync_ACCURATE()
+ {
+ var player = await GetPreparedPlayer();
+
+ const int targetPos = 700000;
+
+ await player.SetPlayPositionNanosecondsAsync(targetPos, true);
+
+ Assert.That(player.GetPlayPositionNanoseconds(), Is.EqualTo(targetPos));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Any attempt to access the SetPlayPositionNanosecondsAsync if the player has been disposed of")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionNanosecondsAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetPlayPositionNanosecondsAsync_DISPOSED()
+ {
+ GetIdlePlayer().Dispose();
+
+ Assert.That(() => TestPlayer.SetPlayPositionNanosecondsAsync(15, false),
+ Throws.TypeOf<ObjectDisposedException>());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SetPlayPositionNanosecondsAsync throws exception if the player is in the idle state")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionNanosecondsAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task SetPlayPositionNanosecondsAsync_THROWS_IN_IDLE_STATE()
+ {
+ var task = await AsyncWrapper.Wrap(() => TestPlayer.SetPlayPositionNanosecondsAsync(0, true));
+
+ Assert.That(() => task, Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SetPlayPositionNanosecondsAsync throws exception if the specified position is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionNanosecondsAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MAR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task SetPlayPositionNanosecondsAsync_GREATER_THAN_LIMIT()
+ {
+ var player = await GetPreparedPlayer();
+
+ var task = await AsyncWrapper.Wrap(() => player.SetPlayPositionNanosecondsAsync(40000000000, false));
+
+ Assert.That(() => task, Throws.TypeOf<ArgumentOutOfRangeException>());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SetPlayPositionNanosecondsAsync throws exception if the specified position is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetPlayPositionNanosecondsAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MAR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task SetPlayPositionNanosecondsAsync_LESS_THAN_ZERO()
+ {
+ var player = await GetPreparedPlayer();
+
+ var task = await AsyncWrapper.Wrap(() => player.SetPlayPositionNanosecondsAsync(-1, false));
+
+ Assert.That(() => task, Throws.TypeOf<ArgumentOutOfRangeException>());
+ }
+
#endregion
#region Subtitle
{
public const string Codec = "MPEG-1 Layer 3 (MP3)";
public const int Duration = 33380;
+ public const long DurationNanoseconds = 33380000000;
public const int SampleRate = 22050;
public const int Channels = 2;
public const int BitRate = 128012;
[Test]
[Category("P1")]
+ [Description("Duration returns the length of the media")]
+ [Property("SPEC", "Tizen.Multimedia.StreamInfo.GetDurationNanoseconds M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task GetDurationNanoseconds_CHECK_RETURN()
+ {
+ var streamInfo = await GetAudioStreamInfo();
+
+ Assert.That(Math.Abs(ExpectedValues.DurationNanoseconds - streamInfo.GetDurationNanoseconds()),
+ Is.LessThan(10000000));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Any attempt to access the GetDurationNanoseconds if the player has been disposed of")]
+ [Property("SPEC", "Tizen.Multimedia.StreamInfo.GetDurationNanoseconds M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void GetDurationNanoseconds_DISPOSED()
+ {
+ GetIdlePlayer().Dispose();
+
+ Assert.That(() => TestPlayer.StreamInfo.GetDurationNanoseconds(),
+ Throws.TypeOf<ObjectDisposedException>());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("GetDurationNanoseconds throws exception if the player is in the idle state")]
+ [Property("SPEC", "Tizen.Multimedia.StreamInfo.GetDurationNanoseconds M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void GetDurationNanoseconds_THROWS_IN_IDLE_STATE()
+ {
+ Assert.That(() => TestPlayer.StreamInfo.GetDurationNanoseconds(), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
[Description("AudioStreamProperties returns audio stream info")]
[Property("SPEC", "Tizen.Multimedia.StreamInfo.GetAudioProperties M")]
[Property("SPEC_URL", "-")]