diff --git a/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets b/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets index d3aecd1ff478ca95c8c2302e72f89f455971523c..b336e9bf57baa1c689a7fdb8cd3817e5b7da59cc 100644 --- a/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets @@ -132,6 +132,8 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) console.log(msgStr + 'tempWnd.on systemAvoidAreaChange, listenerOnFlag : ' + JSON.stringify(listenerOnFlag)); if (listenerOnFlag) { expect(!!avoidAreaData).assertTrue(); + tempWnd.off('systemAvoidAreaChange'); + done(); } }) expect(!!tempWnd).assertTrue(); @@ -147,15 +149,11 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) unexpectedError(err, caseName, 'tempWnd.setSystemBarEnable([])', done); }); console.log(msgStr + 'tempWnd.setSystemBarEnable([]) success'); - - console.log(msgStr + 'tempWnd.on systemAvoidAreaChange finished'); listenerOnFlag = true; await sleep(1000); await tempWnd.setSystemBarEnable(['status', 'navigation']).catch((err) => { unexpectedError(err, caseName, 'tempWnd.setSystemBarEnable([status, navigation])', done); }); - await tempWnd.off('systemAvoidAreaChange'); - done(); console.log(msgStr + 'tempWnd.setSystemBarEnable([status, navigation]) success'); })