From 40e60a0e470b6b101d899452fc42bb38058e36d4 Mon Sep 17 00:00:00 2001 From: yaocui Date: Thu, 8 Jun 2023 10:12:24 +0800 Subject: [PATCH] add new case Signed-off-by: yaocui --- .../parameterVerificationIsOptional.test.ets | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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 4e37a10bb..c9ffea22b 100644 --- a/graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets +++ b/graphic/windowStage/entry/src/main/ets/test/parameterVerificationIsOptional.test.ets @@ -1245,6 +1245,27 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) done(); } }) + /** + * @tc.number SUB_WINDOW_GETUICONTEXT_JSAPI_001 + * @tc.name Test getUIContext_Test_001 + * @tc.desc Get the UIContext instance. + */ + it('getUIContext_Test_001', 0, async function (done) { + let caseName = 'getUIContext_Test_001'; + let msgStr = 'jsunittest ' + caseName + ' '; + let uiContext=null; + console.log(msgStr + 'begin'); + let mainWindow = null + mainWindow = await windowStage.getMainWindow().catch((err) => { + unexpectedError(err, caseName, 'windowStage.getMainWindow', done); + }); + expect(!!mainWindow).assertTrue(); + // 获取UIContext实例。 + uiContext = mainWindow.getUIContext(); + expect(!!uiContext).assertTrue(); + console.log(msgStr + 'after uiContext: '+JSON.stringify(uiContext)); + done(); + }) }) } -- GitLab