提交 809d9e81 编写于 作者: Z zhangfuzhi

电话新增用例

Signed-off-by: Nzhangfuzhi <zhangfuzhi1@huawei.com>
上级 2011b793
......@@ -1294,6 +1294,77 @@ export default function connectionJsunit() {
done();
});
/*
* @tc.number : Telephony_Connection_setAppNet_callback_0100
* @tc.name : Telephony_Connection_setAppNet_callback_0100
* @tc.desc : Telephony_Connection_setAppNet_callback_0100
*/
it('Telephony_Connection_setAppNet_callback_0100', 0, function (done) {
connection.getDefaultNet(function (error, netHandle) {
if (error) {
console.log("getDefaultNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("getDefaultNet success " + JSON.stringify(netHandle));
connection.setAppNet(netHandle, (error, data) => {
if (error) {
console.log("setAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("setAppNet success " + JSON.stringify(data));
connection.getAppNet(function (error, data) {
if (error) {
console.log("getAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("getAppNet success " + JSON.stringify(data));
expect(netHandle.netId == data.netId).assertTrue();
done();
})
});
})
});
/*
* @tc.number : Telephony_Connection_setAppNet_promise_0100
* @tc.name : Telephony_Connection_setAppNet_promise_0100
* @tc.desc : Telephony_Connection_setAppNet_promise_0100
*/
it('Telephony_Connection_setAppNet_promise_0100', 0, function (done) {
connection.getDefaultNet(function (error, netHandle) {
if (error) {
console.log("getDefaultNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("getDefaultNet success " + JSON.stringify(netHandle));
connection.setAppNet(netHandle).then((data) => {
console.log("setAppNet success " + JSON.stringify(data));
connection.getAppNet().then((data) => {
console.log("getAppNet success " + JSON.stringify(data));
expect(netHandle.netId == data.netId).assertTrue();
done();
}).catch(error => {
console.log("getAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
})
}).catch(error => {
console.log("setAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
})
})
});
console.log("************* connection Test end*************");
})
}
......@@ -30,7 +30,7 @@ let options = {
key: "key",
cert: "cert",
ca: ["ca"],
passwd: "123456",
password: "123456",
protocols: [socket.Protocol.TLSv12, socket.Protocol.TLSv13],
useRemoteCipherPrefer: true,
signatureAlgorithms: "rsa_pss_rsae_sha256:ECDSA+SHA256",
......@@ -82,7 +82,7 @@ export default function networkManagerSocketTest() {
expect(options.secureOptions.key != undefined).assertEqual(true);
expect(options.secureOptions.cert != undefined).assertEqual(true);
expect(options.secureOptions.ca != undefined).assertEqual(true);
expect(options.secureOptions.passwd != undefined).assertEqual(true);
expect(options.secureOptions.password != undefined).assertEqual(true);
expect(options.secureOptions.protocols != undefined).assertEqual(true);
expect(options.secureOptions.protocols[0] == "TLSv1.2").assertEqual(true);
expect(options.secureOptions.protocols[1] == "TLSv1.3").assertEqual(true);
......
......@@ -76,5 +76,26 @@ export default function radioJsunit() {
done();
}
});
/**
* @tc.number Telephony_NetworkSearch_isNRSupported_Async_0100
* @tc.name Test The function isNRSupported(soltId)
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isNRSupported_Async_0100', 0, async function (done) {
let CaseName = "Telephony_NetworkSearch_isNRSupported_Async_0100 ";
try {
let result = radio.isNRSupported();
console.info("Result: " + result);
let result0 = radio.isNRSupported(SLOT_0);
console.info("Result0: " + result0);
console.info(CaseName + "is complete!");
done();
} catch (err) {
console.info(CaseName + "err " + JSON.stringify(err));
expect(false).assertTrue();
done();
}
});
})
}
......@@ -315,6 +315,7 @@ export default function radioSecondJsunit() {
expect(data[i].timeStamp).assertLarger(0);
expect(NETWORK_TYPES).assertContain(data[i].signalInformation.signalType);
expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.signalLevel);
expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.dBm);
expect(data[i].data != undefined && data[i].data != '' && data[i].data != null).assertTrue();
if (data[i].networkType === radio.NetworkType.NETWORK_TYPE_LTE) {
console.log("radio.NetworkType.NETWORK_TYPE_LTE:" + radio.NetworkType.NETWORK_TYPE_LTE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册