提交 21cb99f0 编写于 作者: C chengxingzhen

XTS接口覆盖

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 4ccf5801
......@@ -109,7 +109,10 @@ export default function abilityTest() {
data.addAbilityMonitor(
{
abilityName: 'MainAbility2',
onAbilityForeground: onAbilityForeground
onAbilityForeground: onAbilityForeground,
onWindowStageRestore:(Ability)=>{
console.info("===>onWindowStageRestore");
}
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0200 success====>" + err.code);
await globalThis.abilitydelegator.startAbility(
......
......@@ -97,6 +97,8 @@ export default function abilityTest() {
var state = abilityDelegator.getAbilityState(ability);
console.debug("====>ACTS_GetAbilityState_0300 state:" + state);
expect(state).assertEqual(AbilityDelegatorRegistry.AbilityLifecycleState.FOREGROUND);
expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.CREATE).assertTrue()
expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.DESTROY).assertTrue()
abilityDelegator.doAbilityBackground(ability, (err, isBackground)=>{
console.debug("====>doAbilityBackground_0300 data:" + JSON.stringify(isBackground));
expect(isBackground).assertTrue();
......
......@@ -21,11 +21,13 @@ export default class ServiceAbility extends ServiceExtension {
onCreate(want:Want) {
globalThis.abilityWant = want;
let direction = this.context.config.direction
let pointerDervice = this.context.config.hasPointerDevice
let AbilityInfo = this.context.extensionAbilityInfo.bundleName
console.log('ServiceAbility onCreate, want: ' + want.abilityName);
var CommonEventPublishData = {
parameters: {
"config": direction,
"poniterDevices": pointerDervice,
"AbilityInfo":AbilityInfo
}
}
......
......@@ -418,6 +418,35 @@ export default function ApiCoverTest() {
})
});
/*
* @tc.number SUB_AA_Test_ProcessRunningInformation_0200
* @tc.name Test getProcessRunningInformation by callback in appManager.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_Test_ProcessRunningInformation_0200', 0, async function (done) {
let process;
appManager.getProcessRunningInformation((error, processRunningInformations)=>{
if(error.code == 0){
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations));
for(let i = 0; i < processRunningInformations.length; i++){
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i]));
expect(processRunningInformations[i].pid).assertLarger(0)
expect(processRunningInformations[i].uid).assertLarger(0)
if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){
process = processRunningInformations[i]
}
}
expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest")
done()
}else{
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(error));
expect().assertFail()
done()
}
})
});
/*
* @tc.number SUB_AA_FMS_AbilityStage_0100
* @tc.name Start AbilityStage and get config.
......@@ -476,6 +505,7 @@ export default function ApiCoverTest() {
function SubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AbilityStage_0200===SubscribeInfoCallback===" + JSON.stringify(data))
expect(data.parameters["config"]).assertEqual(0)
expect(data.parameters["poniterDevices"]).assertFalse()
expect(data.parameters["AbilityInfo"]).assertEqual("com.example.apicoverhaptest")
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
done()
......@@ -508,6 +538,7 @@ export default function ApiCoverTest() {
*/
it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) {
let subscriber = null
let formExtensionContext:appContext.FormExtensionContext
let subscribeInfo = {
events: ["Form_StartAbility"]
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册