From 8478d518d4f4546085474fe9cdd45ac674519024 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Wed, 9 Dec 2020 09:54:19 +0900 Subject: [PATCH] [Bluetooth][Manual][Non-ACR] Make combine TC for Avrcp Change-Id: I18202c27c42d84e0a7bd1041b16f6b29b39d3653 Signed-off-by: DoHyun Pyun --- .../testcase/TSBluetoothAvrcp.cs | 1307 -------------------- .../testcase/TSBluetoothCombine4_Avrcp.cs | 693 +++++++++++ .../testcase/TSBluetoothHelper.cs | 6 + 3 files changed, 699 insertions(+), 1307 deletions(-) delete mode 100644 tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs create mode 100644 tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine4_Avrcp.cs diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs deleted file mode 100644 index b3153d8..0000000 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothAvrcp.cs +++ /dev/null @@ -1,1307 +0,0 @@ -using System; -using System.Threading.Tasks; -using BluetoothNetworkUtils; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.System; -using Xamarin.Forms; - -namespace Tizen.Network.Bluetooth.Tests -{ - [TestFixture] - [Description("BluetoothAvrcp Tests")] - public class BluetoothAvrcpTests - { - static BluetoothAvrcp avrcpProfile = null; - static BluetoothAudio audioProfile = null; - static bool isBluetoothAudioControlSupported = false; - - [SetUp] - public static void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST"); - Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.controller", out isBluetoothAudioControlSupported); - } - - [TearDown] - public static void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST"); - } - - public static async Task Setup() - { - avrcpProfile = await BluetoothSetup.GetBluetoothAvrcpProfileUtil(); - audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.All); - if (audioProfile == null) - { - BluetoothHelper.DisplayLabel("The Audio Profile Not Supported"); - Assert.True(true, "Audio Profile is not supported, skip the test case"); - return; - } - } - - public static async Task ConnectSetup() - { - Assert.IsNotNull(avrcpProfile, "Precondition failed: Avrcp Profile should not be null"); - Assert.IsNotNull(audioProfile, "Precondition failed: Audio Profile should not be null"); - audioProfile.Connect(BluetoothAudioProfileType.HspHfp); - await Task.Delay(5000); - } - - [Test] - [Category("P1")] - [Description("Listen target connection state changed event")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.TargetConnectionStateChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task TargetConnectionStateChanged_CHECK_EVENT() - { - 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"); - } - - EventHandler EventHandlerTargetConnectionChanged = null; - - EventHandlerTargetConnectionChanged = (sender, e) => { - BluetoothHelper.DisplayPassLabel("TargetConnectionStateChanged_CHECK_EVENT"); - avrcpProfile.TargetConnectionStateChanged -= EventHandlerTargetConnectionChanged; - }; - - 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) - { - BluetoothHelper.DisplayLabel("TargetConnectionStateChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("TargetConnectionStateChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Listen ShuffleMode changed")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.ShuffleModeChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [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 ShuffleModeChanged_CHECK_EVENT() - { - 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 EventHandlerShuffleModeChanged = null; - - EventHandlerShuffleModeChanged = (sender, e) => { - BluetoothHelper.DisplayPassLabel("ShuffleModeChanged_CHECK_EVENT"); - avrcpProfile.ShuffleModeChanged -= EventHandlerShuffleModeChanged; - }; - - avrcpProfile.ShuffleModeChanged += EventHandlerShuffleModeChanged; - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("ShuffleModeChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("ShuffleModeChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [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() - { - 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 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(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()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Listen ScanMode changed")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.ScanModeChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [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 ScanModeChanged_CHECK_EVENT() - { - 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 EventHandlerScanModeChanged = null; - - EventHandlerScanModeChanged = (sender, e) => { - BluetoothHelper.DisplayPassLabel("ScanModeChanged_CHECK_EVENT"); - avrcpProfile.ScanModeChanged -= EventHandlerScanModeChanged; - }; - - avrcpProfile.ScanModeChanged += EventHandlerScanModeChanged; - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("ScanModeChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("ScanModeChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [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() - { - 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 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(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()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Listen EqualizerState changed")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.EqualizerStateChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [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 EqualizerStateChanged_CHECK_EVENT() - { - 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 EventHandlerEqualizerStateChanged = null; - - EventHandlerEqualizerStateChanged = (sender, e) => { - BluetoothHelper.DisplayPassLabel("EqualizerStateChanged_CHECK_EVENT"); - avrcpProfile.EqualizerStateChanged -= EventHandlerEqualizerStateChanged; - }; - - avrcpProfile.EqualizerStateChanged += EventHandlerEqualizerStateChanged; - await ManualTest.WaitForConfirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("EqualizerStateChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("EqualizerStateChanged_CHECK_EVENT"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [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() - { - 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 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(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()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Listen RepeatMode changed")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.RepeatModeChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [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 RepeatModeChanged_CHECK_EVENT() - { - 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 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()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [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"); - } - - isAudioConnected = BluetoothSetup.IsBluetoothAudioProfileConnected(BluetoothAudioProfileType.All); - - if (isAudioConnected == false) - { - audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution); - await Task.Delay(3000); - } - - EventHandler 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(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) - { - 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()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify equalizer state to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyEqualizerState M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task NotifyEqualizerState_RETURN_VALUE_NOTIFY() - { - 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); - } - - avrcpProfile.NotifyEqualizerState(EqualizerState.On); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyEqualizerState_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyEqualizerState_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify repeat mode to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyRepeatMode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task NotifyRepeatMode_RETURN_VALUE_NOTIFY() - { - 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); - } - - avrcpProfile.NotifyRepeatMode(RepeatMode.AllTrack); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyRepeatMode_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyRepeatMode_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify shuffle mode to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyShuffleMode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task NotifyShuffleMode_RETURN_VALUE_NOTIFY() - { - 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); - } - - avrcpProfile.NotifyShuffleMode(ShuffleMode.AllTrack); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyShuffleMode_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyShuffleMode_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify scan mode to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyScanMode M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task NotifyScanMode_RETURN_VALUE_NOTIFY() - { - 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); - } - - avrcpProfile.NotifyScanMode(ScanMode.AllTrack); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyScanMode_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyScanMode_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify player state to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyPlayerState M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task NotifyPlayerState_RETURN_VALUE_NOTIFY() - { - 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); - } - - avrcpProfile.NotifyPlayerState(PlayerState.Playing); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyPlayerState_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyPlayerState_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify current position to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyCurrentPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [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 (isAudioConnected == false) - { - audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution); - await Task.Delay(3000); - } - - avrcpProfile.NotifyCurrentPosition(position); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyCurrentPosition_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyCurrentPosition_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - - [Test] - [Category("P1")] - [Description("Notify track data to remote device")] - [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyTrack M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] - [Precondition(1, "Turn on the bluetooth")] - [Precondition(2, "Paired with BT headset.")] - [Step(1, "Tap the Run button")] - [Postcondition(1, "NA")] - public static async Task NotifyTrack_RETURN_VALUE_NOTIFY() - { - try - { - 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; - - 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); - } - - avrcpProfile.NotifyTrack(track); - - // This testcase is for Method return. If there is no excception to call the method, then TC is passed. - - ManualTest.Confirm(); - } - catch (NotSupportedException) - { - if (isBluetoothAudioControlSupported == false) - { - BluetoothHelper.DisplayLabel("NotifyTrack_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (TypeInitializationException e) - { - if (isBluetoothAudioControlSupported == false && e.InnerException.GetType() == typeof(NotSupportedException)) - { - BluetoothHelper.DisplayLabel("NotifyTrack_RETURN_VALUE_NOTIFY"); - await ManualTest.WaitForConfirm(); - } - } - catch (Exception ex) - { - Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); - } - finally - { - if (audioProfile != null) - { - audioProfile.Disconnect(BluetoothAudioProfileType.All); - await Task.Delay(3000); - } - } - } - } -} diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine4_Avrcp.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine4_Avrcp.cs new file mode 100644 index 0000000..c312f51 --- /dev/null +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine4_Avrcp.cs @@ -0,0 +1,693 @@ +using System; +using System.Threading.Tasks; +using BluetoothNetworkUtils; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.System; +using Xamarin.Forms; + +namespace Tizen.Network.Bluetooth.Tests +{ + [TestFixture] + [Description("BluetoothAvrcp Tests")] + public class BluetoothAvrcpTests + { + BluetoothAvrcp avrcpProfile = null; + BluetoothAudio audioProfile = null; + bool isBluetoothAudioMediaSupported = false; + + /* PASS flag Variaibles for TCs */ + static bool pass_TargetConnectionStateChanged_CHECK_EVENT = false; + static bool pass_NotifyEqualizerState_RETURN_VALUE_NOTIFY = false; + static bool pass_NotifyRepeatMode_RETURN_VALUE_NOTIFY = false; + static bool pass_NotifyShuffleMode_RETURN_VALUE_NOTIFY = false; + static bool pass_NotifyScanMode_RETURN_VALUE_NOTIFY = false; + static bool pass_NotifyPlayerState_RETURN_VALUE_NOTIFY = false; + static bool pass_NotifyCurrentPosition_RETURN_VALUE_NOTIFY = false; + static bool pass_NotifyTrack_RETURN_VALUE_NOTIFY = false; + static bool pass_ShuffleModeChanged_CHECK_EVENT = false; + static bool pass_Mode_ShuffleModeChangedeventArgs_READ_ONLY = false; + static bool pass_ScanModeChanged_CHECK_EVENT = false; + static bool pass_Mode_ScanModeChangedEventArgs_READ_ONLY = false; + static bool pass_EqualizerStateChanged_CHECK_EVENT = false; + static bool pass_State_EqualizerStateChangedEventArgs_READ_ONLY = false; + static bool pass_RepeatModeChanged_CHECK_EVENT = false; + static bool pass_Mode_RepeatModeChangedEventArgs_READ_ONLY = false; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST"); + Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.media", out isBluetoothAudioMediaSupported); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST"); + } + + public async Task AvrcpCombine_TEST() + { + 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 == true) + { + audioProfile.Disconnect(BluetoothAudioProfileType.AdvancedAudioDistribution); + await Task.Delay(2000); + } + + EventHandler EventHandlerTargetConnectionChanged = null; + + EventHandlerTargetConnectionChanged = (sender, e) => { + /* PASS condition for TargetConnectionStateChanged_CHECK_EVENT */ + pass_TargetConnectionStateChanged_CHECK_EVENT = true; + avrcpProfile.TargetConnectionStateChanged -= EventHandlerTargetConnectionChanged; + + BluetoothHelper.DisplayCustomLabel("BT Headset is connected.\n Please type AVRCP command on sdb shell"); + }; + + avrcpProfile.TargetConnectionStateChanged += EventHandlerTargetConnectionChanged; + + audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution); + await Task.Delay(3000); + + /* PASS condition for NotifyEqualizerState_RETURN_VALUE_NOTIFY */ + avrcpProfile.NotifyEqualizerState(EqualizerState.On); + pass_NotifyEqualizerState_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for NotifyRepeatMode_RETURN_VALUE_NOTIFY */ + avrcpProfile.NotifyRepeatMode(RepeatMode.AllTrack); + pass_NotifyRepeatMode_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for NotifyShuffleMode_RETURN_VALUE_NOTIFY */ + avrcpProfile.NotifyShuffleMode(ShuffleMode.AllTrack); + pass_NotifyShuffleMode_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for NotifyScanMode_RETURN_VALUE_NOTIFY */ + avrcpProfile.NotifyScanMode(ScanMode.AllTrack); + pass_NotifyScanMode_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for NotifyPlayerState_RETURN_VALUE_NOTIFY */ + avrcpProfile.NotifyPlayerState(PlayerState.Playing); + pass_NotifyPlayerState_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for NotifyCurrentPosition_RETURN_VALUE_NOTIFY */ + avrcpProfile.NotifyCurrentPosition(0); + pass_NotifyCurrentPosition_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for NotifyTrack_RETURN_VALUE_NOTIFY */ + 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; + + avrcpProfile.NotifyTrack(track); + pass_NotifyTrack_RETURN_VALUE_NOTIFY = true; + + /* PASS condition for ShuffleModeChanged_CHECK_EVENT */ + EventHandler EventHandlerShuffleModeChanged = null; + + EventHandlerShuffleModeChanged = (sender, e) => { + pass_ShuffleModeChanged_CHECK_EVENT = true; + + /* PASS condition for Mode_ShuffleModeChangedeventArgs_READ_ONLY */ + bool result = Enum.IsDefined(typeof(ShuffleMode), e.Mode); + Assert.True(result, "Mode value is not defined in enum"); + Assert.IsInstanceOf(e.Mode, "Mode value is not of type ShuffleMode"); + pass_Mode_ShuffleModeChangedeventArgs_READ_ONLY = true; + + if (pass_ShuffleModeChanged_CHECK_EVENT == true && + pass_ScanModeChanged_CHECK_EVENT == true && + pass_EqualizerStateChanged_CHECK_EVENT == true && + pass_RepeatModeChanged_CHECK_EVENT == true) + BluetoothHelper.DisplayPassLabel("AvrcpCombine_TEST"); + + avrcpProfile.ShuffleModeChanged -= EventHandlerShuffleModeChanged; + }; + + avrcpProfile.ShuffleModeChanged += EventHandlerShuffleModeChanged; + + /* PASS condition for ScanModeChanged_CHECK_EVENT */ + EventHandler EventHandlerScanModeChanged = null; + + EventHandlerScanModeChanged = (sender, e) => { + pass_ScanModeChanged_CHECK_EVENT = true; + + /* PASS condition for Mode_ScanModeChangedEventArgs_READ_ONLY */ + bool result = Enum.IsDefined(typeof(ScanMode), e.Mode); + Assert.True(result, "Mode value is not defined in enum"); + Assert.IsInstanceOf(e.Mode, "Mode value is not of type ScanMode"); + pass_Mode_ScanModeChangedEventArgs_READ_ONLY = true; + + if (pass_ShuffleModeChanged_CHECK_EVENT == true && + pass_ScanModeChanged_CHECK_EVENT == true && + pass_EqualizerStateChanged_CHECK_EVENT == true && + pass_RepeatModeChanged_CHECK_EVENT == true) + BluetoothHelper.DisplayPassLabel("AvrcpCombine_TEST"); + + avrcpProfile.ScanModeChanged -= EventHandlerScanModeChanged; + }; + + avrcpProfile.ScanModeChanged += EventHandlerScanModeChanged; + + /* PASS condition for EqualizerStateChanged_CHECK_EVENT */ + EventHandler EventHandlerEqualizerStateChanged = null; + + EventHandlerEqualizerStateChanged = (sender, e) => { + pass_EqualizerStateChanged_CHECK_EVENT = true; + + /* PASS condition for State_EqualizerStateChangedEventArgs_READ_ONLY */ + bool result = Enum.IsDefined(typeof(EqualizerState), e.State); + Assert.True(result, "State value is not defined in enum"); + Assert.IsInstanceOf(e.State, "State value is not of type EqualizerState"); + pass_State_EqualizerStateChangedEventArgs_READ_ONLY = true; + + if (pass_ShuffleModeChanged_CHECK_EVENT == true && + pass_ScanModeChanged_CHECK_EVENT == true && + pass_EqualizerStateChanged_CHECK_EVENT == true && + pass_RepeatModeChanged_CHECK_EVENT == true) + BluetoothHelper.DisplayPassLabel("AvrcpCombine_TEST"); + + avrcpProfile.EqualizerStateChanged -= EventHandlerEqualizerStateChanged; + }; + + avrcpProfile.EqualizerStateChanged += EventHandlerEqualizerStateChanged; + + /* PASS condition for RepeatModeChanged_CHECK_EVENT */ + EventHandler EventHandlerRepeatModeChanged = null; + + EventHandlerRepeatModeChanged = (sender, e) => { + pass_RepeatModeChanged_CHECK_EVENT = true; + + /* PASS condition for Mode_RepeatModeChangedEventArgs_READ_ONLY */ + bool result = Enum.IsDefined(typeof(RepeatMode), e.Mode); + Assert.True(result, "Mode value is not defined in enum"); + Assert.IsInstanceOf(e.Mode, "Mode value is not of type RepeatMode"); + pass_Mode_RepeatModeChangedEventArgs_READ_ONLY = true; + + if (pass_ShuffleModeChanged_CHECK_EVENT == true && + pass_ScanModeChanged_CHECK_EVENT == true && + pass_EqualizerStateChanged_CHECK_EVENT == true && + pass_RepeatModeChanged_CHECK_EVENT == true) + BluetoothHelper.DisplayPassLabel("AvrcpCombine_TEST"); + + avrcpProfile.RepeatModeChanged -= EventHandlerRepeatModeChanged; + }; + + avrcpProfile.RepeatModeChanged += EventHandlerRepeatModeChanged; + await ManualTest.WaitForConfirm(); + } + catch (Exception ex) + { + Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); + } + finally + { + if (audioProfile != null) + { + audioProfile.Disconnect(BluetoothAudioProfileType.All); + await Task.Delay(2000); + } + } + } + + [Test] + [Category("P1")] + [Description("Listen target connection state changed event")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.TargetConnectionStateChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task TargetConnectionStateChanged_CHECK_EVENT() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("TargetConnectionStateChanged_CHECK_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_TargetConnectionStateChanged_CHECK_EVENT == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_TargetConnectionStateChanged_CHECK_EVENT, "[TestCase][TargetConnectionStateChanged_CHECK_EVENT] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify equalizer state to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyEqualizerState M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyEqualizerState_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyEqualizerState_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyEqualizerState_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyEqualizerState_RETURN_VALUE_NOTIFY, "[TestCase][NotifyEqualizerState_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify repeat mode to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyRepeatMode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyRepeatMode_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyRepeatMode_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyRepeatMode_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyRepeatMode_RETURN_VALUE_NOTIFY, "[TestCase][NotifyRepeatMode_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify shuffle mode to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyShuffleMode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyShuffleMode_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyShuffleMode_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyShuffleMode_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyShuffleMode_RETURN_VALUE_NOTIFY, "[TestCase][NotifyShuffleMode_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify scan mode to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyScanMode M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyScanMode_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyScanMode_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyScanMode_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyScanMode_RETURN_VALUE_NOTIFY, "[TestCase][NotifyScanMode_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify player state to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyPlayerState M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyPlayerState_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyPlayerState_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyPlayerState_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyPlayerState_RETURN_VALUE_NOTIFY, "[TestCase][NotifyPlayerState_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify current position to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyCurrentPosition M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyCurrentPosition_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyCurrentPosition_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyCurrentPosition_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyCurrentPosition_RETURN_VALUE_NOTIFY, "[TestCase][NotifyCurrentPosition_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Notify track data to remote device")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.NotifyTrack M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")] + [Precondition(1, "Turn on the bluetooth")] + [Precondition(2, "Paired with BT headset.")] + [Step(1, "Tap the Run button")] + [Postcondition(1, "NA")] + public async Task NotifyTrack_RETURN_VALUE_NOTIFY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("NotifyTrack_RETURN_VALUE_NOTIFY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_NotifyTrack_RETURN_VALUE_NOTIFY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_NotifyTrack_RETURN_VALUE_NOTIFY, "[TestCase][NotifyTrack_RETURN_VALUE_NOTIFY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Listen ShuffleMode changed")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.ShuffleModeChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [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 async Task ShuffleModeChanged_CHECK_EVENT() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("ShuffleModeChanged_CHECK_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_ShuffleModeChanged_CHECK_EVENT == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_ShuffleModeChanged_CHECK_EVENT, "[TestCase][ShuffleModeChanged_CHECK_EVENT] Fail"); + } + + [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 async Task Mode_ShuffleModeChangedeventArgs_READ_ONLY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("Mode_ShuffleModeChangedeventArgs_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Mode_ShuffleModeChangedeventArgs_READ_ONLY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_Mode_ShuffleModeChangedeventArgs_READ_ONLY, "[TestCase][Mode_ShuffleModeChangedeventArgs_READ_ONLY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Listen ScanMode changed")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.ScanModeChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [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 async Task ScanModeChanged_CHECK_EVENT() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("ScanModeChanged_CHECK_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_ScanModeChanged_CHECK_EVENT == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_ScanModeChanged_CHECK_EVENT, "[TestCase][ScanModeChanged_CHECK_EVENT] Fail"); + } + + [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 async Task Mode_ScanModeChangedEventArgs_READ_ONLY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("Mode_ScanModeChangedEventArgs_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Mode_ScanModeChangedEventArgs_READ_ONLY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_Mode_ScanModeChangedEventArgs_READ_ONLY, "[TestCase][Mode_ScanModeChangedEventArgs_READ_ONLY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Listen EqualizerState changed")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.EqualizerStateChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [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 async Task EqualizerStateChanged_CHECK_EVENT() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("EqualizerStateChanged_CHECK_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_EqualizerStateChanged_CHECK_EVENT == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_EqualizerStateChanged_CHECK_EVENT, "[TestCase][EqualizerStateChanged_CHECK_EVENT] Fail"); + } + + [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 async Task State_EqualizerStateChangedEventArgs_READ_ONLY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("State_EqualizerStateChangedEventArgs_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_State_EqualizerStateChangedEventArgs_READ_ONLY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_State_EqualizerStateChangedEventArgs_READ_ONLY, "[TestCase][State_EqualizerStateChangedEventArgs_READ_ONLY] Fail"); + } + + [Test] + [Category("P1")] + [Description("Listen RepeatMode changed")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcp.RepeatModeChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [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 async Task RepeatModeChanged_CHECK_EVENT() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("RepeatModeChanged_CHECK_EVENT"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_RepeatModeChanged_CHECK_EVENT == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_RepeatModeChanged_CHECK_EVENT, "[TestCase][RepeatModeChanged_CHECK_EVENT] Fail"); + } + + [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 async Task Mode_RepeatModeChangedEventArgs_READ_ONLY() + { + /* We can't occupy the precondition, if AVRCP feature is not supported in Manual TC */ + if (isBluetoothAudioMediaSupported == false) + { + BluetoothHelper.DisplayLabel("Mode_RepeatModeChangedEventArgs_READ_ONLY"); + await ManualTest.WaitForConfirm(); + return; + } + + if (pass_Mode_RepeatModeChangedEventArgs_READ_ONLY == false) + await AvrcpCombine_TEST(); + + Assert.True(pass_Mode_RepeatModeChangedEventArgs_READ_ONLY, "[TestCase][Mode_RepeatModeChangedEventArgs_READ_ONLY] Fail"); + } + } +} diff --git a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothHelper.cs b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothHelper.cs index af35ad0..d1f195b 100755 --- a/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothHelper.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothHelper.cs @@ -31,6 +31,12 @@ namespace Tizen.Network.Bluetooth.Tests ManualTest.DisplayCustomLabel(msg + " is failed. \n Please re-run the testcase.\n"); } + // Create custom message method. + internal static void DisplayCustomLabel(String msg) + { + ManualTest.DisplayCustomLabel(msg); + } + // Create AppControl launch method internal static void LaunchVisiblityAppControl(String timeout) { -- 2.7.4