diff --git a/communication/bluetooth_on/src/main/js/test/BluetoothOn.test.js b/communication/bluetooth_on/src/main/js/test/BluetoothOn.test.js index 0ca895761ac97dcfbce42987ed2f19c5f391e750..16ac1a07d277f2d0a0d102061d42e96db60a16dd 100644 --- a/communication/bluetooth_on/src/main/js/test/BluetoothOn.test.js +++ b/communication/bluetooth_on/src/main/js/test/BluetoothOn.test.js @@ -241,7 +241,7 @@ describe('bluetoothhostTest', function() { console.info('[bluetooth_js] BLE scan device find result1 = '+JSON.stringify(data)); except(true).assertTrue(data.length>0); } - bluetooth.BLE.on("BLEDeviceFind") + bluetooth.BLE.on("BLEDeviceFind",onReceiveEvent) bluetooth.BLE.startBLEScan([{}]); await sleep(1000); console.info('[bluetooth_js] BLE SCAN OFF01'); diff --git a/communication/bluetooth_profile/src/main/js/test/BluetoothHid.test.js b/communication/bluetooth_profile/src/main/js/test/BluetoothHid.test.js index 350b0e0460f9573b624f78afc5931cabf32e7290..886e23607834a6be779b8ad37350e35fdcd1d83e 100644 --- a/communication/bluetooth_profile/src/main/js/test/BluetoothHid.test.js +++ b/communication/bluetooth_profile/src/main/js/test/BluetoothHid.test.js @@ -16,7 +16,7 @@ import bluetooth from '@ohos.bluetooth'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -let hidHostProfile = bluetooth.getProfile(6); +let hidHostProfile = bluetooth.getProfileInst(6); function on(ON_VALUE_TEST_ELEMENT) { return new Promise((resolve, reject) => { @@ -109,7 +109,7 @@ describe('bluetoothhostTest_host_2', function () { it('SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_PROFILE_LOOP_0001', 0, async function (done) { console.info('[bluetooth_js] loop get profile start'); await tryToEnableBt(); - let proFile = bluetooth.getProfile(6); + let proFile = bluetooth.getProfileInst(6); console.info('[bluetooth_js] loop get profile result:' + JSON.stringify(proFile)); expect(proFile != null).assertEqual(true); done(); @@ -224,7 +224,6 @@ describe('bluetoothhostTest_host_2', function () { done(); }) -}) /** @@ -238,7 +237,7 @@ describe('bluetoothhostTest_host_2', function () { it('SUB_COMMUNACATION_bluetoothble_PANProfile_Tethering_0001', 0, async function (done) { await tryToEnableBt(); console.info('[bluetooth_js] tethering test start'); - let panProfile = bluetooth.getProfile(bluetooth.ProfileId.PROFILE_PAN_NETWORK); + let panProfile = bluetooth.getProfileInst(bluetooth.ProfileId.PROFILE_PAN_NETWORK); let ret = panProfile.setTethering(false); console.info("[bluetooth_js] setTethering false result "+JSON.stringify(ret)); let result = panProfile.isTetheringOn(); @@ -246,5 +245,5 @@ describe('bluetoothhostTest_host_2', function () { expect(result).assertFalse(); done(); }) - + }) } diff --git a/communication/bluetooth_standard/src/main/js/test/Bluetooth.test.js b/communication/bluetooth_standard/src/main/js/test/Bluetooth.test.js index 5d5643b248d39a6b10c7307ca6a27771068ba937..eafb531171fe0636f8607396044622db836631c8 100644 --- a/communication/bluetooth_standard/src/main/js/test/Bluetooth.test.js +++ b/communication/bluetooth_standard/src/main/js/test/Bluetooth.test.js @@ -220,12 +220,12 @@ describe('bluetoothhostTest', function() { let scanModeResult = bluetooth.getBluetoothScanMode(); console.info('[bluetooth_js] get scan mode result2 = ' + JSON.stringify(scanModeResult)); expect(scanModeResult).assertEqual(1); - expect(true).assertTrue(ScanMode.SCAN_MODE_NONE != scanMode); - expect(true).assertTrue(ScanMode.SCAN_MODE_CONNECTABLE != scanMode); - expect(true).assertTrue(ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE != scanMode); - expect(true).assertTrue(ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE != scanMode); - expect(true).assertTrue(ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE != scanMode); - expect(true).assertTrue(ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE != scanMode); + expect(true).assertTrue(ScanMode.SCAN_MODE_NONE != scanModeResult); + expect(true).assertTrue(ScanMode.SCAN_MODE_CONNECTABLE != scanModeResult); + expect(true).assertTrue(ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE != scanModeResult); + expect(true).assertTrue(ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE != scanModeResult); + expect(true).assertTrue(ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE != scanModeResult); + expect(true).assertTrue(ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE != scanModeResult); done(); })