未验证 提交 49a9a0b3 编写于 作者: O openharmony_ci 提交者: Gitee

!5284 xts失败用例适配

Merge pull request !5284 from chengxingzhen/monthly_20220816
...@@ -21,7 +21,7 @@ import formHost from '@ohos.application.formHost'; ...@@ -21,7 +21,7 @@ import formHost from '@ohos.application.formHost';
import errorManager from '@ohos.application.errorManager'; import errorManager from '@ohos.application.errorManager';
import abilityConstant from '@ohos.application.AbilityConstant' import abilityConstant from '@ohos.application.AbilityConstant'
import appManager from '@ohos.application.appManager' import appManager from '@ohos.application.appManager'
import appContext from '@ohos.application.context' import applicationContext from '@ohos.application.context'
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import ability from '@ohos.ability.ability' import ability from '@ohos.ability.ability'
FormDimension FormDimension
...@@ -35,6 +35,12 @@ function sleep(time) { ...@@ -35,6 +35,12 @@ function sleep(time) {
export default function ApiCoverTest() { export default function ApiCoverTest() {
describe('ApiCoverTestTest', function () { describe('ApiCoverTestTest', function () {
afterEach(async (done) => {
setTimeout(function () {
done();
}, 2000);
})
/* /*
* @tc.number SUB_AA_ABILITY_Extension_API_001 * @tc.number SUB_AA_ABILITY_Extension_API_001
* @tc.name StartServiceExtensionAbility with incorrect abilityName. * @tc.name StartServiceExtensionAbility with incorrect abilityName.
...@@ -530,5 +536,50 @@ export default function ApiCoverTest() { ...@@ -530,5 +536,50 @@ export default function ApiCoverTest() {
} }
}) })
}) })
/*
* @tc.number SUB_AA_FMS_AcquireForm_0100
* @tc.name Test startAbility in FormExtensionContext.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) {
let subscriber = null
let formExtensionContext:applicationContext.FormExtensionContext
let pacMap:ability.PacMap
let subscribeInfo = {
events: ["Form_StartAbility"]
}
function UnSubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AcquireForm_0100 ===UnSubscribeInfoCallback===")
}
function SubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AcquireForm_0100 ===SubscribeInfoCallback===" + JSON.stringify(data))
expect(data.parameters["Life"]).assertEqual("onForeground")
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
done()
}
commonEvent.createSubscriber(subscribeInfo, (err, data) => {
console.info("SUB_AA_FMS_AcquireForm_0100 ===CreateSubscriberCallback===")
subscriber = data
commonEvent.subscribe(subscriber, SubscribeInfoCallback)
})
let formWant ={
deviceId:"",
bundleName:"com.example.apicoverhaptest",
abilityName:"CreateFormAbility",
parameters:{
"createForm": true
}
}
globalThis.abilityContext.startAbility(formWant, (err, data)=>{
if(err.code == 0){
console.info("SUB_AA_FMS_AcquireForm_0100 ===acquireFormState=== " + JSON.stringify(data))
}else{
expect().assertFail()
done()
}
})
})
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册