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 4e37a10bb1a84ddb5561278b7e4ceca59e9225ee..c9ffea22b80ab1d6f57ec93cf08a451889e6239b 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(); + }) }) }