提交 798a1cbb 编写于 作者: Z z00445003 提交者: zhoujun62

solve ActsAmsNewWantTest fail problem

Signed-off-by: Nz00445003 <zhoujun62@huawei.com>
Change-Id: I31b591283dbd650b4c8f93bfae777c27ffd2be3e
上级 7c85e372
...@@ -56,7 +56,7 @@ group("ability_runtime") { ...@@ -56,7 +56,7 @@ group("ability_runtime") {
"stage:stage", "stage:stage",
"want:want", "want:want",
"workercontextcover:workercontextcover", "workercontextcover:workercontextcover",
"actsdataabilityaccessdatasharetest:dataabilityaccessdatashare",
#"zidltest:zidltest", #"zidltest:zidltest",
] ]
} }
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability // Ability is creating, initialize resources for this ability
...@@ -48,6 +52,7 @@ export default class MainAbility extends Ability { ...@@ -48,6 +52,7 @@ export default class MainAbility extends Ability {
} }
onForeground() { onForeground() {
sleep(1000)
// Ability has brought to foreground // Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground") console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startHapC') { if (globalThis.abilityWant.action == 'startHapC') {
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability // Ability is creating, initialize resources for this ability
...@@ -48,6 +52,7 @@ export default class MainAbility extends Ability { ...@@ -48,6 +52,7 @@ export default class MainAbility extends Ability {
} }
onForeground() { onForeground() {
sleep(1000)
// Ability has brought to foreground // Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground") console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startHapB') { if (globalThis.abilityWant.action == 'startHapB') {
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability // Ability is creating, initialize resources for this ability
...@@ -48,6 +52,7 @@ export default class MainAbility extends Ability { ...@@ -48,6 +52,7 @@ export default class MainAbility extends Ability {
} }
onForeground() { onForeground() {
sleep(1000)
// Ability has brought to foreground // Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground") console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startStandard0400') { if (globalThis.abilityWant.action == 'startStandard0400') {
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default class SecondAbility extends Ability { export default class SecondAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
...@@ -48,6 +52,7 @@ export default class SecondAbility extends Ability { ...@@ -48,6 +52,7 @@ export default class SecondAbility extends Ability {
} }
onForeground() { onForeground() {
sleep(1000)
// Ability has brought to foreground // Ability has brought to foreground
var connId; var connId;
console.log("ACTS_NewWant SecondAbility onForeground") console.log("ACTS_NewWant SecondAbility onForeground")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册