提交 bdb0683f 编写于 作者: Z zhoujun62

Solve XTS Singlehap_LifeCycleTest_2100 fail problem

Signed-off-by: Nzhoujun62 <zhoujun62@huawei.com>
上级 bfab3de2
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class Hap1MainAbility1 extends Ability { export default class Hap1MainAbility1 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] Hap1MainAbility1 onCreate") console.log("[Demo] Hap1MainAbility1 onCreate")
globalThis.abilityWant = want; globalThis.ability1Hap1Want = want;
setTimeout(() => { setTimeout(() => {
this.context.terminateSelf().then((data) => { this.context.terminateSelf().then((data) => {
console.log("Hap1MainAbility1 EventTest terminateSelf data: " + JSON.stringify(data)); console.log("Hap1MainAbility1 EventTest terminateSelf data: " + JSON.stringify(data));
......
...@@ -17,8 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,8 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class Hap1MainAbility2 extends Ability { export default class Hap1MainAbility2 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] Hap1MainAbility2 onCreate") console.log("[Demo] Hap1MainAbility2 onCreate")
globalThis.abilityWant = want; globalThis.ability2Hap1Want = want;
setTimeout(() => { setTimeout(() => {
this.context.terminateSelf().then((data) => { this.context.terminateSelf().then((data) => {
console.log("Hap1MainAbility2 EventTest terminateSelf data: " + JSON.stringify(data)); console.log("Hap1MainAbility2 EventTest terminateSelf data: " + JSON.stringify(data));
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility1 extends Ability { export default class MainAbility1 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility1 onCreate") console.log("[Demo] MainAbility1 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant1 = want;
console.log("[Demo] MainAbility1 context: " + JSON.stringify(this.context)); console.log("[Demo] MainAbility1 context: " + JSON.stringify(this.context));
var listKey1 = []; var listKey1 = [];
let AbilityLifecycleCallback = { let AbilityLifecycleCallback = {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility10 extends Ability { export default class MainAbility10 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility10 onCreate") console.log("[Demo] MainAbility10 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant10 = want;
var listKey10 = []; var listKey10 = [];
let AbilityLifecycleCallback = { let AbilityLifecycleCallback = {
onAbilityCreate(ability) { onAbilityCreate(ability) {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility11 extends Ability { export default class MainAbility11 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility11 onCreate") console.log("[Demo] MainAbility11 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant11 = want;
globalThis.ability11 = this.context; globalThis.ability11 = this.context;
var listKey11 = []; var listKey11 = [];
let AbilityLifecycleCallback = { let AbilityLifecycleCallback = {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility12 extends Ability { export default class MainAbility12 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility12 onCreate") console.log("[Demo] MainAbility12 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant12 = want;
var listKey12 = []; var listKey12 = [];
let AbilityLifecycleCallback = { let AbilityLifecycleCallback = {
onAbilityCreate(ability) { onAbilityCreate(ability) {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
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.abilityWant = want; globalThis.abilityWant2 = want;
} }
onDestroy() { onDestroy() {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
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.abilityWant = want; globalThis.abilityWant3 = want;
console.log("[Demo] MainAbility3 context: " + JSON.stringify(this.context)); console.log("[Demo] MainAbility3 context: " + JSON.stringify(this.context));
var listKey3 = []; var listKey3 = [];
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility4 extends Ability { export default class MainAbility4 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility4 onCreate") console.log("[Demo] MainAbility4 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant4 = want;
console.log("[Demo] MainAbility4 context: " + JSON.stringify(this.context)); console.log("[Demo] MainAbility4 context: " + JSON.stringify(this.context));
var listKey4 = []; var listKey4 = [];
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
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.abilityWant = want; globalThis.abilityWant5 = want;
} }
onDestroy() { onDestroy() {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility6 extends Ability { export default class MainAbility6 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility6 onCreate") console.log("[Demo] MainAbility6 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant6 = want;
} }
onDestroy() { onDestroy() {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility7 extends Ability { export default class MainAbility7 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility7 onCreate") console.log("[Demo] MainAbility7 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant7 = want;
} }
onDestroy() { onDestroy() {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility8 extends Ability { export default class MainAbility8 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility8 onCreate") console.log("[Demo] MainAbility8 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant8 = want;
} }
onDestroy() { onDestroy() {
......
...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility' ...@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility9 extends Ability { export default class MainAbility9 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility9 onCreate") console.log("[Demo] MainAbility9 onCreate")
globalThis.abilityWant = want; globalThis.abilityWant9 = want;
} }
onDestroy() { onDestroy() {
......
...@@ -82,7 +82,7 @@ export default function lifecycleTest() { ...@@ -82,7 +82,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -137,7 +137,7 @@ export default function lifecycleTest() { ...@@ -137,7 +137,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -148,7 +148,7 @@ export default function lifecycleTest() { ...@@ -148,7 +148,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -211,7 +211,7 @@ export default function lifecycleTest() { ...@@ -211,7 +211,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -222,7 +222,7 @@ export default function lifecycleTest() { ...@@ -222,7 +222,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -296,7 +296,7 @@ export default function lifecycleTest() { ...@@ -296,7 +296,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility3", "abilityName": "MainAbility3",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start3 successful. Data: ' + data); console.info(TAG + ' start3 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -307,7 +307,7 @@ export default function lifecycleTest() { ...@@ -307,7 +307,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start2 successful. Data: ' + data); console.info(TAG + ' start2 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -385,7 +385,7 @@ export default function lifecycleTest() { ...@@ -385,7 +385,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start1 successful. Data: ' + data); console.info(TAG + ' start1 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -396,7 +396,7 @@ export default function lifecycleTest() { ...@@ -396,7 +396,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility3", "abilityName": "MainAbility3",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start3 successful. Data: ' + data); console.info(TAG + ' start3 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -417,7 +417,7 @@ export default function lifecycleTest() { ...@@ -417,7 +417,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility4", "abilityName": "MainAbility4",
} }
globalThis.globalThis.abilityContext.startAbility(str2) globalThis.abilityContext.startAbility(str2)
.then((data) => { .then((data) => {
console.info(TAG + ' start4 successful. Data: ' + data); console.info(TAG + ' start4 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -462,7 +462,7 @@ export default function lifecycleTest() { ...@@ -462,7 +462,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start1 successful. Data: ' + data); console.info(TAG + ' start1 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -473,7 +473,7 @@ export default function lifecycleTest() { ...@@ -473,7 +473,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility5", "abilityName": "MainAbility5",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start5 successful. Data: ' + data); console.info(TAG + ' start5 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -485,7 +485,7 @@ export default function lifecycleTest() { ...@@ -485,7 +485,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str2) globalThis.abilityContext.startAbility(str2)
.then((data) => { .then((data) => {
console.info(TAG + ' start2 successful. Data: ' + data); console.info(TAG + ' start2 successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -618,7 +618,7 @@ export default function lifecycleTest() { ...@@ -618,7 +618,7 @@ export default function lifecycleTest() {
listKey8.push(abilityname + " onAbilityContinue"); listKey8.push(abilityname + " onAbilityContinue");
} }
} }
let applicationContext = globalThis.globalThis.abilityContext.getApplicationContext(); let applicationContext = globalThis.abilityContext.getApplicationContext();
id1 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); id1 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback);
console.log(TAG + " registerAbilityLifecycleCallback1 number: " + JSON.stringify(id1)); console.log(TAG + " registerAbilityLifecycleCallback1 number: " + JSON.stringify(id1));
applicationContext.unregisterAbilityLifecycleCallback(id1, (error, data) => { applicationContext.unregisterAbilityLifecycleCallback(id1, (error, data) => {
...@@ -667,7 +667,7 @@ export default function lifecycleTest() { ...@@ -667,7 +667,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -678,7 +678,7 @@ export default function lifecycleTest() { ...@@ -678,7 +678,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -690,7 +690,7 @@ export default function lifecycleTest() { ...@@ -690,7 +690,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -703,7 +703,7 @@ export default function lifecycleTest() { ...@@ -703,7 +703,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -774,7 +774,7 @@ export default function lifecycleTest() { ...@@ -774,7 +774,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -785,7 +785,7 @@ export default function lifecycleTest() { ...@@ -785,7 +785,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -797,7 +797,7 @@ export default function lifecycleTest() { ...@@ -797,7 +797,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -865,7 +865,7 @@ export default function lifecycleTest() { ...@@ -865,7 +865,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility6", "abilityName": "MainAbility6",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -880,7 +880,7 @@ export default function lifecycleTest() { ...@@ -880,7 +880,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -918,7 +918,7 @@ export default function lifecycleTest() { ...@@ -918,7 +918,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility7", "abilityName": "MainAbility7",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -933,7 +933,7 @@ export default function lifecycleTest() { ...@@ -933,7 +933,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility7", "abilityName": "MainAbility7",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -982,7 +982,7 @@ export default function lifecycleTest() { ...@@ -982,7 +982,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility8", "abilityName": "MainAbility8",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -997,7 +997,7 @@ export default function lifecycleTest() { ...@@ -997,7 +997,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility8", "abilityName": "MainAbility8",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1166,7 +1166,7 @@ export default function lifecycleTest() { ...@@ -1166,7 +1166,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility11", "abilityName": "MainAbility11",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1177,7 +1177,7 @@ export default function lifecycleTest() { ...@@ -1177,7 +1177,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1193,7 +1193,7 @@ export default function lifecycleTest() { ...@@ -1193,7 +1193,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility11", "abilityName": "MainAbility11",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1204,7 +1204,7 @@ export default function lifecycleTest() { ...@@ -1204,7 +1204,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1346,7 +1346,7 @@ export default function lifecycleTest() { ...@@ -1346,7 +1346,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1357,7 +1357,7 @@ export default function lifecycleTest() { ...@@ -1357,7 +1357,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1389,7 +1389,7 @@ export default function lifecycleTest() { ...@@ -1389,7 +1389,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1400,7 +1400,7 @@ export default function lifecycleTest() { ...@@ -1400,7 +1400,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1458,7 +1458,7 @@ export default function lifecycleTest() { ...@@ -1458,7 +1458,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1469,7 +1469,7 @@ export default function lifecycleTest() { ...@@ -1469,7 +1469,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1480,7 +1480,7 @@ export default function lifecycleTest() { ...@@ -1480,7 +1480,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str2) globalThis.abilityContext.startAbility(str2)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1533,7 +1533,7 @@ export default function lifecycleTest() { ...@@ -1533,7 +1533,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility1", "abilityName": "MainAbility1",
} }
globalThis.globalThis.abilityContext.startAbility(str) globalThis.abilityContext.startAbility(str)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1544,7 +1544,7 @@ export default function lifecycleTest() { ...@@ -1544,7 +1544,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility12", "abilityName": "MainAbility12",
} }
globalThis.globalThis.abilityContext.startAbility(str1) globalThis.abilityContext.startAbility(str1)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1555,7 +1555,7 @@ export default function lifecycleTest() { ...@@ -1555,7 +1555,7 @@ export default function lifecycleTest() {
"bundleName": "com.example.lifecycle_xts", "bundleName": "com.example.lifecycle_xts",
"abilityName": "MainAbility2", "abilityName": "MainAbility2",
} }
globalThis.globalThis.abilityContext.startAbility(str2) globalThis.abilityContext.startAbility(str2)
.then((data) => { .then((data) => {
console.info(TAG + ' start successful. Data: ' + data); console.info(TAG + ' start successful. Data: ' + data);
}).catch((error) => { }).catch((error) => {
...@@ -1608,12 +1608,12 @@ export default function lifecycleTest() { ...@@ -1608,12 +1608,12 @@ export default function lifecycleTest() {
expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground");
expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground");
expect(exlist[4]).assertEqual("MainAbility2 onWindowStageDestroy"); expect(exlist[4]).assertEqual("MainAbility2 onWindowStageDestroy");
expect(exlist12[0]).assertEqual("MainAbility2 onAbilityDestroy"); expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy");
expect(exlist12[1]).assertEqual("MainAbility12 onAbilityCreate"); expect(exlist12[0]).assertEqual("MainAbility12 onAbilityCreate");
expect(exlist12[2]).assertEqual("MainAbility12 onWindowStageCreate"); expect(exlist12[1]).assertEqual("MainAbility12 onWindowStageCreate");
expect(exlist12[3]).assertEqual("MainAbility12 onAbilityForeground"); expect(exlist12[2]).assertEqual("MainAbility12 onAbilityForeground");
expect(exlist12[4]).assertEqual("MainAbility12 onAbilityBackground"); expect(exlist12[3]).assertEqual("MainAbility12 onAbilityBackground");
expect(exlist12[5]).assertEqual("MainAbility12 onAbilityForeground"); expect(exlist12[4]).assertEqual("MainAbility12 onAbilityForeground");
expect(exlist1[0]).assertEqual("MainAbility2 onAbilityCreate"); expect(exlist1[0]).assertEqual("MainAbility2 onAbilityCreate");
expect(exlist1[1]).assertEqual("MainAbility2 onWindowStageCreate"); expect(exlist1[1]).assertEqual("MainAbility2 onWindowStageCreate");
expect(exlist1[2]).assertEqual("MainAbility2 onAbilityForeground"); expect(exlist1[2]).assertEqual("MainAbility2 onAbilityForeground");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册