提交 d2b4ce81 编写于 作者: C chengxingzhen

xts失败用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 fac6ff3d
...@@ -17,14 +17,14 @@ import commonEvent from '@ohos.commonEvent' ...@@ -17,14 +17,14 @@ import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() { function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>"); console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>");
setTimeout(()=>{ setTimeout(()=>{
globalThis.abilityContext.terminateSelf(); globalThis.abilityContextMainAbility2.terminateSelf();
console.debug("====>MainAbility2 terminateSelf succese====>") console.debug("====>MainAbility2 terminateSelf succese====>")
},2000) },5000)
} }
export default class MainAbility2 extends Ability { export default class MainAbility2 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility2 onCreate") console.log("[Demo] MainAbility2 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContextMainAbility2 = this.context
} }
onDestroy() { onDestroy() {
...@@ -36,6 +36,11 @@ export default class MainAbility2 extends Ability { ...@@ -36,6 +36,11 @@ export default class MainAbility2 extends Ability {
console.log("[Demo] MainAbility2 onWindowStageCreate") console.log("[Demo] MainAbility2 onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null) windowStage.setUIContent(this.context, "pages/index", null)
windowStage.on('windowStageEvent', (data)=>{
if(data == 2){
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}
})
} }
onWindowStageDestroy() { onWindowStageDestroy() {
...@@ -46,7 +51,6 @@ export default class MainAbility2 extends Ability { ...@@ -46,7 +51,6 @@ export default class MainAbility2 extends Ability {
onForeground() { onForeground() {
// Ability has brought to foreground // Ability has brought to foreground
console.log("[Demo] MainAbility2 onForeground") console.log("[Demo] MainAbility2 onForeground")
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
} }
onBackground() { onBackground() {
......
...@@ -16,14 +16,14 @@ import Ability from '@ohos.application.Ability' ...@@ -16,14 +16,14 @@ import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() { function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>"); console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>");
globalThis.abilityContext.terminateSelf().then(()=>{ globalThis.abilityContextMainAbility3.terminateSelf().then(()=>{
console.debug("====>MainAbility3 terminateSelf====>"); console.debug("====>MainAbility3 terminateSelf====>");
}); });
} }
export default class MainAbility3 extends Ability { export default class MainAbility3 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility3 onCreate") console.log("[Demo] MainAbility3 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContextMainAbility3 = this.context
} }
onDestroy() { onDestroy() {
......
...@@ -20,7 +20,7 @@ function PublishCallBackOne() { ...@@ -20,7 +20,7 @@ function PublishCallBackOne() {
export default class MainAbility5 extends Ability { export default class MainAbility5 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility5 onCreate") console.log("[Demo] MainAbility5 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContextMainAility5 = this.context
setTimeout(()=> { setTimeout(()=> {
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}, 500) }, 500)
......
...@@ -19,7 +19,7 @@ var subscriberInfo_MainAbility = { ...@@ -19,7 +19,7 @@ var subscriberInfo_MainAbility = {
events: ["ACTS_DoAbility_Event"] events: ["ACTS_DoAbility_Event"]
}; };
var mainability var mainability
const START_ABILITY_TIMEOUT = 4000; const START_ABILITY_TIMEOUT = 10000;
const START_ABILITY_TIMEOUT_TWO_THOUSAND = 2000; const START_ABILITY_TIMEOUT_TWO_THOUSAND = 2000;
const START_ABILITY_TIMEOUT_THOUSAND = 1000; const START_ABILITY_TIMEOUT_THOUSAND = 1000;
export default function abilityTest() { export default function abilityTest() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册