Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f98dbd16
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f98dbd16
编写于
3月 18, 2023
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add user
Signed-off-by:
N
unknown
<
sijunjie@huawei.com
>
上级
dcdda1c7
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
138 addition
and
426 deletion
+138
-426
ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
...sUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
+57
-105
ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/test/Ability.test.ets
...msUsersThirdTest/entry/src/main/ets/test/Ability.test.ets
+81
-321
未找到文件。
ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
f98dbd16
...
...
@@ -28,6 +28,11 @@ var osAccountManager
const START_ABILITY_TIMEOUT = 10000;
console.debug("====>in Ability.test====>");
export default function abilityTest() {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
console.debug("====>in function abilityTest====>");
describe('ActsInterfaceMultiUsersTest', function () {
// afterAll(function() {
...
...
@@ -135,44 +140,20 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options failed.(promise)
*/
it('ACTS_startAbility_2200', 0, async function (done) {
let TAG = 'ACTS_startAbility_2200'
let Subscriber
function SubscribeCallBack (err, data) {
expect().assertFail();
console.debug(TAG + "====>0200 Subscribe CallBack data:====>" + JSON.stringify(data));
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then((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.error',
abilityName: 'com.acts.error.MainAbility2'
}, {
windowMode:0
}).then(()=>{
console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribeCallback====>");
let TAG = 'ACTS_startAbility_2200';
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility2'
}, {
windowMode:0
}).then(()=>{
console.debug(TAG + "====>startAbility end====>");
}).catch((err) => {
console.info(TAG + 'ACTS_startAbility_2200 - error');
expect(err.code == 16000001).assertTrue();
done();
}
function timeout() {
console.debug(TAG + 'ACTS_startAbility_2200 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
})
})
/*
...
...
@@ -238,45 +219,23 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options failed.(callback)
*/
it('ACTS_startAbility_2600', 0, async function (done) {
let TAG = 'ACTS_startAbility_2600'
let Subscriber
function SubscribeCallBack (err, data) {
expect().assertFail();
console.debug(TAG + "====>0200 Subscribe CallBack data:====>" + JSON.stringify(data));
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====>");
let TAG = 'ACTS_startAbility_2600';
console.debug(TAG + "====>start startAbility====>");
try {
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility2'
}, {
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility2'
}, {
windowMode:0
},() => {
console.debug(TAG + "====>startAbility end====>" );
},(err) => {
console.info(TAG + "====>startAbility end====>" );
expect(err.code == 16000001).assertTrue();
done();
})
})
function UnSubscribeCallback() {
console.debug(TAG + "====>UnSubscribeCallback====>");
done();
}
function timeout() {
console.debug(TAG + 'ACTS_startAbility_2600 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
} catch (err) {
console.info(TAG + 'ACTS_startAbility_2600 - error');
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
})
/*
...
...
@@ -427,24 +386,19 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult failed.(promise)
*/
it('ACTS_StartAbilityForResult_0200', 0, async function (done) {
let TAG = 'ACTS_StartAbilityForResult_0200'
function timeout() {
console.debug(TAG + 'ACTS_startAbilityForResult_0200 - timeout');
done();
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
let TAG = 'ACTS_StartAbilityForResult_0200';
console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility3',
}, {
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility3',
}, {
windowMode:0
}).then((data)=>{
}).then((
err,
data)=>{
console.debug(TAG + "====>startAbilityForResult end====>");
expect().assertFail();
expect(data.resultCode).assertEqual(1)
expect(
data.want.action).assertEqual('ACTION')
}).catch((err) => {
console.info(TAG + 'ACTS_startAbilityForResult_0200 - error');
expect(
err.code == 16000001).assertTrue();
done();
})
})
...
...
@@ -487,26 +441,23 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult failed.(callback)
*/
it('ACTS_StartAbilityForResult_0400', 0, async function (done) {
let TAG = 'ACTS_StartAbilityForResult_0400'
function timeout() {
console.debug(TAG + 'ACTS_startAbilityForResult_0400 - timeout');
done();
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
let TAG = 'ACTS_StartAbilityForResult_0400';
console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility3',
}, {
windowMode:0
},(err,data)=>{
expect().assertFail();
console.debug(TAG + "====>startAbilityForResult end====>");
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
done();
})
try {
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.error',
abilityName: 'com.acts.error.MainAbility3',
}, {
windowMode:0
},(err, data)=>{
console.debug(TAG + "====>startAbilityForResult end====>");
expect(err.code == 16000001).assertTrue();
done();
})
} catch (err) {
console.info(TAG + 'ACTS_startAbilityForResult_0400 - error');
}
})
/*
...
...
@@ -721,6 +672,7 @@ export default function abilityTest() {
* then terminateself ability and return result succeeded.(callback)
*/
it('ACTS_TerminateSelfWithResult_0300', 0, async function (done) {
await sleep(2000);
let TAG = 'ACTS_TerminateSelfWithResult_0300'
var flag = true
function timeout() {
...
...
ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
f98dbd16
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录