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

!6517 fix actswindowstagelifecyclesinglehaptest"

Merge pull request !6517 from xinking129/master
...@@ -46,7 +46,7 @@ export default class MainAbility5 extends Ability { ...@@ -46,7 +46,7 @@ export default class MainAbility5 extends Ability {
}).catch((error) => { }).catch((error) => {
console.error('[Demo] MainAbility5 terminateself failed. Cause: ' + error); console.error('[Demo] MainAbility5 terminateself failed. Cause: ' + error);
}) })
}, 500); }, 1000);
} }
onBackground() { onBackground() {
......
...@@ -410,22 +410,24 @@ export default function lifecycleTest() { ...@@ -410,22 +410,24 @@ export default function lifecycleTest() {
transferStr0 += globalThis.list1[i]; transferStr0 += globalThis.list1[i];
} }
} }
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); setTimeout(()=>{
expect(transferStr0.indexOf("MainAbility5 onWindowStageCreate")!=-1).assertTrue(); console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
expect(transferStr0.indexOf("MainAbility5 onWindowStageActive")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility5 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility5 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageInactive")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageDestroy")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility5 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility5 onWindowStageDestroy")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue(); expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
globalThis.applicationContext1 expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { globalThis.applicationContext1
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
",data: " + JSON.stringify(data)); console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
console.log("------------Singlehap_WindowStageLifeCycleTest_0500 END-------------"); ",data: " + JSON.stringify(data));
done(); console.log("------------Singlehap_WindowStageLifeCycleTest_0500 END-------------");
}) done();
})
},1000)
}, 3800); }, 3800);
}); });
...@@ -617,9 +619,9 @@ export default function lifecycleTest() { ...@@ -617,9 +619,9 @@ export default function lifecycleTest() {
it("Singlehap_WindowStageLifeCycleTest_0800", 0, async function (done) { it("Singlehap_WindowStageLifeCycleTest_0800", 0, async function (done) {
console.log("------------Singlehap_WindowStageLifeCycleTest_0800 START-------------"); console.log("------------Singlehap_WindowStageLifeCycleTest_0800 START-------------");
TAG = "Singlehap_WindowStageLifeCycleTest_0800"; TAG = "Singlehap_WindowStageLifeCycleTest_0800";
var id1; let id1;
var id2; let id2;
var str = { let str = {
"bundleName": "com.example.windowstagelifecycle_xts", "bundleName": "com.example.windowstagelifecycle_xts",
"abilityName": "MainAbility6", "abilityName": "MainAbility6",
} }
...@@ -634,7 +636,7 @@ export default function lifecycleTest() { ...@@ -634,7 +636,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.windowstagelifecycle_xts", "bundleName": "com.example.windowstagelifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册