提交 84e3a5aa 编写于 作者: C chengxingzhen

xts失败用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 621fbe9a
......@@ -21,7 +21,7 @@ import formHost from '@ohos.application.formHost';
import errorManager from '@ohos.application.errorManager';
import abilityConstant from '@ohos.application.AbilityConstant'
import appManager from '@ohos.application.appManager'
import appContext from '@ohos.application.context'
import applicationContext from '@ohos.application.context'
import commonEvent from '@ohos.commonEvent';
import ability from '@ohos.ability.ability'
FormDimension
......@@ -35,6 +35,13 @@ function sleep(time) {
export default function ApiCoverTest() {
describe('ApiCoverTestTest', function () {
afterEach(async (done) => {
isUpdated = false;
setTimeout(function () {
done();
}, gSetTimeout);
})
/*
* @tc.number SUB_AA_ABILITY_Extension_API_001
* @tc.name StartServiceExtensionAbility with incorrect abilityName.
......@@ -530,5 +537,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()
}
})
})
})
}
......@@ -66,6 +66,8 @@ export default function verificationTest(){
console.info(TAG + "startAbility data = " + JSON.stringify(data));
}).catch((err) => {
console.info(TAG + "startAbility err = " + JSON.stringify(err));
expect().assertFail();
done();
});
} catch (err) {
console.info(TAG + "catch err = " + JSON.stringify(err));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册