提交 dda7e4a3 编写于 作者: Q quanli

quanli1@huawei.com

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