From a40bbd31e8ff0bff34dacd79e04cdecc282dbc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E5=8D=8E=E5=B0=8F=E4=BB=99=E5=A5=B3?= Date: Fri, 4 Nov 2022 17:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4@ts-nocheck=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 华华小仙女 --- .../entry/src/main/ets/test/windowPromise.test.ets | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 9c4bb0b09..b55ad1427 100644 --- a/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets @@ -1454,7 +1454,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) }); console.log(msgStr + 'windowStage.getMainWindow :' + JSON.stringify(mainWin)); expect(!!mainWin).assertTrue(); - let orientationItem = ['UNSPECIFIED', 'PORTRAIT', 'LANDSCAPE']; + let num = 0 + let orientationItem = ['UNSPECIFIED', 'PORTRAIT', 'LANDSCAPE', 'PORTRAIT_INVERTED', + 'LANDSCAPE_INVERTED', 'AUTO_ROTATION', 'AUTO_ROTATION_PORTRAIT', 'AUTO_ROTATION_LANDSCAPE', + 'AUTO_ROTATION_RESTRICTED', 'AUTO_ROTATION_PORTRAIT_RESTRICTED', 'AUTO_ROTATION_LANDSCAPE_RESTRICTED', 'LOCKED', 'UNSPECIFIED']; for (let i = 0;i < orientationItem.length; i++) { await sleep(1000); let orientation = ohosWindow.Orientation[orientationItem[i]] @@ -1462,12 +1465,12 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) console.log(msgStr + 'i : ' + i + ' ,ohosWindow.Orientation : ' + JSON.stringify(ohosWindow.Orientation)); await mainWin.setPreferredOrientation(orientation).then(() => { console.log(msgStr + 'success set window.setPreferredOrientation : ' + orientation); + num++ + if(num == orientationItem.length) done(); }).catch(err => { console.log(msgStr + 'window.setPreferredOrientation failed set error:' + orientation); }); } - console.log(msgStr + 'done '); - done(); }) /** * @tc.number SUB_WINDOW_SETFORBIDSPLITMOVE_JSAPI_001 -- GitLab