Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d0d58a2b
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看板
未验证
提交
d0d58a2b
编写于
7月 13, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 13, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9274 add xts for setmissionlabel
Merge pull request !9274 from savior-xzh/xts
上级
6856e408
b5551f40
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
112 addition
and
0 deletion
+112
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
...coverhaptest/entry/src/main/ets/test/VerificationTest.ets
+112
-0
未找到文件。
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
浏览文件 @
d0d58a2b
...
...
@@ -20,6 +20,11 @@ import wantConstant from '@ohos.ability.wantConstant';
var INVALID_PARAM = 401
var TAG
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default function verificationTest(){
describe('VerificationTestTest', function() {
...
...
@@ -319,6 +324,113 @@ export default function verificationTest(){
done();
})
/*
* @tc.number SUB_AA_OpenHarmony_SetMissionLabel_0200
* @tc.name Verify setMissionLabel that the input parameter is number.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_OpenHarmony_SetMissionLabel_0200', 0, async function(done) {
TAG = 'SUB_AA_OpenHarmony_SetMissionLabel_0200 ==>';
let label = 0;
try {
await globalThis.abilityContext.setMissionLabel(label).then((data) => {
console.info(TAG + "setMissionLabel data = " + JSON.stringify(data));
}).catch((err) => {
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
});
expect().assertFail();
} catch (err) {
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
expect(err.code).assertEqual(INVALID_PARAM);
}
try {
await globalThis.abilityContext.setMissionLabel(label, (err, data) => {
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
console.info(TAG + "setMissionLabel data = " + JSON.stringify(data));
})
expect().assertFail();
} catch (err) {
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
expect(err.code).assertEqual(INVALID_PARAM);
}
done();
})
/*
* @tc.number SUB_AA_OpenHarmony_SetMissionLabel_0300
* @tc.name Verify setMissionLabel that the input parameter is string.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_OpenHarmony_SetMissionLabel_0300', 0, async function(done) {
TAG = 'SUB_AA_OpenHarmony_SetMissionLabel_0300 ==>';
let label = "testlabel";
let missionLabelUpdatedFlag = false;
await globalThis.abilityContext.setMissionLabel(label).then((data) => {
console.info(TAG + "setMissionLabel data = " + JSON.stringify(data));
missionLabelUpdatedFlag = true;
}).catch((err) => {
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
});
await sleep(1000);
expect(missionLabelUpdatedFlag).assertTrue();
done();
})
/*
* @tc.number SUB_AA_OpenHarmony_SetMissionLabel_0400
* @tc.name Verify multiple setMissionLabel that the input parameter is string.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_OpenHarmony_SetMissionLabel_0400', 0, async function(done) {
TAG = 'SUB_AA_OpenHarmony_SetMissionLabel_0400 ==>';
let label1 = "testlabel1";
let label2 = "testlabel2";
let missionLabelUpdatedCount = 0;
await globalThis.abilityContext.setMissionLabel(label1).then((data) => {
console.info(TAG + "setMissionLabel1 data = " + JSON.stringify(data));
missionLabelUpdatedCount++;
}).catch((err) => {
console.info(TAG + "setMissionLabel1 err = " + JSON.stringify(err));
});
await globalThis.abilityContext.setMissionLabel(label2).then((data) => {
console.info(TAG + "setMissionLabel2 data = " + JSON.stringify(data));
missionLabelUpdatedCount++;
}).catch((err) => {
console.info(TAG + "setMissionLabel2 err = " + JSON.stringify(err));
});
await sleep(1000);
expect(missionLabelUpdatedCount).assertEqual(2);
missionLabelUpdatedCount = 0;
await globalThis.abilityContext.setMissionLabel(label1, (err, data) => {
console.info(TAG + "setMissionLabel1 err = " + JSON.stringify(err));
console.info(TAG + "setMissionLabel1 data = " + JSON.stringify(data));
if (err.code == 0) {
missionLabelUpdatedCount++;
}
})
await globalThis.abilityContext.setMissionLabel(label2, (err, data) => {
console.info(TAG + "setMissionLabel2 err = " + JSON.stringify(err));
console.info(TAG + "setMissionLabel2 data = " + JSON.stringify(data));
if (err.code == 0) {
missionLabelUpdatedCount++;
}
})
await sleep(1000);
expect(missionLabelUpdatedCount).assertEqual(2);
done();
})
/*
* @tc.number SUB_AA_OpenHarmony_StartAbilityLife_0100
* @tc.name Ability startup and termination will not trigger the migration lifecycle.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录