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 60e1a470e2ecf1ec6e5508b4003f1cd92173b38e..d3f32eecfc6aa3b5d2c2edaa5694641ad64f91e4 100644 --- a/graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/displayAndWindowRefactorInterface.test.ets @@ -200,8 +200,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta let loopCount = systemWindowTypeDicArr.length; console.log(msgStr + 'loopCount: ' + loopCount); let num = 0 - for (let i = 0; i < loopCount; i++) { - sleep(500) + getData(0, loopCount) + + async function getData(i, length) { let tempType = Number(ohosWindow.WindowType[systemWindowTypeDicArr[i]]) let windId = 'createWindowTest1' + i; console.log(msgStr + 'ohosWindow.createWindow: ' + tempType + ' start'); @@ -220,6 +221,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta console.log(msgStr + 'ohosWindow.createWindow ' + tempType + 'finished, wnd: ' + JSON.stringify(tempWnd)); expect(!!tempWnd).assertTrue(); num++; + if (++i < length) { + getData(i, length) + console.log(msgStr + 'jixuzhixing i: ' + i); + } else { + console.log(msgStr + 'i++ { console.info(msgStr + 'Succeeded in changing the window size. Data:' + JSON.stringify(data)); @@ -1207,6 +1216,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta }).catch((err) => { console.error(msgStr + 'Failed to change the window size. Cause: ' + JSON.stringify(err)); expect(err.code).assertEqual(6); + if (++i <= length) { + getData(i, length) + console.log(msgStr + 'jixuzhixing i: ' + i); + } else { + console.log(msgStr + 'i++ { console.log(msgStr + 'currentType: ' + tempType) console.error(msgStr + 'Failed to set the window mode. Cause: ' + JSON.stringify(err)); @@ -1969,8 +1997,9 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta expect(!!tempWnd).assertTrue(); let loopCount = windowModeArr; console.log(msgStr + 'ohosWindow.windowType' + JSON.stringify(loopCount)) - for (let i = 0; i < loopCount.length; i++) { - sleep(500) + getData(0, loopCount.length) + + function getData(i, length) { let tempType = ohosWindow.WindowMode[loopCount[i]]; console.log(msgStr + 'tempWnd.setWindowMode ' + tempType + ' start'); try { @@ -1982,6 +2011,12 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta console.log(msgStr + 'currentType: ' + tempType) console.error(msgStr + 'Failed to set the window mode. Cause: ' + JSON.stringify(err)); expect(err.code == 401).assertTrue(); + if (++i < length) { + getData(i, length) + console.log(msgStr + 'jixuzhixing i: ' + i); + } else { + console.log(msgStr + 'i++