[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void ReplayGain_DEFAULT()
{
- Assert.That(TestPlayer.ReplayGain, Is.False);
+ bool checkEquals = false;
+ try
+ {
+ checkEquals = TestPlayer.ReplayGain.Equals(false);
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ Assert.That(checkEquals, Is.EqualTo(true));
+ }
}
[Test]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void ReplayGain_SET_GET()
{
- const bool newValue = true;
+ bool checkEquals = false;
+ try
+ {
+ const bool newValue = true;
- TestPlayer.ReplayGain = newValue;
- Assert.That(TestPlayer.ReplayGain, Is.EqualTo(newValue));
+ TestPlayer.ReplayGain = newValue;
+ checkEquals = TestPlayer.ReplayGain.Equals(newValue);
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ Assert.That(checkEquals, Is.EqualTo(true));
+ }
}
[Description("AudioPitchEnabled check default value")]
[Property("SPEC", "Tizen.Multimedia.Player.AudioPitchEnabled A")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PDV")]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void AudioPitchEnabled_DEFAULT()
{
- Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(false));
+ bool checkEquals = false;
+ try
+ {
+ checkEquals = TestPlayer.AudioPitchEnabled.Equals(false);
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ Assert.That(checkEquals, Is.EqualTo(true));
+ }
}
[Test]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void AudioPitchEnabled_CHECK()
{
- TestPlayer.AudioPitchEnabled = true;
- Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true));
+ try
+ {
+ TestPlayer.AudioPitchEnabled = true;
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true));
+ }
}
[Test]
[Description("AudioPitch check default value")]
[Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PDV")]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void AudioPitch_DEFAULT()
{
- TestPlayer.AudioPitchEnabled = true;
- Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1));
+ try
+ {
+ TestPlayer.AudioPitchEnabled = true;
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1));
+ }
}
[Test]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void AudioPitch_CHECK()
{
- const float value = 1.212F;
-
- TestPlayer.AudioPitchEnabled = true;
- TestPlayer.AudioPitch = value;
-
- Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+ try
+ {
+ TestPlayer.AudioPitchEnabled = true;
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ const float value = 1.212F;
+ TestPlayer.AudioPitch = value;
+ Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+ }
}
[Test]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void AudioPitch_MIN_VALUE()
{
- const float value = 0.5F;
-
- TestPlayer.AudioPitchEnabled = true;
- TestPlayer.AudioPitch = value;
-
- Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+ try
+ {
+ TestPlayer.AudioPitchEnabled = true;
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ const float value = 0.5F;
+ TestPlayer.AudioPitch = value;
+ Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+ }
}
[Test]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public void AudioPitch_MAX_VALUE()
{
- const float value = 2.0F;
-
- TestPlayer.AudioPitchEnabled = true;
- TestPlayer.AudioPitch = value;
-
- Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+ try
+ {
+ TestPlayer.AudioPitchEnabled = true;
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ finally
+ {
+ const float value = 2.0F;
+ TestPlayer.AudioPitch = value;
+ Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+ }
}
[Test]
public async Task AudioDataDecoded_CHECK()
{
var player = GetIdlePlayer();
-
player.SetSource(Constants.AudioFileSource);
- player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.NoSyncAndDeinterleave);
+
+ try
+ {
+ player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.NoSyncAndDeinterleave);
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
using (var eventWaiter = EventAwaiter<AudioDataDecodedEventArgs>.Create())
{
public async Task AudioDataDecoded_CHECK_WITHOUT_FORMAT()
{
var player = GetIdlePlayer();
-
player.SetSource(Constants.AudioFileSource);
- player.EnableExportingAudioData(null, PlayerAudioExtractOption.Default);
+
+ try
+ {
+ player.EnableExportingAudioData(null, PlayerAudioExtractOption.Default);
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
using (var eventWaiter = EventAwaiter<AudioDataDecodedEventArgs>.Create())
{
public void EnableExportingAudioData_CHECK()
{
var player = GetIdlePlayer();
- player.SetSource(Constants.AudioFileSource);
- Assert.That(() => player.EnableExportingAudioData(_audioFormat,PlayerAudioExtractOption.Default), Throws.Nothing);
- Assert.That(() => player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.NoSyncWithClock), Throws.Nothing);
- Assert.That(() => player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.Deinterleave), Throws.Nothing);
- Assert.That(() => player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.NoSyncAndDeinterleave), Throws.Nothing);
+ try
+ {
+ player.SetSource(Constants.AudioFileSource);
+
+ player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.Default);
+ player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.NoSyncWithClock);
+ player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.Deinterleave);
+ player.EnableExportingAudioData(_audioFormat, PlayerAudioExtractOption.NoSyncAndDeinterleave);
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = player.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ catch (Exception)
+ {
+ Assert.Fail("It should not throw exception.");
+ }
}
[Test]
[Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
public async Task DisableExportingAudioData_CHECK()
{
- var player = GetIdlePlayer();
- Assert.That(() => player.DisableExportingAudioData(), Throws.Nothing);
+ try
+ {
+ var player = GetIdlePlayer();
+ player.DisableExportingAudioData();
- player.SetSource(Constants.AudioFileSource);
- await player.PrepareAsync();
- Assert.That(() => player.DisableExportingAudioData(), Throws.Nothing);
+ player.SetSource(Constants.AudioFileSource);
+ await player.PrepareAsync();
+ player.DisableExportingAudioData();
+ }
+ catch (NotAvailableException)
+ {
+ CodecType codecType = TestPlayer.AudioCodecType;
+ if (codecType == CodecType.Hardware)
+ Assert.Pass($"It could be not available depending on the platform capabilities");
+ else
+ Assert.Fail($"exeption occurs even though software codec is used.");
+ }
+ catch (Exception)
+ {
+ Assert.Fail("It should not throw exception.");
+ }
}
[Test]
Assert.False(FeatureChecker.IsSupported(Features.AudioOffload), "NotSupportedException shouldn't be thrown.");
}
}
+
+ #region CodecType
+ [Test]
+ [Category("P1")]
+ [Description("Check AudioCodecType does not throw exceptions")]
+ [Property("SPEC", "Tizen.Multimedia.Player.AudioCodecType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void AudioCodecType_CHECK()
+ {
+ TestPlayer.AudioCodecType = CodecType.Software;
+ Assert.That(TestPlayer.AudioCodecType, Is.EqualTo(CodecType.Software));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("AudioCodecType throws exception if the player is in a not valid state")]
+ [Property("SPEC", "Tizen.Multimedia.Player.AudioCodecType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task AudioCodecType_THROWS_IF_NOT_VALID_STATE()
+ {
+ var player = await GetPreparedPlayer();
+ Assert.That(() => player.AudioCodecType = CodecType.Hardware, Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("AudioCodecType throw exception if the param is not valid")]
+ [Property("SPEC", "Tizen.Multimedia.Player.AudioCodecType M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void AudioCodecType_THROWS_IF_PARAM_NOT_VALID()
+ {
+ var player = GetIdlePlayer();
+ Assert.That(() => player.AudioCodecType = (CodecType)5, Throws.ArgumentException);
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Any attempt to access the AudioCodecType if the player has been disposed of")]
+ [Property("SPEC", "Tizen.Multimedia.Player.AudioCodecType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void AudioCodecType_DISPOSED()
+ {
+ GetIdlePlayer().Dispose();
+ Assert.That(() => TestPlayer.AudioCodecType = CodecType.Hardware, Throws.TypeOf<ObjectDisposedException>());
+ }
+ #endregion
}
}