From 4606f458c1b8651d4b56211efd79e22f721a866b 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: Wed, 30 Nov 2022 16:38:57 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96displayAndWindowRefactorInt?= =?UTF-8?q?erface.test=E7=94=A8=E4=BE=8BsetWindowModeTest2=20=202=E3=80=81?= =?UTF-8?q?=E8=A1=A5=E5=85=85callback=E7=94=A8=E4=BE=8BcreateTest5?= =?UTF-8?q?=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 华华小仙女 --- .../displayAndWindowRefactorInterface.test.ets | 16 +++++++++++----- .../src/main/ets/test/windowCallback.test.ets | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets b/graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets index 7b5a5f9f4..60e1a470e 100644 --- a/graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets @@ -1921,11 +1921,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta expect(!!wnd).assertTrue(); let loopCount = windowModeArr; console.log(msgStr + 'ohosWindow.windowType' + JSON.stringify(loopCount)) - for (let i = 0; i < loopCount.length; i++) { - sleep(500) - let tempType = ohosWindow.WindowMode[loopCount[i]]; - console.log(msgStr + 'tempWnd.setWindowMode ' + tempType + ' start'); + getData(0, loopCount.length) + + function getData(i, length) { try { + let tempType = ohosWindow.WindowMode[loopCount[i]]; + console.log(msgStr + 'tempWnd.setWindowMode tempType:' + tempType + ' start i:' + i); wnd.setWindowMode(tempType, (err, data) => { if (err && err.code) { console.log(msgStr + 'currentType: ' + tempType) @@ -1937,11 +1938,16 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta console.info(msgStr + 'Succeeded in setting the window mode. loopCount.length: ' + loopCount.length); if (sumCount == loopCount.length) done(); } + if (++i < length) { + getData(i, length) + console.log(msgStr + 'jixuzhixing i: ' + i); + } else { + console.log(msgStr + 'i++ { let caseName = 'createTest5'; -- GitLab