diff --git a/graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets b/graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets index 14796340decd20356f6f510b657fe119ebc6ddc0..566bf34c619f01bda4e8b9b05fea051af1ce24da 100644 --- a/graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets +++ b/graphic/windowStage/entry/src/main/ets/MainAbility/pages/second/pageTwo.ets @@ -19,7 +19,7 @@ struct PageTwo { build() { Row(){ - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { Text(`${this.content}`) .fontSize(50) .fontWeight(FontWeight.Bold) diff --git a/graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets b/graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets index bc74ac793ac90d23c9b70a20d928712e833846a4..4dca9fd5c5841784fe3ad6e960cd14ef8cb2d949 100644 --- a/graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets @@ -142,9 +142,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) unexpectedError(err, caseName, 'tempWnd.show', done); }); console.log(msgStr + 'tempWnd.show success'); - await tempWnd.setWindowMode(102).catch((err) => { - unexpectedError(err, caseName, 'tempWnd.setWindowMode 102', done); - }); await tempWnd.resize(200, 600).catch(async (err) => { console.error(msgStr + 'Failed to change the window size. Cause: ' + JSON.stringify(err)); expect().assertFail(); @@ -205,9 +202,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) unexpectedError(err, caseName, 'tempWnd.show', done); }); console.log(msgStr + 'tempWnd.show success'); - await tempWnd.setWindowMode(102).catch((err) => { - unexpectedError(err, caseName, 'tempWnd.setWindowMode 102', done); - }); await tempWnd.resize(200, 600).catch(async (err) => { console.error(msgStr + 'Failed to change the window size. Cause: ' + JSON.stringify(err)); expect().assertFail(); @@ -352,10 +346,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) name: windowId, windowType: ohosWindow.WindowType.TYPE_DESKTOP, ctx: context }; let tempWnd = null; -// tempWnd = await ohosWindow.createWindow(windowConfig).catch((err) => { -// unexpectedError(err, caseName, 'ohosWindow.createWindow', done); -// }); -// expect(!!tempWnd).assertTrue(); tempWnd = await windowStage.createSubWindow('window_off_keyboardHeightChange_Test_001').catch((err) => { unexpectedError(err, caseName, 'windowStage.createSubWindow', done); }); @@ -363,13 +353,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) await tempWnd.loadContent('MainAbility/pages/second/pageTwo').catch((err) => { unexpectedError(err, caseName, 'tempWnd.loadContent', done); }); -// await tempWnd.resize(800, 800).catch((err) => { -// unexpectedError(err, caseName, 'tempWnd.resetSize', done); -// }); -// await tempWnd.moveWindowTo(100, 100).catch((err) => { -// unexpectedError(err, caseName, 'tempWnd.moveWindowTo ', done); -// }); - await tempWnd.setWindowMode(ohosWindow.WindowMode.FULLSCREEN).catch((err) => { + await tempWnd.setWindowLayoutFullScreen(true).catch((err) => { unexpectedError(err, caseName, 'tempWnd.setWindowMode', done); }); await tempWnd.showWindow().catch((err) => { @@ -432,9 +416,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) name: windowId, windowType: ohosWindow.WindowType.TYPE_DESKTOP, ctx: context }; let tempWnd = null; -// tempWnd = await ohosWindow.createWindow(windowConfig).catch((err) => { -// unexpectedError(err, caseName, 'ohosWindow.createWindow', done); -// }); tempWnd = await windowStage.createSubWindow('window_off_keyboardHeightChange_Test_002').catch((err) => { unexpectedError(err, caseName, 'windowStage.createSubWindow', done); }); @@ -442,13 +423,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) await tempWnd.loadContent('MainAbility/pages/second/pageTwo').catch((err) => { unexpectedError(err, caseName, 'tempWnd.loadContent', done); }); -// await tempWnd.resize(800, 800).catch((err) => { -// unexpectedError(err, caseName, 'tempWnd.resetSize', done); -// }); -// await tempWnd.moveWindowTo(100, 100).catch((err) => { -// unexpectedError(err, caseName, 'tempWnd.moveWindowTo ', done); -// }); - await tempWnd.setWindowMode(ohosWindow.WindowMode.FULLSCREEN).catch((err) => { + await tempWnd.setWindowLayoutFullScreen(true).catch((err) => { unexpectedError(err, caseName, 'tempWnd.setWindowMode', done); }); await tempWnd.showWindow().catch((err) => {