未验证 提交 7327f966 编写于 作者: O openharmony_ci 提交者: Gitee

!5283 xts失败用例适配

Merge pull request !5283 from chengxingzhen/master
...@@ -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
...@@ -32,9 +32,16 @@ var array = new Array(); ...@@ -32,9 +32,16 @@ var array = new Array();
function sleep(time) { function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time)); return new Promise((resolve)=>setTimeout(resolve,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 +537,50 @@ export default function ApiCoverTest() { ...@@ -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(){ ...@@ -66,6 +66,8 @@ export default function verificationTest(){
console.info(TAG + "startAbility data = " + JSON.stringify(data)); console.info(TAG + "startAbility data = " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.info(TAG + "startAbility err = " + JSON.stringify(err)); console.info(TAG + "startAbility err = " + JSON.stringify(err));
expect().assertFail();
done();
}); });
} catch (err) { } catch (err) {
console.info(TAG + "catch err = " + JSON.stringify(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.
先完成此消息的编辑!
想要评论请 注册