未验证 提交 ca43b2f8 编写于 作者: O openharmony_ci 提交者: Gitee

!8555 【XTS】【communication】【3.2release】优化bt,lbs脚本

Merge pull request !8555 from 权力/myfeature2
...@@ -106,6 +106,16 @@ ...@@ -106,6 +106,16 @@
"when": "inuse" "when": "inuse"
} }
}, },
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "",
"usedScene": {
"ability": [
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when": "inuse"
}
},
{ {
"name": "ohos.permission.DISCOVER_BLUETOOTH", "name": "ohos.permission.DISCOVER_BLUETOOTH",
"reason": "", "reason": "",
......
...@@ -120,6 +120,16 @@ ...@@ -120,6 +120,16 @@
"when": "inuse" "when": "inuse"
} }
}, },
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "",
"usedScene": {
"ability": [
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when": "inuse"
}
},
{ {
"name": "ohos.permission.LOCATION", "name": "ohos.permission.LOCATION",
"reason": "", "reason": "",
......
...@@ -217,18 +217,18 @@ describe('bluetoothBLETest', function() { ...@@ -217,18 +217,18 @@ describe('bluetoothBLETest', function() {
await sleep(5000) await sleep(5000)
try { try {
await gattClient.getDeviceName().then((data) => { await gattClient.getDeviceName().then((data) => {
console.info('[bluetooth_js] device name' + JSON.stringify(data)) console.info('[bluetooth_js] device name:' + JSON.stringify(data))
expect(data).assertNull(); expect(data).assertNull();
done(); done();
}).catch(err => { }).catch(err => {
console.error('bluetooth getDeviceName has error: '+ err); console.error('[bluetooth_js] bluetooth getDeviceName has error: '+ JSON.stringify(err));
expect(true).assertFalse(); expect(err).assertFalse();
done(); done();
}); });
} catch (error) { } catch (error) {
console.error(`[bluetooth_js]GetDeviceName_0100 failed, code is ${error.code}, console.error(`[bluetooth_js]GetDeviceName_0100 failed, code is ${error.code},
message is ${error.message}`); message is ${error.message}`);
expect(true).assertFalse(); expect(true).assertFalse();
done() done()
} }
}) })
......
...@@ -16,6 +16,32 @@ ...@@ -16,6 +16,32 @@
import bluetooth from '@ohos.bluetoothManager'; import bluetooth from '@ohos.bluetoothManager';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import osaccount from '@ohos.account.osAccount'
import bundle from '@ohos.bundle'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
async function applyPermission() {
let osAccountManager = osaccount.getAccountManager();
console.info("=== getAccountManager finish");
let localId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.info("LocalId is :" + localId);0
let appInfo = await bundle.getApplicationInfo('ohos.acts.communication.bluetooth.bluetoothhost', 0, localId);
let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) {
let tokenID = appInfo.accessTokenId;
console.info('[permission] case accessTokenID is ' + tokenID);
let permissionName = 'ohos.permission.LOCATION';
await atManager.grantUserGrantedPermission(tokenID, permissionName, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result));
}).catch((err) => {
console.info('[permis' +
'sion] case grantUserGrantedPermission failed :' + JSON.stringify(err));
});
} else {
console.info('[permission] case apply permission failed, createAtManager failed');
}
}
export default function bluetoothBLETest6() { export default function bluetoothBLETest6() {
describe('bluetoothBLETest6', function() { describe('bluetoothBLETest6', function() {
function sleep(delay) { function sleep(delay) {
...@@ -48,8 +74,10 @@ describe('bluetoothBLETest6', function() { ...@@ -48,8 +74,10 @@ describe('bluetoothBLETest6', function() {
console.info('[bluetooth_js] enable success'); console.info('[bluetooth_js] enable success');
} }
} }
beforeAll(function () { beforeAll(async function (done) {
console.info('beforeAll called') console.info('beforeAll called')
await applyPermission();
done();
}) })
beforeEach(async function(done) { beforeEach(async function(done) {
console.info('beforeEach called') console.info('beforeEach called')
......
...@@ -110,6 +110,16 @@ ...@@ -110,6 +110,16 @@
"when": "inuse" "when": "inuse"
} }
}, },
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "",
"usedScene": {
"ability": [
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when": "inuse"
}
},
{ {
"name": "ohos.permission.DISCOVER_BLUETOOTH", "name": "ohos.permission.DISCOVER_BLUETOOTH",
"reason": "", "reason": "",
......
...@@ -106,6 +106,16 @@ ...@@ -106,6 +106,16 @@
"when": "inuse" "when": "inuse"
} }
}, },
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "",
"usedScene": {
"ability": [
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when": "inuse"
}
},
{ {
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
......
...@@ -96,6 +96,16 @@ ...@@ -96,6 +96,16 @@
"when": "inuse" "when": "inuse"
} }
}, },
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "",
"usedScene": {
"ability": [
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when": "inuse"
}
},
{ {
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
......
...@@ -14,26 +14,41 @@ ...@@ -14,26 +14,41 @@
*/ */
import bluetooth from '@ohos.bluetooth'; import bluetooth from '@ohos.bluetooth';
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
const PERMISSION_USER_SET = 1; import osaccount from '@ohos.account.osAccount'
const PERMISSION_USER_NAME1 = "ohos.permission.LOCATION"; import bundle from '@ohos.bundle'
const PERMISSION_USER_NAME2 = 'ohos.permission.LOCATION_IN_BACKGROUND'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
let tokenID = undefined;
async function grantPerm() { async function applyPermission() {
console.info("====grant Permission start===="); let osAccountManager = osaccount.getAccountManager();
let appInfo = await bundle.getApplicationInfo('ohos.acts.communication.bluetooth.bluetoothhost', 0, 100); console.info("=== getAccountManager finish");
tokenID = appInfo.accessTokenId; let localId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.info("accessTokenId" + appInfo.accessTokenId + " bundleName:" + appInfo.bundleName); console.info("LocalId is :" + localId);0
let appInfo = await bundle.getApplicationInfo('ohos.acts.communication.bluetooth.bluetoothhost', 0, localId);
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
let result = await atManager.grantUserGrantedPermission(tokenID, PERMISSION_USER_NAME1, PERMISSION_USER_SET); if (atManager != null) {
console.info("tokenId" + tokenID + " result:" + result); let tokenID = appInfo.accessTokenId;
let result1 = await atManager.grantUserGrantedPermission(tokenID, PERMISSION_USER_NAME2, PERMISSION_USER_SET); console.info('[permission] case accessTokenID is ' + tokenID);
console.info("tokenId" + tokenID + " result1:" + result1); let permissionName = 'ohos.permission.LOCATION';
console.info("====grant Permission end===="); let permissionName1 = 'ohos.permission.APPROXIMATELY_LOCATION';
await atManager.grantUserGrantedPermission(tokenID, permissionName, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result));
}).catch((err) => {
console.info('[permis' +
'sion] case grantUserGrantedPermission failed :' + JSON.stringify(err));
});
await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success1 :' + JSON.stringify(result));
}).catch((err) => {
console.info('[permis' +
'sion] case grantUserGrantedPermission failed :' + JSON.stringify(err));
});
} else {
console.info('[permission] case apply permission failed, createAtManager failed');
}
} }
export default function bluetoothhostTest3() { export default function bluetoothhostTest3() {
describe('bluetoothhostTest3', function() { describe('bluetoothhostTest3', function() {
function sleep(delay) { function sleep(delay) {
...@@ -69,7 +84,7 @@ describe('bluetoothhostTest3', function() { ...@@ -69,7 +84,7 @@ describe('bluetoothhostTest3', function() {
beforeAll(async function (done) { beforeAll(async function (done) {
console.info('beforeAll called') console.info('beforeAll called')
await grantPerm(); await applyPermission();
done() done()
}) })
beforeEach(async function(done) { beforeEach(async function(done) {
...@@ -122,6 +137,8 @@ describe('bluetoothhostTest3', function() { ...@@ -122,6 +137,8 @@ describe('bluetoothhostTest3', function() {
*/ */
it('SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0300', 0, async function (done) { it('SUB_COMMUNICATION_BLUETOOTH_BR_Discovery_0300', 0, async function (done) {
let result1 = bluetooth.setBluetoothScanMode(bluetooth.ScanMode.SCAN_MODE_CONNECTABLE,10); let result1 = bluetooth.setBluetoothScanMode(bluetooth.ScanMode.SCAN_MODE_CONNECTABLE,10);
console.info('[bluetooth_js] setBluetoothScanMode = '+ JSON.stringify(result1));
await sleep(3000);
expect(result1).assertTrue(); expect(result1).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode(); let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] getScanMode = '+ JSON.stringify(getScanMode)); console.info('[bluetooth_js] getScanMode = '+ JSON.stringify(getScanMode));
......
...@@ -332,12 +332,14 @@ describe('bluetoothhostTest2', function() { ...@@ -332,12 +332,14 @@ describe('bluetoothhostTest2', function() {
let oldScanMode = bluetooth.getBluetoothScanMode(); let oldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0800 oldScanMode = '+ JSON.stringify(oldScanMode)); console.info('[bluetooth_js] ScanMode_0800 oldScanMode = '+ JSON.stringify(oldScanMode));
let result = bluetooth.setBluetoothScanMode(bluetooth.ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE,0); let result = bluetooth.setBluetoothScanMode(bluetooth.ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE,0);
expect(result).assertTrue(); console.info('[bluetooth_js] result = '+ JSON.stringify(result));
// expect(result).assertTrue();
let getScanMode = bluetooth.getBluetoothScanMode(); let getScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0800 getScanMode = '+ JSON.stringify(getScanMode)); console.info('[bluetooth_js] ScanMode_0800 getScanMode = '+ JSON.stringify(getScanMode));
expect(true).assertEqual(getScanMode == bluetooth.ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE); expect(true).assertEqual(getScanMode == bluetooth.ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE);
result=bluetooth.setBluetoothScanMode(oldScanMode,0); result=bluetooth.setBluetoothScanMode(oldScanMode,0);
expect(result).assertTrue(); console.info('[bluetooth_js] result1 = '+ JSON.stringify(result));
// expect(result).assertTrue();
let getOldScanMode = bluetooth.getBluetoothScanMode(); let getOldScanMode = bluetooth.getBluetoothScanMode();
console.info('[bluetooth_js] ScanMode_0800 getOldScanMode = '+ JSON.stringify(getOldScanMode)); console.info('[bluetooth_js] ScanMode_0800 getOldScanMode = '+ JSON.stringify(getOldScanMode));
expect(true).assertEqual(oldScanMode == getOldScanMode); expect(true).assertEqual(oldScanMode == getOldScanMode);
......
...@@ -15,13 +15,6 @@ ...@@ -15,13 +15,6 @@
import bluetooth from '@ohos.bluetooth'; import bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
let BluetoothState = {
STATE_OFF: 0,STATE_TURNING_ON: 1,
STATE_ON: 2,STATE_TURNING_OFF: 3,
STATE_BLE_TURNING_ON: 4, STATE_BLE_ON: 5,
STATE_BLE_TURNING_OFF: 6
};
export default function bluetoothhostTest() { export default function bluetoothhostTest() {
describe('bluetoothhostTest', function() { describe('bluetoothhostTest', function() {
...@@ -126,6 +119,39 @@ describe('bluetoothhostTest', function() { ...@@ -126,6 +119,39 @@ describe('bluetoothhostTest', function() {
} }
done() done()
}) })
/**
* @tc.number COMMUNICATION_BLUETOOTH_SwitchOff_0444
* @tc.name testEnableBluetooth and getState
* @tc.desc Test EnableBluetooth api by promise.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
*/
it('COMMUNICATION_BLUETOOTH_SwitchOff_0444', 0, async function (done) {
let STATE_ON = bluetooth.BluetoothState.STATE_ON;
console.info("[bluetooth_js]STATE_ON : " + JSON.stringify(STATE_ON));
expect(true).assertTrue(STATE_ON == 2);
let STATE_OFF = bluetooth.BluetoothState.STATE_OFF;
console.info("[bluetooth_js]STATE_OFF : " + JSON.stringify(STATE_OFF));
expect(true).assertTrue(STATE_OFF == 0);
let STATE_TURNING_ON = bluetooth.BluetoothState.STATE_TURNING_ON;
console.info("[bluetooth_js]STATE_TURNING_ON : " + JSON.stringify(STATE_TURNING_ON));
expect(true).assertTrue(STATE_TURNING_ON == 1);
let STATE_TURNING_OFF = bluetooth.BluetoothState.STATE_TURNING_OFF;
console.info("[bluetooth_js]STATE_TURNING_OFF : " + JSON.stringify(STATE_TURNING_OFF));
expect(true).assertTrue(STATE_TURNING_OFF == 3);
let STATE_BLE_TURNING_ON = bluetooth.BluetoothState.STATE_BLE_TURNING_ON;
console.info("[bluetooth_js]STATE_BLE_TURNING_ON : " + JSON.stringify(STATE_BLE_TURNING_ON));
expect(true).assertTrue(STATE_BLE_TURNING_ON == 4);
let STATE_BLE_ON = bluetooth.BluetoothState.STATE_BLE_ON;
console.info("[bluetooth_js]STATE_BLE_ON : " + JSON.stringify(STATE_BLE_ON));
expect(true).assertTrue(STATE_BLE_ON == 5);
let STATE_BLE_TURNING_OFF = bluetooth.BluetoothState.STATE_BLE_TURNING_OFF;
console.info("[bluetooth_js]STATE_BLE_TURNING_OFF : " + JSON.stringify(STATE_BLE_TURNING_OFF));
expect(true).assertTrue(STATE_BLE_TURNING_OFF == 6);
done()
})
}) })
} }
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
import bluetoothhostTest1 from './BRSetLocalName.test.js' import bluetoothhostTest1 from './BRSetLocalName.test.js'
import bluetoothhostTest2 from './BRScanMode.test.js' import bluetoothhostTest2 from './BRScanMode.test.js'
import bluetoothhostTest3 from './BRDiscovery.test.js'
import bluetoothhostTest4 from './BRSpp.test.js' import bluetoothhostTest4 from './BRSpp.test.js'
import bluetoothhostTest from './BRSwitch.test.js' import bluetoothhostTest from './BRSwitch.test.js'
import bluetoothhostTest3 from './BRDiscovery.test.js'
export default function testsuite() { export default function testsuite() {
bluetoothhostTest() bluetoothhostTest()
bluetoothhostTest1() bluetoothhostTest1()
bluetoothhostTest2() bluetoothhostTest2()
bluetoothhostTest3()
bluetoothhostTest4() bluetoothhostTest4()
bluetoothhostTest() bluetoothhostTest()
bluetoothhostTest3()
} }
...@@ -96,6 +96,16 @@ ...@@ -96,6 +96,16 @@
"when": "inuse" "when": "inuse"
} }
}, },
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "",
"usedScene": {
"ability": [
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when": "inuse"
}
},
{ {
"name": "ohos.permission.MANAGE_BLUETOOTH", "name": "ohos.permission.MANAGE_BLUETOOTH",
"reason": "", "reason": "",
......
...@@ -17,6 +17,39 @@ import bluetoothManager from '@ohos.bluetoothManager'; ...@@ -17,6 +17,39 @@ import bluetoothManager from '@ohos.bluetoothManager';
import bluetooth from '@ohos.bluetooth'; import bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import osaccount from '@ohos.account.osAccount'
import bundle from '@ohos.bundle'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
async function applyPermission() {
let osAccountManager = osaccount.getAccountManager();
console.info("=== getAccountManager finish");
let localId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.info("LocalId is :" + localId);0
let appInfo = await bundle.getApplicationInfo('ohos.acts.communication.bluetooth.bluetoothhost', 0, localId);
let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) {
let tokenID = appInfo.accessTokenId;
console.info('[permission] case accessTokenID is ' + tokenID);
let permissionName = 'ohos.permission.LOCATION';
let permissionName1 = 'ohos.permission.APPROXIMATELY_LOCATION';
await atManager.grantUserGrantedPermission(tokenID, permissionName, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + JSON.stringify(result));
}).catch((err) => {
console.info('[permis' +
'sion] case grantUserGrantedPermission failed :' + JSON.stringify(err));
});
await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success1 :' + JSON.stringify(result));
}).catch((err) => {
console.info('[permis' +
'sion] case grantUserGrantedPermission failed :' + JSON.stringify(err));
});
} else {
console.info('[permission] case apply permission failed, createAtManager failed');
}
}
export default function bluetoothBLETest3() { export default function bluetoothBLETest3() {
describe('bluetoothBLETest3', function() { describe('bluetoothBLETest3', function() {
let gattServer = null; let gattServer = null;
...@@ -47,10 +80,12 @@ describe('bluetoothBLETest3', function() { ...@@ -47,10 +80,12 @@ describe('bluetoothBLETest3', function() {
console.info('[bluetooth_js] enable success'); console.info('[bluetooth_js] enable success');
} }
} }
beforeAll(function () { beforeAll(async function (done) {
console.info('beforeAll called') console.info('beforeAll called')
gattServer = bluetoothManager.BLE.createGattServer(); gattServer = bluetoothManager.BLE.createGattServer();
gattClient = bluetoothManager.BLE.createGattClientDevice("11:22:33:44:55:66"); gattClient = bluetoothManager.BLE.createGattClientDevice("11:22:33:44:55:66");
await applyPermission();
done();
}) })
beforeEach(async function(done) { beforeEach(async function(done) {
console.info('beforeEach called') console.info('beforeEach called')
......
...@@ -164,17 +164,20 @@ export default function geolocationTest_geo5() { ...@@ -164,17 +164,20 @@ export default function geolocationTest_geo5() {
let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 5}; let reverseGeocodeRequest = { "latitude": 31.265496, "longitude": 121.62771, "maxItems": 5};
await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => { await geolocationm.getAddressesFromLocation(reverseGeocodeRequest).then((data) => {
console.info('[lbs_js] getAddressesFromLocation21 promise: ' + JSON.stringify(data)); console.info('[lbs_js] getAddressesFromLocation21 promise: ' + JSON.stringify(data));
console.info('addressUrl: ' + JSON.stringify(data)[0].addressUrl if(data!="")
+ JSON.stringify(data)[0].administrativeArea + JSON.stringify(data)[0].countryCode {
+ JSON.stringify(data)[0].countryName + JSON.stringify(data)[0].descriptions console.info('addressUrl: ' + JSON.stringify(data)[0].addressUrl
+ JSON.stringify(data)[0].descriptionsSize + data[0].latitude + JSON.stringify(data)[0].administrativeArea + JSON.stringify(data)[0].countryCode
+ JSON.stringify(data)[0].locale + JSON.stringify(data)[0].locality + JSON.stringify(data)[0].countryName + JSON.stringify(data)[0].descriptions
+ JSON.stringify(data)[0].longitude + JSON.stringify(data)[0].phoneNumber + JSON.stringify(data)[0].descriptionsSize + data[0].latitude
+ JSON.stringify(data)[0].placeName + JSON.stringify(data)[0].locale + JSON.stringify(data)[0].locality
+ JSON.stringify(data)[0].postalCode + JSON.stringify(data)[0].premises + JSON.stringify(data)[0].longitude + JSON.stringify(data)[0].phoneNumber
+ JSON.stringify(data)[0].roadName + JSON.stringify(data)[0].subAdministrativeArea + JSON.stringify(data)[0].placeName
+ JSON.stringify(data)[0].subLocality + JSON.stringify(data)[0].subRoadName + JSON.stringify(data)[0].postalCode + JSON.stringify(data)[0].premises
+ JSON.stringify(data)[0].isFromMock); + JSON.stringify(data)[0].roadName + JSON.stringify(data)[0].subAdministrativeArea
+ JSON.stringify(data)[0].subLocality + JSON.stringify(data)[0].subRoadName
+ JSON.stringify(data)[0].isFromMock);
}
}).catch(error => { }).catch(error => {
console.info("[lbs_js] getAddressesFromLocation21 promise then error." + JSON.stringify(error)); console.info("[lbs_js] getAddressesFromLocation21 promise then error." + JSON.stringify(error));
console.info('[lbs_js] not support now'); console.info('[lbs_js] not support now');
......
...@@ -612,7 +612,6 @@ export default function geolocationTest_geo7() { ...@@ -612,7 +612,6 @@ export default function geolocationTest_geo7() {
console.info('[lbs_js] sendcommand promise err:' + JSON.stringify(error)); console.info('[lbs_js] sendcommand promise err:' + JSON.stringify(error));
console.info('[lbs_js] not support now'); console.info('[lbs_js] not support now');
expect(error.code).assertEqual(801); expect(error.code).assertEqual(801);
//expect(true).assertEqual(JSON.stringify(error) != null);
done(); done();
}) })
} catch (error) { } catch (error) {
...@@ -1180,11 +1179,11 @@ export default function geolocationTest_geo7() { ...@@ -1180,11 +1179,11 @@ export default function geolocationTest_geo7() {
try { try {
let last =geolocationm.getLastLocation(); let last =geolocationm.getLastLocation();
console.info('[lbs_js] getLastLocation latitude: ' + last.latitude + console.info('[lbs_js] getLastLocation latitude: ' + last.latitude +
' longitude: ' + result.longitude +' altitude: ' + result.altitude ' longitude: ' + last.longitude +' altitude: ' + last.altitude
+' accuracy: ' + result.accuracy+' speed: ' + result.speed + +' accuracy: ' + last.accuracy+' speed: ' + last.speed +
'timeStamp: ' + result.timeStamp+'direction:' + result.direction+' timeSinceBoot: ' 'timeStamp: ' + last.timeStamp+'direction:' + last.direction+' timeSinceBoot: '
+ result.timeSinceBoot +'additions: ' + result.additions+' additionSize' + result.additionSize + last.timeSinceBoot +'additions: ' + last.additions+' additionSize' + last.additionSize
+ 'isFromMock' +result.isFromMock); + 'isFromMock' +last.isFromMock);
expect(true).assertEqual(JSON.stringify(last) != null); expect(true).assertEqual(JSON.stringify(last) != null);
} catch (error) { } catch (error) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册