提交 f8495884 编写于 作者: C chengxingzhen

xts-失败用例增加延时

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 70d678cf
...@@ -27,7 +27,7 @@ export default function lifecycleTest() { ...@@ -27,7 +27,7 @@ export default function lifecycleTest() {
if ("Singlehap_LifeCycleTest_0200" === TAG || "Singlehap_LifeCycleTest_0300" === TAG if ("Singlehap_LifeCycleTest_0200" === TAG || "Singlehap_LifeCycleTest_0300" === TAG
|| "Singlehap_LifeCycleTest_0500" === TAG || "Singlehap_LifeCycleTest_0600" === TAG || "Singlehap_LifeCycleTest_0500" === TAG || "Singlehap_LifeCycleTest_0600" === TAG
|| "Singlehap_LifeCycleTest_0800" === TAG || "Singlehap_LifeCycleTest_0900" === TAG) { || "Singlehap_LifeCycleTest_0800" === TAG || "Singlehap_LifeCycleTest_0900" === TAG) {
var para = { let para = {
resultCode: 2, resultCode: 2,
want: { want: {
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
...@@ -42,7 +42,7 @@ export default function lifecycleTest() { ...@@ -42,7 +42,7 @@ export default function lifecycleTest() {
console.log("LifeCycleTest terminateSelfwithresult error: " + JSON.stringify(error)); console.log("LifeCycleTest terminateSelfwithresult error: " + JSON.stringify(error));
}); });
} else if ("Singlehap_LifeCycleTest_2000" === TAG) { } else if ("Singlehap_LifeCycleTest_2000" === TAG) {
var para1 = { let para1 = {
resultCode: 2, resultCode: 2,
want: { want: {
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
...@@ -60,9 +60,9 @@ export default function lifecycleTest() { ...@@ -60,9 +60,9 @@ export default function lifecycleTest() {
done(); done();
}); });
var TAG = ""; let TAG = "";
var listKeyTemp = "" let listKeyTemp;
var tempCallbackId; let tempCallbackId;
function sleep(time) { function sleep(time) {
return new Promise((resolve) => setTimeout(resolve, time)) return new Promise((resolve) => setTimeout(resolve, time))
...@@ -77,8 +77,8 @@ export default function lifecycleTest() { ...@@ -77,8 +77,8 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0100", 0, async function (done) { it("Singlehap_LifeCycleTest_0100", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0100 START-------------"); console.log("------------Singlehap_LifeCycleTest_0100 START-------------");
TAG = "Singlehap_LifeCycleTest_0100"; TAG = "Singlehap_LifeCycleTest_0100";
var code; let code;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -93,9 +93,9 @@ export default function lifecycleTest() { ...@@ -93,9 +93,9 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid)); console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid));
tempCallbackId = globalThis.callbackid; tempCallbackId = globalThis.callbackid;
console.log(TAG + " registerAbilityLifecycleCallback tempCallbackId : " + JSON.stringify(tempCallbackId)); console.log(TAG + " registerAbilityLifecycleCallback tempCallbackId : " + JSON.stringify(tempCallbackId));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
for (var i = 0; i < globalThis.list.length; i++) { for (let i = 0; i < globalThis.list.length; i++) {
strtemp = globalThis.list[i].substring(0, 12); strtemp = globalThis.list[i].substring(0, 12);
if (strtemp === "MainAbility2") { if (strtemp === "MainAbility2") {
listtemp.push(globalThis.list[i]); listtemp.push(globalThis.list[i]);
...@@ -132,8 +132,8 @@ export default function lifecycleTest() { ...@@ -132,8 +132,8 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0200", 0, async function (done) { it("Singlehap_LifeCycleTest_0200", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0200 START-------------"); console.log("------------Singlehap_LifeCycleTest_0200 START-------------");
TAG = "Singlehap_LifeCycleTest_0200"; TAG = "Singlehap_LifeCycleTest_0200";
var code; let code;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -144,7 +144,7 @@ export default function lifecycleTest() { ...@@ -144,7 +144,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -158,10 +158,10 @@ export default function lifecycleTest() { ...@@ -158,10 +158,10 @@ export default function lifecycleTest() {
setTimeout(function () { setTimeout(function () {
console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1));
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp1 = []; let listtemp1 = [];
for (var i = 0; i < globalThis.list1.length; i++) { for (let i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12); strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1") { if (strtemp === "MainAbility1") {
listtemp.push(globalThis.list1[i]); listtemp.push(globalThis.list1[i]);
...@@ -206,8 +206,8 @@ export default function lifecycleTest() { ...@@ -206,8 +206,8 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0300", 0, async function (done) { it("Singlehap_LifeCycleTest_0300", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0300 START-------------"); console.log("------------Singlehap_LifeCycleTest_0300 START-------------");
TAG = "Singlehap_LifeCycleTest_0300"; TAG = "Singlehap_LifeCycleTest_0300";
var code; let code;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -218,7 +218,7 @@ export default function lifecycleTest() { ...@@ -218,7 +218,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -232,10 +232,10 @@ export default function lifecycleTest() { ...@@ -232,10 +232,10 @@ export default function lifecycleTest() {
setTimeout(function () { setTimeout(function () {
console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1));
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp1 = []; let listtemp1 = [];
for (var i = 0; i < globalThis.list1.length; i++) { for (let i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12); strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1") { if (strtemp === "MainAbility1") {
listtemp.push(globalThis.list1[i]); listtemp.push(globalThis.list1[i]);
...@@ -291,8 +291,8 @@ export default function lifecycleTest() { ...@@ -291,8 +291,8 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0400", 0, async function (done) { it("Singlehap_LifeCycleTest_0400", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0400 START-------------"); console.log("------------Singlehap_LifeCycleTest_0400 START-------------");
TAG = "Singlehap_LifeCycleTest_0400"; TAG = "Singlehap_LifeCycleTest_0400";
var code; let code;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility3", "abilityName": "MainAbility3",
} }
...@@ -303,7 +303,7 @@ export default function lifecycleTest() { ...@@ -303,7 +303,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start3 failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start3 failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -317,10 +317,10 @@ export default function lifecycleTest() { ...@@ -317,10 +317,10 @@ export default function lifecycleTest() {
setTimeout(function () { setTimeout(function () {
console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list3)); console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list3));
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid3)); console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid3));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp1 = []; let listtemp1 = [];
for (var i = 0; i < globalThis.list3.length; i++) { for (let i = 0; i < globalThis.list3.length; i++) {
strtemp = globalThis.list3[i].substring(0, 12); strtemp = globalThis.list3[i].substring(0, 12);
if (strtemp === "MainAbility3") { if (strtemp === "MainAbility3") {
listtemp.push(globalThis.list3[i]); listtemp.push(globalThis.list3[i]);
...@@ -332,7 +332,7 @@ export default function lifecycleTest() { ...@@ -332,7 +332,7 @@ export default function lifecycleTest() {
console.log(TAG + " listtemp1 is :" + JSON.stringify(listtemp1)); console.log(TAG + " listtemp1 is :" + JSON.stringify(listtemp1));
let exlist = listtemp; let exlist = listtemp;
let exlist1 = listtemp1; let exlist1 = listtemp1;
var para = { let para = {
resultCode: 1, resultCode: 1,
want: { want: {
"abilityName": "MainAbility3", "abilityName": "MainAbility3",
...@@ -381,7 +381,7 @@ export default function lifecycleTest() { ...@@ -381,7 +381,7 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0500", 0, async function (done) { it("Singlehap_LifeCycleTest_0500", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0500 START-------------"); console.log("------------Singlehap_LifeCycleTest_0500 START-------------");
TAG = "Singlehap_LifeCycleTest_0500"; TAG = "Singlehap_LifeCycleTest_0500";
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -392,7 +392,7 @@ export default function lifecycleTest() { ...@@ -392,7 +392,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility3", "abilityName": "MainAbility3",
} }
...@@ -413,7 +413,7 @@ export default function lifecycleTest() { ...@@ -413,7 +413,7 @@ export default function lifecycleTest() {
.catch((error) => { .catch((error) => {
console.error(TAG + ' unregisterAbilityLifecycleCallback3 failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' unregisterAbilityLifecycleCallback3 failed. Cause: ' + JSON.stringify(error));
}); });
var str2 = { let str2 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility4", "abilityName": "MainAbility4",
} }
...@@ -458,7 +458,7 @@ export default function lifecycleTest() { ...@@ -458,7 +458,7 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0600", 0, async function (done) { it("Singlehap_LifeCycleTest_0600", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0600 START-------------"); console.log("------------Singlehap_LifeCycleTest_0600 START-------------");
TAG = "Singlehap_LifeCycleTest_0600"; TAG = "Singlehap_LifeCycleTest_0600";
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -469,7 +469,7 @@ export default function lifecycleTest() { ...@@ -469,7 +469,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility5", "abilityName": "MainAbility5",
} }
...@@ -481,7 +481,7 @@ export default function lifecycleTest() { ...@@ -481,7 +481,7 @@ export default function lifecycleTest() {
}) })
}, 500); }, 500);
setTimeout(function () { setTimeout(function () {
var str2 = { let str2 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -495,10 +495,10 @@ export default function lifecycleTest() { ...@@ -495,10 +495,10 @@ export default function lifecycleTest() {
setTimeout(function () { setTimeout(function () {
console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1)); console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1));
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1)); console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp2 = []; let listtemp2 = [];
for (var i = 0; i < globalThis.list1.length; i++) { for (let i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12); strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp == "MainAbility2") { if (strtemp == "MainAbility2") {
listtemp.push(globalThis.list1[i]); listtemp.push(globalThis.list1[i]);
...@@ -542,13 +542,13 @@ export default function lifecycleTest() { ...@@ -542,13 +542,13 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0700", 0, async function (done) { it("Singlehap_LifeCycleTest_0700", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0700 START-------------"); console.log("------------Singlehap_LifeCycleTest_0700 START-------------");
TAG = "Singlehap_LifeCycleTest_0700"; TAG = "Singlehap_LifeCycleTest_0700";
var code1; let code1;
var code2; let code2;
var code3; let code3;
var id1; let id1;
var id2; let id2;
var id3; let id3;
var listKey8 = []; let listKey8 = [];
let AbilityLifecycleCallback = { let AbilityLifecycleCallback = {
onAbilityCreate(ability) { onAbilityCreate(ability) {
console.log(TAG + " onAbilityCreate ability:" + JSON.stringify(ability)); console.log(TAG + " onAbilityCreate ability:" + JSON.stringify(ability));
...@@ -663,7 +663,7 @@ export default function lifecycleTest() { ...@@ -663,7 +663,7 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0800", 0, async function (done) { it("Singlehap_LifeCycleTest_0800", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0800 START-------------"); console.log("------------Singlehap_LifeCycleTest_0800 START-------------");
TAG = "Singlehap_LifeCycleTest_0800"; TAG = "Singlehap_LifeCycleTest_0800";
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -674,7 +674,7 @@ export default function lifecycleTest() { ...@@ -674,7 +674,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -686,7 +686,7 @@ export default function lifecycleTest() { ...@@ -686,7 +686,7 @@ export default function lifecycleTest() {
}) })
}, 1500); }, 1500);
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -699,7 +699,7 @@ export default function lifecycleTest() { ...@@ -699,7 +699,7 @@ export default function lifecycleTest() {
}, 3000); }, 3000);
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -714,10 +714,10 @@ export default function lifecycleTest() { ...@@ -714,10 +714,10 @@ export default function lifecycleTest() {
setTimeout(function () { setTimeout(function () {
console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1));
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp1 = []; let listtemp1 = [];
for (var i = 0; i < globalThis.list1.length; i++) { for (let i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12); strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1") { if (strtemp === "MainAbility1") {
listtemp.push(globalThis.list1[i]); listtemp.push(globalThis.list1[i]);
...@@ -770,7 +770,7 @@ export default function lifecycleTest() { ...@@ -770,7 +770,7 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_0900", 0, async function (done) { it("Singlehap_LifeCycleTest_0900", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_0900 START-------------"); console.log("------------Singlehap_LifeCycleTest_0900 START-------------");
TAG = "Singlehap_LifeCycleTest_0900"; TAG = "Singlehap_LifeCycleTest_0900";
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -781,7 +781,7 @@ export default function lifecycleTest() { ...@@ -781,7 +781,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -793,7 +793,7 @@ export default function lifecycleTest() { ...@@ -793,7 +793,7 @@ export default function lifecycleTest() {
}) })
}, 500); }, 500);
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -807,10 +807,10 @@ export default function lifecycleTest() { ...@@ -807,10 +807,10 @@ export default function lifecycleTest() {
setTimeout(function () { setTimeout(function () {
console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1));
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp1 = []; let listtemp1 = [];
for (var i = 0; i < globalThis.list1.length; i++) { for (let i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12); strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1") { if (strtemp === "MainAbility1") {
listtemp.push(globalThis.list1[i]); listtemp.push(globalThis.list1[i]);
...@@ -859,9 +859,9 @@ export default function lifecycleTest() { ...@@ -859,9 +859,9 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_1000", 0, async function (done) { it("Singlehap_LifeCycleTest_1000", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_1000 START-------------"); console.log("------------Singlehap_LifeCycleTest_1000 START-------------");
TAG = "Singlehap_LifeCycleTest_1000"; TAG = "Singlehap_LifeCycleTest_1000";
var id1; let id1;
var id2; let id2;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility6", "abilityName": "MainAbility6",
} }
...@@ -876,7 +876,7 @@ export default function lifecycleTest() { ...@@ -876,7 +876,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid6)); console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid6));
id1 = globalThis.callbackid6; id1 = globalThis.callbackid6;
console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); console.log(TAG + " firstCallback id : " + JSON.stringify(id1));
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -912,9 +912,9 @@ export default function lifecycleTest() { ...@@ -912,9 +912,9 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_1100", 0, async function (done) { it("Singlehap_LifeCycleTest_1100", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_1100 START-------------"); console.log("------------Singlehap_LifeCycleTest_1100 START-------------");
TAG = "Singlehap_LifeCycleTest_1100"; TAG = "Singlehap_LifeCycleTest_1100";
var id1; let id1;
var id2; let id2;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility7", "abilityName": "MainAbility7",
} }
...@@ -929,7 +929,7 @@ export default function lifecycleTest() { ...@@ -929,7 +929,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid7)); console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid7));
id1 = globalThis.callbackid7; id1 = globalThis.callbackid7;
console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); console.log(TAG + " firstCallback id : " + JSON.stringify(id1));
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility7", "abilityName": "MainAbility7",
} }
...@@ -951,7 +951,7 @@ export default function lifecycleTest() { ...@@ -951,7 +951,7 @@ export default function lifecycleTest() {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
",data: " + JSON.stringify(data)); ",data: " + JSON.stringify(data));
}); });
var para = { let para = {
resultCode: 1, resultCode: 1,
want: { want: {
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
...@@ -976,9 +976,9 @@ export default function lifecycleTest() { ...@@ -976,9 +976,9 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_1200", 0, async function (done) { it("Singlehap_LifeCycleTest_1200", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_1200 START-------------"); console.log("------------Singlehap_LifeCycleTest_1200 START-------------");
TAG = "Singlehap_LifeCycleTest_1200"; TAG = "Singlehap_LifeCycleTest_1200";
var id1; let id1;
var id2; let id2;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility8", "abilityName": "MainAbility8",
} }
...@@ -993,7 +993,7 @@ export default function lifecycleTest() { ...@@ -993,7 +993,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid8)); console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid8));
id1 = globalThis.callbackid8; id1 = globalThis.callbackid8;
console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); console.log(TAG + " firstCallback id : " + JSON.stringify(id1));
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility8", "abilityName": "MainAbility8",
} }
...@@ -1015,7 +1015,7 @@ export default function lifecycleTest() { ...@@ -1015,7 +1015,7 @@ export default function lifecycleTest() {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
",data: " + JSON.stringify(data)); ",data: " + JSON.stringify(data));
}); });
var para = { let para = {
resultCode: 1, resultCode: 1,
want: { want: {
"abilityName": "MainAbility8", "abilityName": "MainAbility8",
...@@ -1065,7 +1065,7 @@ export default function lifecycleTest() { ...@@ -1065,7 +1065,7 @@ export default function lifecycleTest() {
setTimeout(() => { setTimeout(() => {
console.log(TAG + ": second Hap1MainAbility1 startAbility success, err: " + JSON.stringify(error) + console.log(TAG + ": second Hap1MainAbility1 startAbility success, err: " + JSON.stringify(error) +
",data: " + JSON.stringify(data)); ",data: " + JSON.stringify(data));
for (var i = 0; i < globalThis.mainAbility9ListKey.length; i++) { for (let i = 0; i < globalThis.mainAbility9ListKey.length; i++) {
if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility1") { if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility1") {
listKeyTemp.push(globalThis.mainAbility9ListKey[i]); listKeyTemp.push(globalThis.mainAbility9ListKey[i]);
} }
...@@ -1122,7 +1122,7 @@ export default function lifecycleTest() { ...@@ -1122,7 +1122,7 @@ export default function lifecycleTest() {
setTimeout(() => { setTimeout(() => {
console.log(TAG + ": second Hap1MainAbility2 startAbility success, err: " + JSON.stringify(error) + console.log(TAG + ": second Hap1MainAbility2 startAbility success, err: " + JSON.stringify(error) +
",data: " + JSON.stringify(data)); ",data: " + JSON.stringify(data));
for (var i = 0;i < globalThis.mainAbility9ListKey.length; i++) { for (let i = 0;i < globalThis.mainAbility9ListKey.length; i++) {
if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility2") { if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility2") {
listKeyTemp.push(globalThis.mainAbility9ListKey[i]); listKeyTemp.push(globalThis.mainAbility9ListKey[i]);
} }
...@@ -1160,9 +1160,9 @@ export default function lifecycleTest() { ...@@ -1160,9 +1160,9 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_1500", 0, async function (done) { it("Singlehap_LifeCycleTest_1500", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_1500 START-------------"); console.log("------------Singlehap_LifeCycleTest_1500 START-------------");
TAG = "Singlehap_LifeCycleTest_1500"; TAG = "Singlehap_LifeCycleTest_1500";
var id1; let id1;
var id2; let id2;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility11", "abilityName": "MainAbility11",
} }
...@@ -1173,7 +1173,7 @@ export default function lifecycleTest() { ...@@ -1173,7 +1173,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -1189,7 +1189,7 @@ export default function lifecycleTest() { ...@@ -1189,7 +1189,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid11)); console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid11));
id1 = globalThis.callbackid11; id1 = globalThis.callbackid11;
console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); console.log(TAG + " firstCallback id : " + JSON.stringify(id1));
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility11", "abilityName": "MainAbility11",
} }
...@@ -1200,7 +1200,7 @@ export default function lifecycleTest() { ...@@ -1200,7 +1200,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -1217,9 +1217,9 @@ export default function lifecycleTest() { ...@@ -1217,9 +1217,9 @@ export default function lifecycleTest() {
console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid11)); console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid11));
id2 = globalThis.callbackid11; id2 = globalThis.callbackid11;
console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); console.log(TAG + " secondCallback id : " + JSON.stringify(id2));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
for (var i = 0; i < globalThis.list11.length; i++) { for (let i = 0; i < globalThis.list11.length; i++) {
strtemp = globalThis.list11[i].substring(0, 12); strtemp = globalThis.list11[i].substring(0, 12);
if (strtemp == "MainAbility2") { if (strtemp == "MainAbility2") {
listtemp.push(globalThis.list11[i]); listtemp.push(globalThis.list11[i]);
...@@ -1244,9 +1244,9 @@ export default function lifecycleTest() { ...@@ -1244,9 +1244,9 @@ export default function lifecycleTest() {
}, 6000); }, 6000);
}); });
var callbackid_NA = 100 let callbackid_NA = 100
var callbackid_errorNum = -1 let callbackid_errorNum = -1
var callbackid_errorType = "test" let callbackid_errorType = "test"
/* /*
* @tc.number Singlehap_LifeCycleTest_1600 * @tc.number Singlehap_LifeCycleTest_1600
* @tc.name input Nonexistent callbackid for unregisterAbilityLifecycleCallback parameter * @tc.name input Nonexistent callbackid for unregisterAbilityLifecycleCallback parameter
...@@ -1340,9 +1340,9 @@ export default function lifecycleTest() { ...@@ -1340,9 +1340,9 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_2000", 0, async function (done) { it("Singlehap_LifeCycleTest_2000", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_2000 START-------------"); console.log("------------Singlehap_LifeCycleTest_2000 START-------------");
TAG = "Singlehap_LifeCycleTest_2000"; TAG = "Singlehap_LifeCycleTest_2000";
var id1; let id1;
var id2; let id2;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
...@@ -1353,7 +1353,7 @@ export default function lifecycleTest() { ...@@ -1353,7 +1353,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -1369,7 +1369,7 @@ export default function lifecycleTest() { ...@@ -1369,7 +1369,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid12)); console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid12));
id1 = globalThis.callbackid12; id1 = globalThis.callbackid12;
console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); console.log(TAG + " firstCallback id : " + JSON.stringify(id1));
var para = { let para = {
resultCode: 2000, resultCode: 2000,
want: { want: {
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
...@@ -1385,7 +1385,7 @@ export default function lifecycleTest() { ...@@ -1385,7 +1385,7 @@ export default function lifecycleTest() {
}); });
}, 2500); }, 2500);
setTimeout(function () { setTimeout(function () {
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
...@@ -1396,7 +1396,7 @@ export default function lifecycleTest() { ...@@ -1396,7 +1396,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -1413,9 +1413,9 @@ export default function lifecycleTest() { ...@@ -1413,9 +1413,9 @@ export default function lifecycleTest() {
console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid12)); console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid12));
id2 = globalThis.callbackid12; id2 = globalThis.callbackid12;
console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); console.log(TAG + " secondCallback id : " + JSON.stringify(id2));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
for (var i = 0; i < globalThis.list12.length; i++) { for (let i = 0; i < globalThis.list12.length; i++) {
strtemp = globalThis.list12[i].substring(0, 12); strtemp = globalThis.list12[i].substring(0, 12);
if (strtemp == "MainAbility2") { if (strtemp == "MainAbility2") {
listtemp.push(globalThis.list12[i]); listtemp.push(globalThis.list12[i]);
...@@ -1450,11 +1450,11 @@ export default function lifecycleTest() { ...@@ -1450,11 +1450,11 @@ export default function lifecycleTest() {
it("Singlehap_LifeCycleTest_2100", 0, async function (done) { it("Singlehap_LifeCycleTest_2100", 0, async function (done) {
console.log("------------Singlehap_LifeCycleTest_2100 START-------------"); console.log("------------Singlehap_LifeCycleTest_2100 START-------------");
TAG = "Singlehap_LifeCycleTest_2100"; TAG = "Singlehap_LifeCycleTest_2100";
var id1; let id1;
var id2; let id2;
var id3; let id3;
var id4; let id4;
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -1465,7 +1465,7 @@ export default function lifecycleTest() { ...@@ -1465,7 +1465,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
...@@ -1476,7 +1476,7 @@ export default function lifecycleTest() { ...@@ -1476,7 +1476,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str2 = { let str2 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -1497,7 +1497,7 @@ export default function lifecycleTest() { ...@@ -1497,7 +1497,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback id1 : " + JSON.stringify(id1)); console.log(TAG + " firstCallback id1 : " + JSON.stringify(id1));
id2 = globalThis.callbackid12; id2 = globalThis.callbackid12;
console.log(TAG + " firstCallback id12 : " + JSON.stringify(id2)); console.log(TAG + " firstCallback id12 : " + JSON.stringify(id2));
var para = { let para = {
resultCode: 2100, resultCode: 2100,
want: { want: {
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
...@@ -1512,7 +1512,7 @@ export default function lifecycleTest() { ...@@ -1512,7 +1512,7 @@ export default function lifecycleTest() {
console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error));
}); });
setTimeout(function () { setTimeout(function () {
var para = { let para = {
resultCode: 2100, resultCode: 2100,
want: { want: {
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
...@@ -1529,7 +1529,7 @@ export default function lifecycleTest() { ...@@ -1529,7 +1529,7 @@ export default function lifecycleTest() {
}, 500); }, 500);
}, 3000); }, 3000);
setTimeout(function () { setTimeout(function () {
var str = { let str = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
...@@ -1540,7 +1540,7 @@ export default function lifecycleTest() { ...@@ -1540,7 +1540,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str1 = { let str1 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
...@@ -1551,7 +1551,7 @@ export default function lifecycleTest() { ...@@ -1551,7 +1551,7 @@ export default function lifecycleTest() {
console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error));
}) })
setTimeout(function () { setTimeout(function () {
var str2 = { let str2 = {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
...@@ -1577,10 +1577,10 @@ export default function lifecycleTest() { ...@@ -1577,10 +1577,10 @@ export default function lifecycleTest() {
console.log(TAG + " secondCallback id1 : " + JSON.stringify(id3)); console.log(TAG + " secondCallback id1 : " + JSON.stringify(id3));
id4 = globalThis.callbackid12; id4 = globalThis.callbackid12;
console.log(TAG + " secondCallback id12 : " + JSON.stringify(id4)); console.log(TAG + " secondCallback id12 : " + JSON.stringify(id4));
var strtemp = ""; let strtemp = "";
var listtemp = []; let listtemp = [];
var listtemp12 = []; let listtemp12 = [];
for (var i = 0; i < templist1.length; i++) { for (let i = 0; i < templist1.length; i++) {
strtemp = templist1[i].substring(0, 13); strtemp = templist1[i].substring(0, 13);
if (strtemp === "MainAbility2 ") { if (strtemp === "MainAbility2 ") {
listtemp.push(templist1[i]); listtemp.push(templist1[i]);
...@@ -1591,9 +1591,9 @@ export default function lifecycleTest() { ...@@ -1591,9 +1591,9 @@ export default function lifecycleTest() {
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
console.log(TAG + " listtemp12 is :" + JSON.stringify(listtemp12)); console.log(TAG + " listtemp12 is :" + JSON.stringify(listtemp12));
setTimeout(function () { setTimeout(function () {
var strtemp1 = ""; let strtemp1 = "";
var listtemp1 = []; let listtemp1 = [];
for (var j = 0; j < templist2.length; j++) { for (let j = 0; j < templist2.length; j++) {
strtemp1 = templist2[j].substring(0, 12); strtemp1 = templist2[j].substring(0, 12);
if (strtemp1 === "MainAbility2") { if (strtemp1 === "MainAbility2") {
listtemp1.push(templist2[j]); listtemp1.push(templist2[j]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册