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 7b5a5f9f40d9b6415eb194f397ede4a84b786f2b..60e1a470e2ecf1ec6e5508b4003f1cd92173b38e 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';