--- /dev/null
+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("BluetoothAvrcpControl Tests")]
+ public class BluetoothAvrcpControlTests
+ {
+ private BluetoothAvrcpControl _avrcpControlProfile = null;
+ private BluetoothAudio _audioProfile = null;
+ private bool _isBluetoothAudioControlSupported = false;
+ private bool _isPositionPropertyReadPassed = false;
+ private bool _isPlayStatePropertyReadPassed = false;
+ private bool _isTrackDataPropertyReadPassed = false;
+ private bool _isIsConnectedPropertyReadPassed = false;
+ private bool _isRemoteAddressPropertyReadPassed = false;
+
+ [SetUp]
+ public 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 void Destroy()
+ {
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Listen control connection state changed event")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.ConnectionStateChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ConnectionStateChanged_CHECK_EVENT()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ConnectionStateChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<AvrcpControlConnectionChangedEventArgs> ControlConnectionChanged = null;
+
+ ControlConnectionChanged = (sender, e) => {
+ Assert.IsInstanceOf<bool>(e.IsConnected, "IsConnected value is not of type bool");
+ Assert.AreEqual(e.IsConnected, true, "IsConnected should be true");
+ _isIsConnectedPropertyReadPassed = true;
+ Assert.IsInstanceOf<string>(e.RemoteAddress, "RemoteAddress value is not of type string");
+ Assert.AreNotEqual(e.RemoteAddress, "", "RemoteAddress is invalid");
+ _isRemoteAddressPropertyReadPassed = true;
+ BluetoothHelper.DisplayPassLabel("ConnectionStateChanged_CHECK_EVENT");
+ };
+
+ _avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
+ }
+ 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 control connection state changed event")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.AvrcpControlConnectionChangedEventArgs.IsConnected A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task IsConnected_PROPERTY_READ_ONLY()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("IsConnected_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_isIsConnectedPropertyReadPassed == true)
+ {
+ BluetoothHelper.DisplayPassLabel("IsConnected_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<AvrcpControlConnectionChangedEventArgs> ControlConnectionChanged = null;
+
+ ControlConnectionChanged = (sender, e) => {
+ Assert.IsInstanceOf<bool>(e.IsConnected, "IsConnected value is not of type bool");
+ Assert.AreEqual(e.IsConnected, true, "IsConnected should be true");
+ BluetoothHelper.DisplayPassLabel("IsConnected_PROPERTY_READ_ONLY");
+ };
+
+ _avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
+ }
+ 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 control connection state changed event")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.AvrcpControlConnectionChangedEventArgs.RemoteAddress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task RemoteAddress_PROPERTY_READ_ONLY()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("RemoteAddress_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_isRemoteAddressPropertyReadPassed == true)
+ {
+ BluetoothHelper.DisplayPassLabel("RemoteAddress_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<AvrcpControlConnectionChangedEventArgs> ControlConnectionChanged = null;
+
+ ControlConnectionChanged = (sender, e) => {
+ Assert.IsInstanceOf<string>(e.RemoteAddress, "RemoteAddress value is not of type string");
+ Assert.AreNotEqual(e.RemoteAddress, "", "RemoteAddress is invalid");
+ BluetoothHelper.DisplayPassLabel("RemoteAddress_PROPERTY_READ_ONLY");
+ };
+
+ _avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
+ }
+ 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 Play Position Changed")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.PositionChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@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, "Change play position of a track by dragging seek bar on the target")]
+ [Postcondition(1, "NA")]
+ public async Task PositionChanged_CHECK_EVENT()
+ {
+ try
+ {
+ uint originValue = 0;
+
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("PositionChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<PositionChangedEventArgs> PositionChanged = null;
+
+ PositionChanged = (sender, e) =>
+ {
+ Assert.IsInstanceOf<uint>(e.Position, "Position value is not of type uint");
+ Assert.AreNotEqual(e.Position, originValue, "Position value is same original value");
+ _isPositionPropertyReadPassed = true;
+ BluetoothHelper.DisplayPassLabel("PositionChanged_CHECK_EVENT");
+ };
+
+ originValue = _avrcpControlProfile.GetPosition();
+ _avrcpControlProfile.PositionChanged += PositionChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.PositionChanged -= PositionChanged;
+ }
+ 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 Play Position Changed")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.PositionChangedEventArgs.Position A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@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, "Change play position of a track by dragging seek bar on the target")]
+ [Postcondition(1, "NA")]
+ public async Task Position_PROPERTY_READ_ONLY()
+ {
+ try
+ {
+ uint originValue = 0;
+
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Position_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_isPositionPropertyReadPassed == true)
+ {
+ BluetoothHelper.DisplayPassLabel("Position_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<PositionChangedEventArgs> PositionChanged = null;
+
+ PositionChanged = (sender, e) =>
+ {
+ Assert.IsInstanceOf<uint>(e.Position, "Position value is not of type uint");
+ Assert.AreNotEqual(e.Position, originValue, "Position value is same original value");
+ BluetoothHelper.DisplayPassLabel("Position_PROPERTY_READ_ONLY");
+ };
+
+ originValue = _avrcpControlProfile.GetPosition();
+ _avrcpControlProfile.PositionChanged += PositionChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.PositionChanged -= PositionChanged;
+ }
+ 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 PlayState changed")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.PlayStateChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@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, "Play/pause a track on the target")]
+ [Postcondition(1, "NA")]
+ public async Task PlayStateChanged_CHECK_EVENT()
+ {
+ try
+ {
+ PlayerState originValue = 0;
+
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("PlayStateChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<PlayStateChangedEventArgs> PlayStateChanged = null;
+
+ PlayStateChanged = (sender, e) =>
+ {
+ Assert.IsInstanceOf<PlayerState>(e.PlayState, "PlayState value is not of type PlayerState");
+ Assert.AreNotEqual(e.PlayState, originValue, "PlayState value is same original value");
+ _isPlayStatePropertyReadPassed = true;
+ BluetoothHelper.DisplayPassLabel("PlayStateChanged_CHECK_EVENT");
+ };
+
+ originValue = _avrcpControlProfile.GetPlayStatus();
+ _avrcpControlProfile.PlayStateChanged += PlayStateChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.PlayStateChanged -= PlayStateChanged;
+ }
+ 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 state has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.PlayStateChangedEventArgs.PlayState A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@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, "Play/pause a track on the target")]
+ [Postcondition(1, "NA")]
+ public async Task PlayState_PROPERTY_READ_ONLY()
+ {
+ try
+ {
+ PlayerState originValue = 0;
+
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("PlayState_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_isPlayStatePropertyReadPassed == true)
+ {
+ BluetoothHelper.DisplayPassLabel("PlayState_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<PlayStateChangedEventArgs> PlayStateChanged = null;
+
+ PlayStateChanged = (sender, e) =>
+ {
+ Assert.IsInstanceOf<PlayerState>(e.PlayState, "PlayState value is not of type PlayerState");
+ Assert.AreNotEqual(e.PlayState, originValue, "PlayState value is same original value");
+ BluetoothHelper.DisplayPassLabel("PlayState_PROPERTY_READ_ONLY");
+ };
+
+ originValue = _avrcpControlProfile.GetPlayStatus();
+ _avrcpControlProfile.PlayStateChanged += PlayStateChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.PlayStateChanged -= PlayStateChanged;
+ }
+ 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 Track Info changed")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.TrackInfoChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@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, "Change track on the target")]
+ [Postcondition(1, "NA")]
+ public async Task TrackInfoChanged_CHECK_EVENT()
+ {
+ try
+ {
+ Track originValue = new Track();
+
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("TrackInfoChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<TrackInfoChangedEventArgs> TrackInfoChanged = null;
+
+ TrackInfoChanged = (sender, e) =>
+ {
+ Assert.IsInstanceOf<Track>(e.TrackData, "TrackData value is not of type Track");
+ Assert.AreNotEqual(e.TrackData, originValue, "TrackData value is same original value");
+ _isTrackDataPropertyReadPassed = true;
+ BluetoothHelper.DisplayPassLabel("TrackInfoChanged_CHECK_EVENT");
+ };
+
+ originValue = _avrcpControlProfile.GetTrackInfo();
+ _avrcpControlProfile.TrackInfoChanged += TrackInfoChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.TrackInfoChanged -= TrackInfoChanged;
+ }
+ 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 Track Info changed")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.TrackInfoChangedEventArgs.TrackData A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@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, "Change track on the target")]
+ [Postcondition(1, "NA")]
+ public async Task TrackData_PROPERTY_READ_ONLY()
+ {
+ try
+ {
+ Track originValue = new Track();
+
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("TrackData_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_isTrackDataPropertyReadPassed == true)
+ {
+ BluetoothHelper.DisplayPassLabel("TrackData_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ EventHandler<TrackInfoChangedEventArgs> TrackInfoChanged = null;
+
+ TrackInfoChanged = (sender, e) =>
+ {
+ Assert.IsInstanceOf<Track>(e.TrackData, "TrackData value is not of type Track");
+ Assert.AreNotEqual(e.TrackData, originValue, "TrackData value is same original value");
+ BluetoothHelper.DisplayPassLabel("TrackData_PROPERTY_READ_ONLY");
+ };
+
+ originValue = _avrcpControlProfile.GetTrackInfo();
+ _avrcpControlProfile.TrackInfoChanged += TrackInfoChanged;
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.TrackInfoChanged -= TrackInfoChanged;
+ }
+ 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("Connect AVRCP Control")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.ConnectAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ConnectAsync_AVRCP_CONTROL_CONNECTION_TEST()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ConnectAsync_AVRCP_CONTROL_CONNECTION_TEST");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await _avrcpControlProfile.DisconnectAsync(); // Disconnecting AVRCP Control initially
+
+ EventHandler<AvrcpControlConnectionChangedEventArgs> ControlConnectionChanged = null;
+
+ ControlConnectionChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("ConnectAsync_AVRCP_CONTROL_CONNECTION_TEST");
+ };
+ _avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
+
+ await _avrcpControlProfile.ConnectAsync();
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
+ }
+ 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("Disconnect AVRCP Control")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.DisconnectAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task DisconnectAsync_AVRCP_CONTROL_DISCONNECTION_TEST()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("DisconnectAsync_AVRCP_CONTROL_DISCONNECTION_TEST");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+
+ EventHandler<AvrcpControlConnectionChangedEventArgs> ControlConnectionChanged = null;
+ ControlConnectionChanged = (sender, e) => {
+ BluetoothHelper.DisplayPassLabel("DisconnectAsync_AVRCP_CONTROL_DISCONNECTION_TEST");
+ _avrcpControlProfile.ConnectAsync(); //Reconnect AVRCP Control if TC passes
+ };
+ _avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
+
+ await _avrcpControlProfile.DisconnectAsync();
+ await ManualTest.WaitForConfirm();
+ _avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
+ }
+ 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("Get Play Status")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.GetPlayStatus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task GetPlayStatus_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetPlayStatus_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ PlayerState state = _avrcpControlProfile.GetPlayStatus();
+ bool result = Enum.IsDefined(typeof(PlayerState), state);
+ Assert.True(result, "State value is not defined in enum");
+ Assert.IsInstanceOf<PlayerState>(state, "State value is not of type PlayerState");
+ }
+ 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("Get Play Progress Position")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.GetPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task GetPosition_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetPosition_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ uint state = _avrcpControlProfile.GetPosition();
+ Assert.IsInstanceOf<uint>(state, "State value is not of type uint");
+ }
+ 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("Check whether EqualizerState is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.EqualizerState A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task EqualizerState_READ_WRITE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("EqualizerState_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ _avrcpControlProfile.EqualizerState = EqualizerState.On;
+ EqualizerState state = _avrcpControlProfile.EqualizerState;
+ Assert.IsInstanceOf<EqualizerState>(state, "State value is not of type EqualizerState");
+ Assert.AreEqual(state, EqualizerState.On, "EqualizerState is not matching");
+ }
+ 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("Check whether ShuffleMode is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.ShuffleMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ShuffleMode_READ_WRITE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ShuffleMode_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ _avrcpControlProfile.ShuffleMode = ShuffleMode.AllTrack;
+ ShuffleMode state = _avrcpControlProfile.ShuffleMode;
+ Assert.IsInstanceOf<ShuffleMode>(state, "Mode value is not of type ShuffleMode");
+ Assert.AreEqual(state, ShuffleMode.AllTrack, "ShuffleMode is not matching");
+ }
+ 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("Check whether ScanMode is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.ScanMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ScanMode_READ_WRITE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ScanMode_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ _avrcpControlProfile.ScanMode = ScanMode.AllTrack;
+ ScanMode state = _avrcpControlProfile.ScanMode;
+ Assert.IsInstanceOf<ScanMode>(state, "Mode value is not of type ScanMode");
+ Assert.AreEqual(state, ScanMode.AllTrack, "ScanMode is not matching");
+ }
+ 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("Check whether RepeatMode is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.RepeatMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task RepeatMode_READ_WRITE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("RepeatMode_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ _avrcpControlProfile.RepeatMode = RepeatMode.AllTrack;
+ RepeatMode state = _avrcpControlProfile.RepeatMode;
+ Assert.IsInstanceOf<RepeatMode>(state, "Mode value is not of type RepeatMode");
+ Assert.AreEqual(state, RepeatMode.AllTrack, "RepeatMode is not matching");
+ }
+ 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("Get Track Info")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.GetTrackInfo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task GetTrackInfo_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetTrackInfo_READ_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: _avrcpControlProfile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Track track = _avrcpControlProfile.GetTrackInfo();
+ Assert.IsInstanceOf<Track>(track, "track value is not of type Track");
+ }
+ 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("Send a specific player state command to the target")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAvrcpControl.SendPlayerCommand M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sudipto Bal, sudipto.bal@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with BT target device (phone, watch, etc).")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task SendPlayerCommand_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
+ if (_isBluetoothAudioControlSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("SendPlayerCommand_WRITE_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (_audioProfile == null)
+ {
+ _audioProfile = await BluetoothSetup.GetBluetoothAudioProfileUtil(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ Assert.IsNotNull(_audioProfile, "Precondtion failed: _audioProfile should not be null");
+ }
+
+ if (_avrcpControlProfile == null)
+ {
+ _avrcpControlProfile = await BluetoothSetup.GetBluetoothAvrcpControlProfileUtil();
+ Assert.IsNotNull(_avrcpControlProfile, "Precondtion failed: avrcpavrcpControlProfile Profile should not be null");
+ }
+
+ _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ _avrcpControlProfile.SendPlayerCommand(PlayerCommand.Next);
+ //If there is no exception when method is called, the test is considered PASSED.
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ finally
+ {
+ if (_audioProfile != null)
+ {
+ _audioProfile.Disconnect(BluetoothAudioProfileType.All);
+ await Task.Delay(3000);
+ }
+ }
+ }
+ }
+}