提交 d1bb4995 编写于 作者: C chengxingzhen

xts-用例下库

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 be1d602e
......@@ -388,110 +388,6 @@ export default function abilityTest() {
})
/*
* @tc.number : ACTS_startAbility_3000
* @tc.name : start new ability
* @tc.desc : Start an ability with the parameter startability with options succeeded.(promise)
*/
it('ACTS_startAbility_3000', 0, async function (done) {
let TAG = 'ACTS_startAbility_3000'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.example.userservicesystemapi7',
abilityName: 'com.example.userservicesystemapi7.ServiceAbility'
}).then(()=>{
console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(startresult).assertEqual(true);
done();
}
function timeout() {
if(flag == true) {
expect().assertFail();
console.debug(TAG + 'ACTS_startAbility_3000 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
})
/*
* @tc.number : ACTS_startAbility_3100
* @tc.name : start new ability
* @tc.desc : Start an ability with the parameter startability with options succeeded.(promise)
*/
it('ACTS_startAbility_3100', 0, async function (done) {
let TAG = 'ACTS_startAbility_3100'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.example.userservicesystemapi7',
abilityName: 'com.example.userservicesystemapi7.ServiceAbility'
},()=>{
console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(startresult).assertEqual(true);
done();
}
function timeout() {
if(flag == true) {
expect().assertFail();
console.debug(TAG + 'ACTS_startAbility_3100 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
})
/*
* @tc.number : ACTS_StartAbilityForResult_0100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册