From 7b05459e3cf7cb7ef17eee59e558f610b28b3900 Mon Sep 17 00:00:00 2001 From: hwx951322 Date: Tue, 2 Aug 2022 10:39:53 +0000 Subject: [PATCH] bluetoothble Signed-off-by: hwx951322 --- .../main/js/default/test/BluetoothBle.test.js | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js b/communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js index e75641be0..140976f54 100644 --- a/communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js +++ b/communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js @@ -685,7 +685,7 @@ describe('bluetoothhostTest', function() { desValue[0] = 11; let descriptor = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB', characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', - descriptorUuid: '00002902-0000-1000-8000-00805F9B34FB', + descriptorUuid: '00001830-0000-1000-8000-00805F9B34FB', descriptorValue: arrayBuffer}; descriptors[0] = descriptor; let characteristics = []; @@ -700,15 +700,31 @@ describe('bluetoothhostTest', function() { isPrimary: true, characteristics: characteristics, includeServices: []}; let ret = gattServer.addService(service); console.info('[bluetooth_js] bluetooth addService ret : ' + ret); - expect(ret).assertTrue(); - await sleep(3500); + expect(ret).assertEqual(false); + done(); + }) + + + /** + * @tc.number SUB_COMMUNACATION_bluetooth_GATT_REMOVE_SERVICE__0001 + * @tc.name testNotifyCharacteristicChanged + * @tc.desc Test NotifyCharacteristicChanged api. + * @tc.size MEDIUM + * @tc.type Function + * @tc.level Level 2 + */ + it('SUB_COMMUNACATION_bluetooth_GATT_REMOVE_SERVICE_0001', 0, async function (done) { + console.info('[bluetooth_js]removeService Start'); + await tryToEnableBt(); + let gattServer=bluetooth.BLE.createGattServer(); let ret1=gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB'); console.info('[bluetooth_js]removeService ret:'+ret1); - expect(ret1).assertTrue(); + expect(ret1).assertEqual(false); done(); }) - + + /** * @tc.number SUB_COMMUNACATION_bluetooth_GATT_NOTIFY_CHARA_CHANGED_0001 -- GitLab