Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9429eba0
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9429eba0
编写于
2月 17, 2023
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts-系统api用例下库
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
7b8657cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
152 deletion
+0
-152
ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
...sUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
+0
-152
未找到文件。
ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
9429eba0
...
...
@@ -850,158 +850,6 @@ export default function abilityTest() {
})
})
/*
* @tc.number : ACTS_KillProcess_0100
* @tc.name : Use terminateselfwithresult to terminate ability and return result
* @tc.desc : Starting mainability3 with startAbilityforresult
* then terminateself ability and return result failed.(promise)
*/
it('ACTS_KillProcess_0100', 0, async function (done) {
let TAG = 'ACTS_KillProcess_0100'
var Subscriber
var flag = true
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_KillProcess").assertTrue();
console.debug(TAG + "====>ACTS_KillProcess_0100 Subscribe CallBack data:====>" + JSON.stringify(data));
appManager.getProcessRunningInfos().then((data)=> {
console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
for(var i = 0; i<data.length ;i++){
if (data[i].processName=='com.acts.killprocesshap'){
console.info(TAG + '====>has com.acts.killprocesshap=====>')
break
}
}
console.log(TAG + '====>i is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocesshap'){
expect().assertFail()
}
appManager.killProcessesByBundleName('com.acts.killprocesshap').then((data)=>{
console.info(TAG + '====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data))
setTimeout(()=>{
appManager.getProcessRunningInfos().then((data)=> {
console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
for(var i = 0; i<data.length ;i++){
if (data[i].processName=='com.acts.killprocesshap'){
expect().assertFail()
break
}
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
})
},15000)
})
})
}
commonEvent.createSubscriber(subscriberInfo_killprocess).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.acts.killprocesshap',
abilityName: 'com.acts.killprocesshap.MainAbility'
}).then((data)=>{
console.debug(TAG + "====>startAbility end====>");
console.debug(TAG + "====>data is====>" + JSON.stringify(data));
})
})
})
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
done();
}
function timeout() {
if(flag == true) {
expect().assertFail();
console.debug(TAG + 'ACTS_KillProcess_0100 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
setTimeout(timeout, 19500);
})
/*
* @tc.number : ACTS_KillProcess_0200
* @tc.name : Use terminateselfwithresult to terminate ability and return result
* @tc.desc : Starting mainability3 with startAbilityforresult
* then terminateself ability and return result failed.(callback)
*/
it('ACTS_KillProcess_0200', 0, async function (done) {
let TAG = 'ACTS_KillProcess_0200'
var Subscriber
var flag = true
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_KillProcess").assertTrue();
console.debug(TAG + "====>ACTS_KillProcess_0200 Subscribe CallBack data:====>" + JSON.stringify(data));
appManager.getProcessRunningInfos().then((data)=> {
console.info(TAG + '====>ACTS_KillProcess_0200 getProcessRunningInfos=====>' + JSON.stringify(data))
for(var i = 0; i<data.length ;i++){
if (data[i].processName=='com.acts.killprocesshap'){
console.info(TAG + '====>has com.acts.killprocesshap=====>')
break
}
}
console.log(TAG + '====>i is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocesshap'){
expect().assertFail()
}
appManager.killProcessesByBundleName('com.acts.killprocesshap',(data)=>{
console.info(TAG + '====>ACTS_KillProcess_0200 killProcessesByBundleName=====>' + JSON.stringify(data))
setTimeout(()=> {
appManager.getProcessRunningInfos().then((data) => {
console.info(TAG + '====>ACTS_KillProcess_0200 getProcessRunningInfos2=====>' + JSON.stringify(data))
for (var i = 0; i < data.length; i++) {
if (data[i].processName == 'com.acts.killprocesshap') {
expect().assertFail()
break
}
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
})
},15000)
})
})
}
commonEvent.createSubscriber(subscriberInfo_killprocess).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.acts.killprocesshap',
abilityName: 'com.acts.killprocesshap.MainAbility'
}).then((data)=>{
console.debug(TAG + "====>startAbility end====>");
console.debug(TAG + "====>data is====>" + JSON.stringify(data));
})
})
})
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
done();
}
function timeout() {
if(flag == true) {
expect().assertFail();
console.debug(TAG + 'ACTS_KillProcess_0200 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
setTimeout(timeout, 19500);
})
/*
* @tc.number : ACTS_ThirdPartyKillProcess_0100
* @tc.name : Use terminateselfwithresult to terminate ability and return result
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录