From f618d9f29236d3d8c53cff9ca90beca971835b96 Mon Sep 17 00:00:00 2001 From: yaocui Date: Mon, 24 Apr 2023 11:02:14 +0800 Subject: [PATCH] update Signed-off-by: yaocui --- .../src/main/ets/test/windowPromise.test.ets | 2 +- .../ets/test/windowRefactorInterface.test.ets | 38 +++++++++++++++---- 2 files changed, 32 insertions(+), 8 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 2c3cf99ef..b336e9bf5 100644 --- a/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets @@ -1657,4 +1657,4 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) }) }) }) -} \ No newline at end of file +} diff --git a/graphic/windowStage/entry/src/main/ets/test/windowRefactorInterface.test.ets b/graphic/windowStage/entry/src/main/ets/test/windowRefactorInterface.test.ets index 1aa699202..a6ad16cc5 100644 --- a/graphic/windowStage/entry/src/main/ets/test/windowRefactorInterface.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/windowRefactorInterface.test.ets @@ -162,7 +162,11 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit } }).catch(err => { console.info('setWindowSystemBarPropertiesTest1 error : ' + JSON.stringify(err)); - expect().assertFail() + if(err.code==801){ + expect(TRUE_FLAG).assertTrue(); + } else { + expect().assertFail() + } done(); }) } @@ -272,7 +276,11 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit } }).catch(err => { console.info('setWindowSystemBarPropertiesTest2 error : ' + JSON.stringify(err)); - expect().assertFail() + if(err.code==801){ + expect(TRUE_FLAG).assertTrue(); + } else { + expect().assertFail() + } done(); }) } @@ -352,7 +360,11 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit } }).catch(err => { console.info('setWindowSystemBarPropertiesTest3 error : ' + JSON.stringify(err)); - expect().assertFail() + if(err.code==801){ + expect(TRUE_FLAG).assertTrue(); + } else { + expect().assertFail() + } done(); }) } @@ -377,14 +389,21 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit try { tempWnd.setWindowSystemBarProperties(SystemBarProperties, (err) => { console.info('Succeeded in setting the system bar properties.' + JSON.stringify(err)); - if (err.code) { + if (err.code && err.code!==801) { try { expect(err.code).assertEqual(401); } catch (error) { console.info(`tempWnd.setWindowSystemBarProperties catch error: ${JSON.stringify(error)}`) } done() - } else { + } else if(err.code && err.code==801){ + try { + expect(TRUE_FLAG).assertTrue(); + } catch (error) { + console.info(`tempWnd.setWindowSystemBarProperties catch error: ${JSON.stringify(error)}`) + } + done(); + }else { console.info('Succeeded in setting the system bar properties.'); try { expect(TRUE_FLAG).assertTrue(); @@ -396,8 +415,13 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit }); } catch (exception) { console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception)); - expect(exception.code).assertEqual(401); - done() + if(exception.code && exception.code==801){ + expect(TRUE_FLAG).assertTrue(); + done() + } else { + expect(exception.code).assertEqual(401); + done() + } } ; }) -- GitLab