[Bluetooth][Non-ACR] Fix BluetoothAudio instance creating issue 26/257826/1
authorWootak Jung <wootak.jung@samsung.com>
Tue, 4 May 2021 00:05:33 +0000 (09:05 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 4 May 2021 00:05:33 +0000 (09:05 +0900)
Change-Id: I9f279b68df92cfc06522df26c17b605a8668849c
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine4_Device.cs

index 433eb72..92d2fd2 100644 (file)
@@ -20,6 +20,8 @@ namespace Tizen.Network.Bluetooth.Tests
         static BluetoothDevice foundDevice = null;
         static BluetoothDevice bondedDevice = null;
         static bool isBluetoothSupported = false;
+        static bool isBluetoothAudioCallSupported = false;
+        static bool isBluetoothAudioMediaSupported = false;
         static string remote_addr = PreconditionUtils.GetBtAddress();
 
         static bool pass_GetMaskFromUuid_RETURN_SERVICE_MASK = false;
@@ -75,6 +77,8 @@ namespace Tizen.Network.Bluetooth.Tests
         {
             LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
             Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
+            Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.call", out isBluetoothAudioCallSupported);
+            Information.TryGetValue("http://tizen.org/feature/network.bluetooth.audio.media", out isBluetoothAudioMediaSupported);
             flagDiscovery = false;
         }
         [TearDown]
@@ -412,8 +416,12 @@ namespace Tizen.Network.Bluetooth.Tests
                 pass_ManufacturerData_PROPERTY_READ_ONLY = true;
 
                 /* PASS condition for pass_GetProfile_RETURN_GET_INSTANCE */
-                BluetoothAudio audioObject = bondedDevice.GetProfile<BluetoothAudio>();
-                Assert.IsNotNull(audioObject, "AudioObject should not be null after getting the instance from GetProfile");
+                // In order to create BluetoothAudio instance, one of audio.call and audio.media features should be supported.
+                if (isBluetoothAudioCallSupported == true || isBluetoothAudioMediaSupported == true)
+                {
+                    BluetoothAudio audioObject = bondedDevice.GetProfile<BluetoothAudio>();
+                    Assert.IsNotNull(audioObject, "AudioObject should not be null after getting the instance from GetProfile");
+                }
 
                 BluetoothAvrcp avrcpObject = bondedDevice.GetProfile<BluetoothAvrcp>();
                 Assert.IsNotNull(avrcpObject, "AvrcpObject should not be null after getting the instance from GetProfile");