提交 dda7e4a3 编写于 作者: Q quanli

quanli1@huawei.com

Signed-off-by: Nquanli <quanli1@huawei.com>
上级 8f7676c0
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"svc bluetooth enable"
]
}
......
......@@ -143,28 +143,34 @@ describe('bluetoothBLETest', function() {
let ret = gattClient.connect();
console.info('[bluetooth_js] gattClient getrssi connect:' + JSON.stringify(ret))
expect(ret).assertTrue();
try {
await gattClient.getRssiValue().then((data) => {
console.info('[bluetooth_js] BLE read rssi: ' + JSON.stringify(data));
let rssiLength = Object.keys(data).length;
expect(rssiLength).assertEqual(0);
done();
}).catch(error => {
console.info('bluetooth getRssiValue has error: '+ JSON.stringify(error));
expect(error.code).assertEqual('2900099');
done();
});
}catch (error) {
console.error(`[bluetooth_js]GetRssiValue_0100 error, code is ${error.code},
message is ${error.message}`);
}
let disconnect = gattClient.disconnect();
console.info('[bluetooth_js] gatt getrssi disconnect:' + disconnect);
expect(disconnect).assertEqual(false);
try {
await gattClient.getRssiValue().then((data) => {
console.info('[bluetooth_js] BLE read rssi: ' + JSON.stringify(data));
let rssiLength = Object.keys(data).length;
expect(rssiLength).assertEqual(0);
done();
}).catch(error => {
console.info('bluetooth getRssiValue has error: '+ JSON.stringify(error));
let b=false;
if(err.code==2900099||err.code==-1)
{
b=true
}
expect(true).assertEqual(b);
done();
});
let disconnect = gattClient.disconnect();
console.info('[bluetooth_js] gatt getrssi disconnect:' + disconnect);
expect(disconnect).assertEqual(false);
}catch (error) {
console.error(`[bluetooth_js]GetRssiValue_0100 error, code is ${error.code},
message is ${error.message}`);
}
done()
})
/**
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200
* @tc.name testgetRssiValue
* @tc.desc Test testGetDeviceName api by callback.
......@@ -177,17 +183,28 @@ describe('bluetoothBLETest', function() {
let ret = gattClient.connect();
console.info('[bluetooth_js] gattClient getRssi connect' + JSON.stringify(ret))
expect(ret).assertTrue();
let promise = new Promise((resolve) => {
gattClient.getRssiValue((err, data)=> {
gattClient.getRssiValue((err, data)=> {
if(err)
{
console.info('[bluetooth_js]getRssi value:'+JSON.stringify(err));
let b=false;
if(err.code==2900099||err.code==-1)
{
b=true
}
expect(true).assertEqual(b);
}
else
{
console.info('[bluetooth_js]getRssi value:'+JSON.stringify(data));
expect(data).assertNull();
let disconnect = gattClient.disconnect();
console.info('[bluetooth_js] gatt getrssi1 disconnect:' + disconnect);
expect(disconnect).assertEqual(false);
});
resolve()
})
await promise.then(done)
expect(true).assertEqual(data!=null)
}
});
let disconnect = gattClient.disconnect();
console.info('[bluetooth_js] gatt getrssi1 disconnect:' + disconnect);
expect(disconnect).assertEqual(false);
await sleep(3000);
done()
})
/**
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"svc bluetooth enable"
]
}
......
......@@ -157,18 +157,23 @@ describe('bluetoothBLETest', function() {
try {
await gattClient.getRssiValue().then((data) => {
console.info('[bluetooth_js] BLE read rssi: ' + JSON.stringify(data));
let rssiLength = Object.keys(data).length;
console.info('[bluetooth_js] BLE read rssi: ' + JSON.stringify(rssiLength));
expect(rssiLength).assertEqual(0);
expect(true).assertEqual(data!=null);
done();
}).catch(err => {
console.info('bluetooth getRssiValue has error: '+ JSON.stringify(err));
// expect(true).assertEqual(error.code==2900099||error.code==-1);
let b=false;
if(err.code==2900099||err.code==-1)
{
b=true
}
expect(true).assertEqual(b);
done();
});
} catch (error) {
console.error(`[bluetooth_js]GetRssiValue_0100 error, code is ${error.code},
message is ${error.message}`);
expect(error.code).assertEqual('2900099');
expect(false).assertEqual(true);
done()
}
......@@ -185,23 +190,35 @@ describe('bluetoothBLETest', function() {
*/
it('COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200', 0, async function (done) {
try {
let promise = new Promise((resolve) => {
gattClient.getRssiValue((err, data)=> {
if (err) {
console.error('getRssi failed ');
}
console.info('[bluetooth_js]getRssi value:'+JSON.stringify(data));
expect(true).assertFalse();
function getRssi() {
return new Promise((resolve,reject) => {
gattClient.getRssiValue((err, data)=> {
if (err) {
console.error('getRssi failed ');
let b=false;
if(err.code==2900099||err.code==-1)
{
b=true
}
expect(true).assertEqual(b);
}
else
{
console.info('[bluetooth_js]getRssi value:'+JSON.stringify(data));
expect(true).assertEqual(data!=null );
}
resolve();
});
});
resolve()
})
await promise.then(done)
}
await getRssi();
} catch (error) {
console.error(`[bluetooth_js]GetRssiValue_0200 error, code is ${error.code},
message is ${error.message}`);
expect(error.code).assertEqual('2900099');
done()
}
expect(false).assertEqual(true);
}
await sleep(2000);
done();
})
/**
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"svc bluetooth enable"
]
}
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"svc bluetooth enable"
]
}
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"svc bluetooth enable"
]
}
......
......@@ -19,9 +19,8 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"svc bluetooth disable"
]
}
]
}
\ No newline at end of file
}
......@@ -20,7 +20,6 @@
"type": "ShellKit",
"run-command": [
"svc nfc enable",
"hilog -Q pidoff",
"power-shell wakeup",
"power-shell setmode 602"
]
......
......@@ -245,7 +245,7 @@ export default function nfcATagSessionTest() {
done();
}).catch((err)=> {
console.info("[NFC_test] tagsession7 nfcAtage sendData1 err: " + err);
expect(3100201).assertEqual(error.code)
expect().assertFail();
done();
});
sleep(3500);
......@@ -316,14 +316,14 @@ export default function nfcATagSessionTest() {
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfcAtage_js_1000', 0, function () {
let settime;
let gettime;
try {
settime = tag.getNfcATag(aTag).getTimeout();
console.info("[NFC_test] tagsession10 getSendDataTimeout:" + settime);
expect(settime).assertInstanceOf('Number')
gettime = tag.getNfcATag(aTag).getTimeout();
console.info("[NFC_test] tagsession10 getSendDataTimeout:" + gettime);
expect(gettime).assertInstanceOf('Number')
} catch (error) {
console.info('[NFC_test] tagsession10 getSendDataTimeout error' + error)
expect(3100201).assertEqual(error.code)
expect().assertFail();
}
})
......@@ -398,7 +398,7 @@ export default function nfcATagSessionTest() {
})
/**
* @tc.number SUB_Communication_NFC_nfcAtage_js_0500
* @tc.number SUB_Communication_NFC_nfcAtage_js_1400
* @tc.name testsetSendDataTimeout
* @tc.desc Test setSendDataTimeout api.
* @tc.size MEDIUM
......@@ -451,16 +451,15 @@ export default function nfcATagSessionTest() {
})
/**
* @tc.number SUB_Communication_NFC_nfcAtage_js_0160
* @tc.number SUB_Communication_NFC_nfcAtage_js_1600
* @tc.name connect
* @tc.desc Test connect api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfcAtage_js_0160', 0, function () {
it('SUB_Communication_NFC_nfcAtage_js_1600', 0, function () {
if (getAtag != null && getAtag != undefined) {
let NfcConnect;
try {
getAtag.connect();
console.log("[NFC_test] tagsession16 NfcConnected pass");
......@@ -477,4 +476,4 @@ export default function nfcATagSessionTest() {
console.info("*************[nfc_test] start nfc js unit test end*************");
})
}
\ No newline at end of file
}
......@@ -363,14 +363,14 @@ export default function ConnectedTagTest() {
})
/**
* @tc.number SUB_Communication_NFC_nfcConnectedTag_js_1200
* @tc.number SUB_Communication_NFC_nfcConnectedTag_js_1300
* @tc.name Test write connectedTag
* @tc.desc Write Content to Active Tags
* @tc.size since 8
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfcConnectedTag_js_1200', 0, async function (done) {
it('SUB_Communication_NFC_nfcConnectedTag_js_1300', 0, async function (done) {
var isAccessToken = canIUse("SystemCapability.Communication.ConnectedTag");
console.info("testSysCaps01 test.syscap.param.001 : " + isAccessToken);
if (!isAccessToken) {
......@@ -395,6 +395,4 @@ export default function ConnectedTagTest() {
console.info("*************[nfc_test] start nfc js unit test end*************");
})
}
}
\ No newline at end of file
......@@ -126,8 +126,4 @@ export default function nfcControllerTest() {
console.info("*************[nfc_test] start nfc js unit test end*************");
})
}
}
\ No newline at end of file
......@@ -13,14 +13,14 @@
* limitations under the License.
*/
import nfcATagSessionTest from './nfc.ATagSession.js'
import nfcControllerTest from './nfc.Controller.js'
import nfcIsoDepTagTest from './nfc.IsoDepTag.js'
import nfcMifareClassicTag from './nfc.MifareClassicTag.js'
import nfcMifareUltralightTag from './nfc.MifareUltralightTag.js'
import nfcTagABFVTest from './nfc.TagABFV.js'
import nfcNDEFTagTest from './nfc.NDEFTag.js'
import ConnectedTagTest from './nfc.ConnectedTag.js'
import nfcATagSessionTest from './ATagSession.test.js';
import nfcControllerTest from './Controller.test.js';
import nfcIsoDepTagTest from './IsoDepTag.test.js';
import nfcMifareClassicTag from './MifareClassicTag.test.js';
import nfcMifareUltralightTag from './MifareUltralightTag.test.js';
import nfcTagABFVTest from './TagABFV.test.js';
import nfcNDEFTagTest from './NDEFTag.test.js';
import ConnectedTagTest from './ConnectedTag.test.js';
import parameter from '@ohos.systemparameter';
let info = parameter.getSync("const.SystemCapability.Communication.NFC.Core" ,"false");
export default function testsuite() {
......@@ -35,4 +35,4 @@ if (info != "false")
nfcNDEFTagTest();
nfcTagABFVTest();
}
}
}
\ No newline at end of file
......@@ -24,26 +24,6 @@ function sleep(delay) { // delay x ms
}
}
let NdefRecord = {
NFC_A : 1,
NFC_B : 2,
ISO_DEP : 3,
NFC_F : 4,
NFC_V : 5,
NDEF : 6,
MIFARE_CLASSIC : 8,
MIFARE_ULTRALIGHT : 9,
NDEF_FORMATABLE : 10,
};
let NfcForumType = {
NFC_FORUM_TYPE_1 : 1,
NFC_FORUM_TYPE_2 : 2,
NFC_FORUM_TYPE_3 : 3,
NFC_FORUM_TYPE_4 : 4,
MIFARE_CLASSIC : 101,
};
let aTag = {
"uid": [0x01, 0x02, 0x03, 0x04],
"technology": [1],
......@@ -103,6 +83,76 @@ var Want = {
]
}
let isoDepTaginfo = {
"uid": [0x01, 0x02, 0x03, 0x04],
"technology": [1, 3],
"extrasData": [
{
"Sak": 0x08, "Atqa": "B000",
},
{
"HistoricalBytes": "4D54000500308693695B", "HiLayerResponse": "",
},
],
"tagRfDiscId": 1,
};
let NDEFTaginfo = {
"uid": [0x01, 0x02, 0x03, 0x04],
"technology": [1, 6],
"extrasData": [
{
"Sak": 0x08, "Atqa": "B000",
},
{
"NdefMsg": "D4010354787473", "NdefForumType": 1, "NdefTagLength":255, "NdefTagMode": 1,
},
],
"tagRfDiscId": 1,
};
let mifareclassicTaginfo = {
"uid": [0x01, 0x02, 0x03, 0x04],
"technology": [1, 8],
"extrasData": [
{
"Sak": 0x08, "Atqa": "B000",
},
{
},
],
"tagRfDiscId": 1,
};
let mifareUltralightTaginfo = {
"uid": [0x01, 0x02, 0x03, 0x04],
"technology": [1, 9],
"extrasData": [
{
"Sak": 0x08, "Atqa": "B000",
},
{
"MifareUltralightC": "ture",
},
],
"tagRfDiscId": 1,
};
let NdefFormatableTag = {
"uid": [0x01, 0x02, 0x03, 0x04],
"technology": [1, 7],
"extrasData": [
{
"Sak": 0x08, "Atqa": "B000",
},
{
},
],
"tagRfDiscId": 1,
};
export default function nfcTagABFVTest() {
describe('nfcTagABFVTest', function () {
beforeAll(function () {
......@@ -519,8 +569,111 @@ export default function nfcTagABFVTest() {
expect(NfcVTag instanceof Object).assertTrue();
})
console.info("*************[nfc_test] start nfc js unit test end*************");
})
}
/**
* @tc.number SUB_Communication_NFC_nfctage_js_1800
* @tc.name Test getIsoDep
* @tc.desc This interface is used to obtain the isodep tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfctage_js_1800', 0, function () {
let IsoDepTag ;
try{
IsoDepTag = tag.getIsoDep(isoDepTaginfo);
console.info('[NFC_test] getIsoDep18 is--<-!!!->' + JSON.stringify(IsoDepTag));
expect(IsoDepTag != null).assertTrue();
expect(IsoDepTag instanceof Object).assertTrue();
}catch(error){
console.info('nfc getIsoDep is ->' + error)
expect().assertFail();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_1900
* @tc.name Test getNdef
* @tc.desc This interface is used to obtain the getNdef tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfctage_js_1900', 0, function () {
let NdefTag ;
try {
NdefTag = tag.getNdef(NDEFTaginfo);
console.info('[NFC_test] getNdef19 is--<-!!!->' + JSON.stringify(NdefTag));
expect(NdefTag != null).assertTrue();
expect(NdefTag instanceof Object).assertTrue();
} catch (error) {
console.info('nfc TagTest getNdef error' + error)
expect().assertFail();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_2000
* @tc.name Test getMifareClassic
* @tc.desc This interface is used to obtain the getMifareClassic tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfctage_js_2000', 0, function () {
let MifareClassicTag ;
try{
MifareClassicTag = tag.getMifareClassic(mifareclassicTaginfo);
console.info('[NFC_test] mifareClassic20 is--<-!!!->' + JSON.stringify(MifareClassicTag));
expect(MifareClassicTag != null).assertTrue();
expect(MifareClassicTag instanceof Object).assertTrue();
} catch (error) {
console.info('nfc mifareClassic20 error' + error)
expect().assertFail();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_2100
* @tc.name Test getMifareUltralight
* @tc.desc This interface is used to obtain the getMifareUltralight tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfctage_js_2100', 0, function () {
let MifareUltralightTag ;
try {
MifareUltralightTag = tag.getMifareUltralight(mifareUltralightTaginfo);
console.info('[NFC_test] mifareUltralight21 is--<-!!!->' + JSON.stringify(MifareUltralightTag));
expect(MifareUltralightTag != null).assertTrue();
expect(MifareUltralightTag instanceof Object).assertTrue();
} catch (error) {
console.info('nfc mifareUltralight21 error' + error)
expect().assertFail();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_2200
* @tc.name Test getNdefFormatable
* @tc.desc This interface is used to obtain the getNdefFormatable tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it('SUB_Communication_NFC_nfctage_js_2200', 0, function () {
let NdefFormatable ;
try {
NdefFormatable = tag.getNdefFormatable(NdefFormatableTag);
console.info('[NFC_test] getNdefFormatable22 is--<-!!!->' + JSON.stringify(NdefFormatable));
expect(NdefFormatable != null).assertTrue();
expect(NdefFormatable instanceof Object).assertTrue();
} catch (error) {
console.info('nfc getNdefFormatable error' + error)
expect().assertFail();
}
})
console.info("*************[nfc_test] start nfc js unit test end*************");
})
}
\ No newline at end of file
......@@ -14,11 +14,11 @@
*/
import nfcIsoDepErrorTest from './error.IsoDepTag.js'
import MifareClassicErrorTest from './error.MifareClassicTag.js'
import UltralightTagErrorTest from './error.MifareUltralightTag.js'
import nfcNDEFErrorTest from './error.NDEFTag.js'
import nfcTagABFVErrorTest from './error.TagABFV.js'
import nfcIsoDepErrorTest from './IsoDepTag.test.js'
import MifareClassicErrorTest from './MifareClassicTag.test.js'
import UltralightTagErrorTest from './MifareUltralightTag.test.js'
import nfcNDEFErrorTest from './NDEFTag.test.js'
import nfcTagABFVErrorTest from './TagABFV.test.js'
import parameter from '@ohos.systemparameter';
let info = parameter.getSync("const.SystemCapability.Communication.NFC.Core" ,"false");
export default function testsuite() {
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"power-shell wakeup",
"power-shell setmode 602"
]
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"power-shell wakeup",
"power-shell setmode 602"
]
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"power-shell wakeup",
"power-shell setmode 602"
]
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"power-shell wakeup",
"power-shell setmode 602"
]
......
......@@ -19,7 +19,6 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"power-shell wakeup",
"power-shell setmode 602"
]
......
......@@ -208,8 +208,8 @@ export default function actsWifiManagerEventTest() {
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0010
* @tc.name testgetSupportedPowerModel
* @tc.desc Test getSupportedPowerModel api.
* @tc.name testgetSupportedPowerMode
* @tc.desc Test getSupportedPowerMode api.
* @tc.type Function
*/
it('SUB_Communication_WiFi_SysCaps_Test_0010', 0, async function (done) {
......@@ -219,9 +219,9 @@ export default function actsWifiManagerEventTest() {
var isAccessToken = canIUse("SystemCapability.Communication.wifiMg.AP.Extension");
console.info("SUB_Communication_WiFi_SysCaps_Test_0010 test.syscap.param.001 : " + isAccessToken);
if (isAccessToken) {
await wifiManagerExt.getSupportedPowerModel()
await wifiManagerExt.getSupportedPowerMode()
.then(data => {
console.info("[wifi_test]getSupportedPowerModel promise result -> " + JSON.stringify(data));
console.info("[wifi_test]getSupportedPowerMode promise result -> " + JSON.stringify(data));
});
done();
}
......@@ -235,8 +235,8 @@ export default function actsWifiManagerEventTest() {
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0011
* @tc.name testgetSupportedPowerModel
* @tc.desc Test getSupportedPowerModel api.
* @tc.name testgetSupportedPowerMode
* @tc.desc Test getSupportedPowerMode api.
* @tc.type Function
*/
it('SUB_Communication_WiFi_SysCaps_Test_0011', 0, async function (done) {
......@@ -246,20 +246,20 @@ export default function actsWifiManagerEventTest() {
var isAccessToken = canIUse("SystemCapability.Communication.wifiMg.AP.Extension");
console.info("SUB_Communication_WiFi_SysCaps_Test_0011 test.syscap.param.001 : " + isAccessToken);
if (isAccessToken) {
function getSupportedPowerModelResult(){
function getSupportedPowerModeResult(){
return new Promise((resolve, reject) => {
wifiManagerExt.getSupportedPowerModel(
wifiManagerExt.getSupportedPowerMode(
(err, result) => {
if(err) {
console.info("[wifi_test]failed to getSupportedPowerModel:" + JSON.stringify(err));
console.info("[wifi_test]failed to getSupportedPowerMode:" + JSON.stringify(err));
expect(true).assertTrue();
}
console.info("[wifi_test]getSupportedPowerModel callback:" + JSON.stringify(result));
console.info("[wifi_test]getSupportedPowerMode callback:" + JSON.stringify(result));
resolve();
});
});
}
await getSupportedPowerModelResult();
await getSupportedPowerModeResult();
done();
}
expect(isAccessToken).assertFalse();
......@@ -272,8 +272,8 @@ export default function actsWifiManagerEventTest() {
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0012
* @tc.name testgetPowerModel
* @tc.desc Test getPowerModel api.
* @tc.name testgetPowerMode
* @tc.desc Test getPowerMode api.
* @tc.type Function
*/
it('SUB_Communication_WiFi_SysCaps_Test_0012', 0, async function (done) {
......@@ -283,9 +283,9 @@ export default function actsWifiManagerEventTest() {
var isAccessToken = canIUse("SystemCapability.Communication.wifiMg.AP.Extension");
console.info("SUB_Communication_WiFi_SysCaps_Test_0012 test.syscap.param.001 : " + isAccessToken);
if (isAccessToken) {
await wifiManagerExt.getPowerModel()
await wifiManagerExt.getPowerMode()
.then(data => {
console.info("[wifi_test]getPowerModel promise result -> " + JSON.stringify(data));
console.info("[wifi_test]getPowerMode promise result -> " + JSON.stringify(data));
});
done();
}
......@@ -299,8 +299,8 @@ export default function actsWifiManagerEventTest() {
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0013
* @tc.name testgetPowerModel
* @tc.desc Test getPowerModel api.
* @tc.name testgetPowerMode
* @tc.desc Test getPowerMode api.
* @tc.type Function
*/
it('SUB_Communication_WiFi_SysCaps_Test_0013', 0, async function (done) {
......@@ -310,20 +310,20 @@ export default function actsWifiManagerEventTest() {
var isAccessToken = canIUse("SystemCapability.Communication.wifiMg.AP.Extension");
console.info("SUB_Communication_WiFi_SysCaps_Test_0013 test.syscap.param.001 : " + isAccessToken);
if (isAccessToken) {
function getPowerModelResult(){
function getPowerModeResult(){
return new Promise((resolve, reject) => {
wifiManagerExt.getPowerModel(
wifiManagerExt.getPowerMode(
(err, result) => {
if(err) {
console.info("[wifi_test]failed to getPowerModel:" + JSON.stringify(err));
console.info("[wifi_test]failed to getPowerMode:" + JSON.stringify(err));
expect(true).assertTrue();
}
console.info("[wifi_test]getPowerModel callback:" + JSON.stringify(result));
console.info("[wifi_test]getPowerMode callback:" + JSON.stringify(result));
resolve();
});
});
}
await getPowerModelResult();
await getPowerModeResult();
done();
}
expect(isAccessToken).assertFalse();
......
......@@ -17,7 +17,7 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"settings put Secure high_accuracy_startup_comfirm 1",
"settings put SECURE location_mode 3"
]
}
......
......@@ -19,7 +19,7 @@
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"settings put Secure high_accuracy_startup_comfirm 1",
"settings put SECURE location_mode 3"
]
}
......
......@@ -166,17 +166,25 @@ export default function geolocationTest_geo5() {
console.info('[lbs_js] getAddressesFromLocation21 promise: ' + JSON.stringify(data));
if(data!="")
{
console.info('addressUrl: ' + JSON.stringify(data)[0].addressUrl
+ JSON.stringify(data)[0].administrativeArea + JSON.stringify(data)[0].countryCode
+ JSON.stringify(data)[0].countryName + JSON.stringify(data)[0].descriptions
+ JSON.stringify(data)[0].descriptionsSize + data[0].latitude
+ JSON.stringify(data)[0].locale + JSON.stringify(data)[0].locality
+ JSON.stringify(data)[0].longitude + JSON.stringify(data)[0].phoneNumber
+ JSON.stringify(data)[0].placeName
+ JSON.stringify(data)[0].postalCode + JSON.stringify(data)[0].premises
+ 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);
console.info('addressUrl: ' + JSON.stringify(data[0].addressUrl)
+',administrativeArea: '+ JSON.stringify(data[0].administrativeArea)
+',countryCode: '+ JSON.stringify(data[0].countryCode)
+'countryName: '+ JSON.stringify(data[0].countryName )
+',descriptions: '+ JSON.stringify(data[0].descriptions)
+',descriptionsSize: '+JSON.stringify(data[0].descriptionsSize)
+',latitude: '+ JSON.stringify(data[0].latitude)
+',locale: '+ JSON.stringify(data[0].locale)
+',locality:'+ JSON.stringify(data[0].locality)
+',longitude:'+ JSON.stringify(data[0].longitude)
+',phoneNumber: '+ JSON.stringify(data[0].phoneNumber)
+',placeName:'+ JSON.stringify(data[0].placeName)
+ ',postalCode: '+JSON.stringify(data[0].postalCode)
+ ',premises:'+JSON.stringify(data[0].premises)
+ ',roadName:'+JSON.stringify(data[0].roadName)
+ ',subAdministrativeArea:'+JSON.stringify(data[0].subAdministrativeArea)
+ ',subLocality:'+JSON.stringify(data[0].subLocality )
+',subRoadName:'+ JSON.stringify(data[0].subRoadName)
+ ',isFromMock:'+JSON.stringify(data[0].isFromMock));
}
}).catch(error => {
console.info("[lbs_js] getAddressesFromLocation21 promise then error." + JSON.stringify(error));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册