LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
}
- public static void EventHandlerTargetConnectionChanged(object sender, TargetConnectionStateChangedEventArgs e)
- {
- if (e.IsConnected)
- {
- Assert.True(e.IsConnected, "Target is not connected");
- ManualTest.Confirm();
- }
- }
-
public static async Task Setup()
{
avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
await Task.Delay(5000);
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Listen target connection state changed event")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.TargetConnectionStateChanged E")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task TargetConnectionStateChanged_CHECK_EVENT()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- Assert.IsNotNull(avrcpProfile, "Precondition failed: Avrcp Profile should not be null");
- Assert.IsNotNull(audioProfile, "Precondition failed: Audio Profile should not be null");
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
}
-
+
+ EventHandler<TargetConnectionStateChangedEventArgs> EventHandlerTargetConnectionChanged = null;
+
+ EventHandlerTargetConnectionChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("TargetConnectionStateChanged_CHECK_EVENT");
+ avrcpProfile.TargetConnectionStateChanged -= EventHandlerTargetConnectionChanged;
+ };
+
avrcpProfile.TargetConnectionStateChanged += EventHandlerTargetConnectionChanged;
- audioProfile.Connect(BluetoothAudioProfileType.HspHfp);
- await ManualTest.WaitForConfirm();
- // POSTCONDITION
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
- avrcpProfile.TargetConnectionStateChanged -= EventHandlerTargetConnectionChanged;
- }
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ else
+ audioProfile.Disconnect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+
+ await ManualTest.WaitForConfirm();
+ }
catch (NotSupportedException)
{
if (isBluetoothAudioControlSupported == false)
}
}
- public static void EventHandlerShuffleModeChanged(object sender, ShuffleModeChangedeventArgs e)
- {
- ManualTest.Confirm();
- }
-
-// [Test]
+ [Test]
[Category("P1")]
[Description("Listen ShuffleMode changed")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.ShuffleModeChanged E")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Step(2, "Change the shuffle mode in the connected bluetooth headset")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaShuffleStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
[Postcondition(1, "NA")]
public static async Task ShuffleModeChanged_CHECK_EVENT()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- await ConnectSetup();
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
}
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<ShuffleModeChangedeventArgs> EventHandlerShuffleModeChanged = null;
+
+ EventHandlerShuffleModeChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("ShuffleModeChanged_CHECK_EVENT");
+ avrcpProfile.ShuffleModeChanged -= EventHandlerShuffleModeChanged;
+ };
+
avrcpProfile.ShuffleModeChanged += EventHandlerShuffleModeChanged;
await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
- avrcpProfile.ShuffleModeChanged -= EventHandlerShuffleModeChanged;
- }
+ }
catch (NotSupportedException)
{
if (isBluetoothAudioControlSupported == false)
}
}
- public static void EventHandlerScanModeChanged(object sender, ScanModeChangedEventArgs e)
+ [Test]
+ [Category("P1")]
+ [Description("Test Mode. Check if Mode has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.ShuffleModeChangedeventArgs.Mode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaShuffleStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
+ [Postcondition(1, "NA")]
+ public static async Task Mode_ShuffleModeChangedeventArgs_READ_ONLY()
{
- ManualTest.Confirm();
+ try
+ {
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<ShuffleModeChangedeventArgs> EventHandlerShuffleModeChanged = null;
+
+ EventHandlerShuffleModeChanged = (sender, e) => {
+ bool result = Enum.IsDefined(typeof(ShuffleMode), e.Mode);
+ Assert.True(result, "Mode value is not defined in enum");
+ Assert.IsInstanceOf<ShuffleMode>(e.Mode, "Mode value is not of type ShuffleMode");
+
+ BluetoothHelper.DisplayPassLabel("ShuffleModeChangedeventArgs_Mode_READ_ONLY");
+ avrcpProfile.ShuffleModeChanged -= EventHandlerShuffleModeChanged;
+ };
+
+ avrcpProfile.ShuffleModeChanged += EventHandlerShuffleModeChanged;
+ await ManualTest.WaitForConfirm();
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ShuffleModeChangedeventArgs_Mode_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("ShuffleModeChangedeventArgs_Mode_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Listen ScanMode changed")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.ScanModeChanged E")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Step(2, "Change the scan mode in the connected bluetooth headset")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaScanStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
[Postcondition(1, "NA")]
public static async Task ScanModeChanged_CHECK_EVENT()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- await ConnectSetup();
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
}
-
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<ScanModeChangedEventArgs> EventHandlerScanModeChanged = null;
+
+ EventHandlerScanModeChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("ScanModeChanged_CHECK_EVENT");
+ avrcpProfile.ScanModeChanged -= EventHandlerScanModeChanged;
+ };
+
avrcpProfile.ScanModeChanged += EventHandlerScanModeChanged;
await ManualTest.WaitForConfirm();
-
- // POSTCONDITON
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
- avrcpProfile.ScanModeChanged -= EventHandlerScanModeChanged;
- }
+ }
catch (NotSupportedException)
{
if (isBluetoothAudioControlSupported == false)
catch (TypeInitializationException e)
{
if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
+ {
BluetoothHelper.DisplayLabel("ScanModeChanged_CHECK_EVENT");
await ManualTest.WaitForConfirm();
}
}
}
- public static void EventHandlerEqualizerStateChanged(object sender, EqualizerStateChangedEventArgs e)
+ [Test]
+ [Category("P1")]
+ [Description("Test Mode. Check if Mode has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.ScanModeChangedEventArgs.Mode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaScanStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
+ [Postcondition(1, "NA")]
+ public static async Task Mode_ScanModeChangedEventArgs_READ_ONLY()
{
- ManualTest.Confirm();
+ try
+ {
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<ScanModeChangedEventArgs> EventHandlerScanModeChanged = null;
+
+ EventHandlerScanModeChanged = (sender, e) => {
+ bool result = Enum.IsDefined(typeof(ScanMode), e.Mode);
+ Assert.True(result, "Mode value is not defined in enum");
+ Assert.IsInstanceOf<ScanMode>(e.Mode, "Mode value is not of type ScanMode");
+
+ BluetoothHelper.DisplayPassLabel("ScanModeChangedEventArgs_Mode_READ_ONLY");
+ avrcpProfile.ScanModeChanged -= EventHandlerScanModeChanged;
+ };
+
+ avrcpProfile.ScanModeChanged += EventHandlerScanModeChanged;
+ await ManualTest.WaitForConfirm();
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ScanModeChangedEventArgs_Mode_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("ScanModeChangedEventArgs_Mode_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Listen EqualizerState changed")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.EqualizerStateChanged E")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Step(2, "Change the equalizer state in the connected bluetooth headset")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaEqualizerStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
[Postcondition(1, "NA")]
public static async Task EqualizerStateChanged_CHECK_EVENT()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- await ConnectSetup();
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
}
- // TEST CODE
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<EqualizerStateChangedEventArgs> EventHandlerEqualizerStateChanged = null;
+
+ EventHandlerEqualizerStateChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("EqualizerStateChanged_CHECK_EVENT");
+ avrcpProfile.EqualizerStateChanged -= EventHandlerEqualizerStateChanged;
+ };
+
avrcpProfile.EqualizerStateChanged += EventHandlerEqualizerStateChanged;
await ManualTest.WaitForConfirm();
-
- // POSTCONDITON:
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
- avrcpProfile.EqualizerStateChanged -= EventHandlerEqualizerStateChanged;
- }
+ }
catch (NotSupportedException)
{
if (isBluetoothAudioControlSupported == false)
catch (TypeInitializationException e)
{
if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
+ {
BluetoothHelper.DisplayLabel("EqualizerStateChanged_CHECK_EVENT");
await ManualTest.WaitForConfirm();
}
}
}
- public static void EventHandlerRepeatModeChanged(object sender, RepeatModeChangedEventArgs e)
+ [Test]
+ [Category("P1")]
+ [Description("Test State. Check if State has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.EqualizerStateChangedEventArgs.State A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaEqualizerStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
+ [Postcondition(1, "NA")]
+ public static async Task State_EqualizerStateChangedEventArgs_READ_ONLY()
{
- ManualTest.Confirm();
+ try
+ {
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<EqualizerStateChangedEventArgs> EventHandlerEqualizerStateChanged = null;
+
+ EventHandlerEqualizerStateChanged = (sender, e) => {
+ bool result = Enum.IsDefined(typeof(EqualizerState), e.State);
+ Assert.True(result, "State value is not defined in enum");
+ Assert.IsInstanceOf<EqualizerState>(e.State, "State value is not of type EqualizerState");
+
+ BluetoothHelper.DisplayPassLabel("EqualizerStateChangedEventArgs_State_READ_ONLY");
+ avrcpProfile.EqualizerStateChanged -= EventHandlerEqualizerStateChanged;
+ };
+
+ avrcpProfile.EqualizerStateChanged += EventHandlerEqualizerStateChanged;
+ await ManualTest.WaitForConfirm();
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("EqualizerStateChangedEventArgs_State_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("EqualizerStateChangedEventArgs_State_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Listen RepeatMode changed")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.RepeatModeChanged E")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
[Step(1, "Tap the Run button")]
- [Step(2, "Change the repeat mode in the connected bluetooth headset")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaRepeatStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
[Postcondition(1, "NA")]
public static async Task RepeatModeChanged_CHECK_EVENT()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
{
- await Setup();
- await ConnectSetup();
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
-
- // TEST CODE
+
+ EventHandler<RepeatModeChangedEventArgs> EventHandlerRepeatModeChanged = null;
+
+ EventHandlerRepeatModeChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("RepeatModeChanged_CHECK_EVENT");
+ avrcpProfile.RepeatModeChanged -= EventHandlerRepeatModeChanged;
+ };
+
avrcpProfile.RepeatModeChanged += EventHandlerRepeatModeChanged;
await ManualTest.WaitForConfirm();
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("RepeatModeChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("RepeatModeChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Mode. Check the Mode value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.RepeatModeChangedEventArgs.Mode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT headset.")]
+ [Precondition(3, "Sdb is connected as root with the target. \n>sdb root on")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "Run next command in the linux shell.\n>sdb shell dbus-send --system --type=signal /org/projectx/bt/avrcp org.projectx.bt_event.MediaRepeatStatus uint32:1")]
+ [Step(3, "(Because there is no UX senario or entry point to invoke this event, so we should generate the event using command line to pass this TCT")]
+ [Postcondition(1, "NA")]
+ public static async Task Mode_RepeatModeChangedEventArgs_READ_ONLY()
+ {
+ try
+ {
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
- // POSTCONDITON:
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
- avrcpProfile.RepeatModeChanged -= EventHandlerRepeatModeChanged;
- }
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
+ }
+
+ EventHandler<RepeatModeChangedEventArgs> EventHandlerRepeatModeChanged = null;
+
+ EventHandlerRepeatModeChanged = (sender, e) => {
+ bool result = Enum.IsDefined(typeof(RepeatMode), e.Mode);
+ Assert.True(result, "Mode value is not defined in enum");
+ Assert.IsInstanceOf<RepeatMode>(e.Mode, "Mode value is not of type RepeatMode");
+
+ BluetoothHelper.DisplayPassLabel("RepeatModeChanged_CHECK_EVENT");
+ avrcpProfile.RepeatModeChanged -= EventHandlerRepeatModeChanged;
+ };
+
+ avrcpProfile.RepeatModeChanged += EventHandlerRepeatModeChanged;
+ await ManualTest.WaitForConfirm();
+ }
catch (NotSupportedException)
{
if (isBluetoothAudioControlSupported == false)
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify equalizer state to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyEqualizerState M")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task NotifyEqualizerState_RETURN_VALUE_NOTIFY()
{
try
{
- // PRECONDITION
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
{
- await Setup();
- await ConnectSetup();
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyEqualizerState(EqualizerState.On);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify repeat mode to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyRepeatMode M")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
- [Step(2, "Check if log show \"[TestCase][NotifyRepeatMode] Pass\".")]
[Postcondition(1, "NA")]
public static async Task NotifyRepeatMode_RETURN_VALUE_NOTIFY()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
{
- await Setup();
- await ConnectSetup();
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyRepeatMode(RepeatMode.AllTrack);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify shuffle mode to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyShuffleMode M")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task NotifyShuffleMode_RETURN_VALUE_NOTIFY()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- await ConnectSetup();
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyShuffleMode(ShuffleMode.AllTrack);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify scan mode to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyScanMode M")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task NotifyScanMode_RETURN_VALUE_NOTIFY()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- await ConnectSetup();
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyScanMode(ScanMode.AllTrack);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify player state to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyPlayerState M")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task NotifyPlayerState_RETURN_VALUE_NOTIFY()
{
try
{
- if (avrcpProfile == null || audioProfile == null)
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
{
- await Setup();
- await ConnectSetup();
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyPlayerState(PlayerState.Playing);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify current position to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyCurrentPosition M")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task NotifyCurrentPosition_RETURN_VALUE_NOTIFY()
try
{
uint position = 0;
+ bool isAudioConnected = false;
+
+ if (audioProfile == null)
+ {
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
- if (avrcpProfile == null || audioProfile == null)
+ if (isAudioConnected == false)
{
- await Setup();
- await ConnectSetup();
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyCurrentPosition(position);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{
}
}
-// [Test]
+ [Test]
[Category("P1")]
[Description("Notify track data to remote device")]
[Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyTrack M")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
[Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep discoverable bluetooth headset device near the test device.")]
+ [Precondition(2, "Paired with BT headset.")]
[Step(1, "Tap the Run button")]
[Postcondition(1, "NA")]
public static async Task NotifyTrack_RETURN_VALUE_NOTIFY()
{
try
{
- Track track = new Track();
+ bool isAudioConnected = false;
+ Track track = new Track();
- track.Title = "title";
- track.Artist = "artist";
- track.Album = "album";
- track.Genre = "genre";
- track.TrackNum = 5;
- track.TotalTracks = 6;
- track.Duration = 4000;
+ track.Title = "title";
+ track.Artist = "artist";
+ track.Album = "album";
+ track.Genre = "genre";
+ track.TrackNum = 5;
+ track.TotalTracks = 6;
+ track.Duration = 4000;
- if (avrcpProfile == null || audioProfile == null)
+ if (audioProfile == null)
{
- await Setup();
- await ConnectSetup();
+ audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ Assert.IsNotNull(audioProfile, "Precondtion failed: audioProfile should not be null");
+ }
+
+ if (avrcpProfile == null)
+ {
+ avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil();
+ Assert.IsNotNull(avrcpProfile, "Precondtion failed: avrcpProfile should not be null");
+ }
+
+ isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All);
+
+ if (isAudioConnected == false)
+ {
+ audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
+ await Task.Delay(3000);
}
avrcpProfile.NotifyTrack(track);
- BluetoothSetup.RemoveBluetoothDeviceProfileUtil();
+ // This testcase is for Method return. If there is no excception to call the method, then TC is passed.
+
+ ManualTest.Confirm();
}
catch (NotSupportedException)
{