未验证 提交 1f096b63 编写于 作者: O openharmony_ci 提交者: Gitee

!5663 Solve XTS ActsFaApiCoverTest fail problem

Merge pull request !5663 from zhoujun62/my_xts_acts
...@@ -39,7 +39,7 @@ export default function ApiCoverTest() { ...@@ -39,7 +39,7 @@ export default function ApiCoverTest() {
afterEach(async (done) => { afterEach(async (done) => {
setTimeout(function () { setTimeout(function () {
done(); done();
}, 2000); }, 2500);
}) })
/* /*
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"test-timeout": "600000", "test-timeout": "600000",
"bundle-name": "com.example.faapicoverhaptest", "bundle-name": "com.example.faapicoverhaptest",
"package-name": "com.example.faapicoverhaptest", "package-name": "com.example.faapicoverhaptest",
"shell-timeout": "600000" "shell-timeout": "600000",
"testcase-timeout": 70000
}, },
"kits": [ "kits": [
{ {
......
...@@ -22,6 +22,15 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -22,6 +22,15 @@ import featureAbility from '@ohos.ability.featureAbility'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default { export default {
data: { data: {
title: "" title: ""
...@@ -38,7 +47,7 @@ export default { ...@@ -38,7 +47,7 @@ export default {
}, },
async onShow() { async onShow() {
console.info('ACTS_NewWant Api7 onShow'); console.info('ACTS_NewWant Api7 onShow');
sleep(1000)
await featureAbility.startAbility( await featureAbility.startAbility(
{ {
want: want:
......
...@@ -593,8 +593,10 @@ export default function abilityTest() { ...@@ -593,8 +593,10 @@ export default function abilityTest() {
console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>" console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>"
+ flagOnNewWant) + flagOnNewWant)
if (flagOnCreate == 0 && flagOnWindowStageCreate == 0 if ((flagOnCreate == 0 && flagOnWindowStageCreate == 0
&& flagOnForeground == 2 && flagOnNewWant == 1) { && flagOnForeground == 2 && flagOnNewWant == 1)
|| (flagOnCreate == 1 && flagOnWindowStageCreate == 1
&& flagOnForeground == 2 && flagOnNewWant == 0)) {
flagNewWant = true; flagNewWant = true;
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册