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;
+ private static bool _isBluetoothAudioControlSupported = false;
+ private static bool _isPositionPropertyReadPassed = false;
+ private static bool _isPlayStatePropertyReadPassed = false;
+ private static bool _isTrackDataPropertyReadPassed = false;
+ private static bool _isIsConnectedPropertyReadPassed = false;
+ private static bool _isRemoteAddressPropertyReadPassed = false;
[SetUp]
public void Init()
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();
};
_avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
- _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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();
};
_avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
- _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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();
};
_avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
- _audioProfile.Connect(BluetoothAudioProfileType.AdvancedAudioDistributionSink);
+ await _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
{
try
{
- uint originValue = 0;
-
/* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
if (_isBluetoothAudioControlSupported == false)
{
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();
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 _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.PositionChanged -= PositionChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
{
try
{
- uint originValue = 0;
-
/* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
if (_isBluetoothAudioControlSupported == false)
{
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();
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 _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.PositionChanged -= PositionChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
{
try
{
- PlayerState originValue = 0;
-
/* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
if (_isBluetoothAudioControlSupported == false)
{
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();
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 _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.PlayStateChanged -= PlayStateChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
{
try
{
- PlayerState originValue = 0;
-
/* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
if (_isBluetoothAudioControlSupported == false)
{
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();
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 _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.PlayStateChanged -= PlayStateChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
{
try
{
- Track originValue = new Track();
-
/* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
if (_isBluetoothAudioControlSupported == false)
{
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();
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 _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.TrackInfoChanged -= TrackInfoChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
{
try
{
- Track originValue = new Track();
-
/* We can't occupy the precondition, if AvrcpControl feature is not supported in Manual TC */
if (_isBluetoothAudioControlSupported == false)
{
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();
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 _avrcpControlProfile.ConnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.TrackInfoChanged -= TrackInfoChanged;
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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) => {
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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
+ if (e.IsConnected == false)
+ {
+ BluetoothHelper.DisplayPassLabel("DisconnectAsync_AVRCP_CONTROL_DISCONNECTION_TEST");
+ }
};
_avrcpControlProfile.ConnectionStateChanged += ControlConnectionChanged;
+ await _avrcpControlProfile.ConnectAsync();
+ await Task.Delay(3000);
await _avrcpControlProfile.DisconnectAsync();
await ManualTest.WaitForConfirm();
_avrcpControlProfile.ConnectionStateChanged -= ControlConnectionChanged;
{
Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
}
- finally
- {
- if (_audioProfile != null)
- {
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
- }
- }
}
[Test]
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.ConnectAsync();
PlayerState state = _avrcpControlProfile.GetPlayStatus();
bool result = Enum.IsDefined(typeof(PlayerState), state);
Assert.True(result, "State value is not defined in enum");
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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.ConnectAsync();
uint state = _avrcpControlProfile.GetPosition();
Assert.IsInstanceOf<uint>(state, "State value is not of type uint");
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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.ConnectAsync();
_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)
{
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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.ConnectAsync();
_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)
{
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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.ConnectAsync();
_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)
{
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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.ConnectAsync();
_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)
{
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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.ConnectAsync();
Track track = _avrcpControlProfile.GetTrackInfo();
Assert.IsInstanceOf<Track>(track, "track value is not of type Track");
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}
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);
+ await _avrcpControlProfile.ConnectAsync();
_avrcpControlProfile.SendPlayerCommand(PlayerCommand.Next);
//If there is no exception when method is called, the test is considered PASSED.
}
}
finally
{
- if (_audioProfile != null)
+ if (_avrcpControlProfile != null)
{
- _audioProfile.Disconnect(BluetoothAudioProfileType.All);
- await Task.Delay(3000);
+ await _avrcpControlProfile.DisconnectAsync();
}
}
}