Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f9c07c93
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看板
未验证
提交
f9c07c93
编写于
9月 30, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5700 XTS适配启动管控---Call调用
Merge pull request !5700 from HuangXW/startUp_Call
上级
b805015f
b7caccf1
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
137 addition
and
1153 deletion
+137
-1153
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
...temcallentrytest/entry/src/main/ets/test/Ability.test.ets
+89
-910
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
...tscalltest/systemcallentrytest/entry/src/main/module.json
+12
-0
ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
...st/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
+36
-243
未找到文件。
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
f9c07c93
此差异已折叠。
点击以展开。
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
浏览文件 @
f9c07c93
...
...
@@ -80,6 +80,18 @@
{
"name"
:
"ohos.permission.CLEAN_BACKGROUND_PROCESSES"
,
"reason"
:
"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
,
"reason"
:
"need use ohos.permission.START_INVISIBLE_ABILITY"
},
{
"name"
:
"ohos.permission.ABILITY_BACKGROUND_COMMUNICATION"
,
"reason"
:
"need use ohos.permission.ABILITY_BACKGROUND_COMMUNICATION"
}
]
}
...
...
ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
f9c07c93
...
...
@@ -93,201 +93,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1100 begin');
var subscriber;
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_1100 unSubscribeCallBack')
setTimeout(()=>{done();}, 100)
}
function releaseCallback(data) {
expect(data).assertEqual('release');
console.log('ACTS_CommonComponent_Call_1100 releaseCallBack' + data);
commonEvent.unsubscribe(subscriber, unSubscribeCallBack);
}
function subscribeCallBack(err, data) {
console.log('ACTS_CommonComponent_Call_1100 subscribeCallBack data:' + JSON.stringify(data))
expect(data.data).assertEqual('calleeCheckCallParam');
expect(data.parameters.num).assertEqual(1100);
expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_1100');
expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_1100processed');
console.log('AMS_CallTest_0100 do release');
caller.release();
}
subscriber = await commonEvent.createSubscriber(subscriberInfo);
commonEvent.subscribe(subscriber, subscribeCallBack);
let caller = await globalThis.abilityContext.startAbilityByCall({
let want = {
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestForthAbilityName,
});
caller.onRelease(releaseCallback);
let param = new MySequenceable(1100, "ACTS_CommonComponent_Call_1100", 'default');
caller.call('testCall', param).then(() => {
console.log('ACTS_CommonComponent_Call_1100 call success');
}).catch(err => {
console.log('ACTS_CommonComponent_Call_1100 call exception' + err);
expect().assertFail();
})
})
/**
* @tc.number: ACTS_CommonComponent_Call_1200
* @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
* @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
*/
it('ACTS_CommonComponent_Call_1200', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1200 begin');
function releaseCallback(data) {
expect(data).assertEqual('release');
console.log('ACTS_CommonComponent_Call_1200 releaseCallBack' + data);
setTimeout(()=>{done();}, 100)
}
let caller = await globalThis.abilityContext.startAbilityByCall({
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestFifthAbilityName,
});
caller.onRelease(releaseCallback);
let param = new MySequenceable(1200, "ACTS_CommonComponent_Call_1200", 'default');
caller.callWithResult('testCallWithResult', param).then((data) => {
console.log('ACTS_CommonComponent_Call_1200 call success');
var result = new MySequenceable(0, '', '');
data.readSequenceable(result);
expect(result.num).assertEqual(1200);
expect(result.str).assertEqual('ACTS_CommonComponent_Call_1200');
expect(result.result).assertEqual('ACTS_CommonComponent_Call_1200processed');
caller.release();
}).catch(err => {
console.log('ACTS_CommonComponent_Call_1200 call exception' + err);
expect().assertFail();
caller.release();
})
})
/**
* @tc.number: ACTS_CommonComponent_Call_1300
* @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
* @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
*/
it('ACTS_CommonComponent_Call_1300', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1300 begin');
var subscriber;
var caller
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_1300 unSubscribeCallBack')
setTimeout(()=>{done();}, 100)
}
function releaseCallback(data) {
expect(data).assertEqual('release');
console.log('ACTS_CommonComponent_Call_1300 releaseCallBack' + data);
commonEvent.unsubscribe(subscriber, unSubscribeCallBack);
}
function releaseCallback1(data) {
expect(data).assertEqual('release');
console.log('ACTS_CommonComponent_Call_1300 releaseCallBack1' + data);
setTimeout(() => {
globalThis.abilityContext.startAbilityByCall({
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestSecondAbilityName,
}).then(data => {
caller = data;
console.log('ACTS_CommonComponent_Call_1300 caller get')
caller.onRelease(releaseCallback);
let param = new MySequenceable(1300, "ACTS_CommonComponent_Call_1300", 'default');
caller.call('testCall', param).then(() => {
console.log('ACTS_CommonComponent_Call_1300 call success');
}).catch(err => {
console.log('ACTS_CommonComponent_Call_1300 call exception' + err);
expect().assertFail();
})
})
},100);
}
function subscribeCallBack(err, data) {
console.log('ACTS_CommonComponent_Call_1300 subscribeCallBack data:' + JSON.stringify(data))
expect(data.data).assertEqual('calleeCheckCallParam');
expect(data.parameters.num).assertEqual(1300);
expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_1300');
expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_1300processed');
console.log('ACTS_CommonComponent_Call_1300 do release');
caller.release();
}
subscriber = await commonEvent.createSubscriber(subscriberInfo);
commonEvent.subscribe(subscriber, subscribeCallBack);
globalThis.abilityContext.startAbilityByCall({
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestSecondAbilityName,
}).then(data => {
caller = data;
console.log('ACTS_CommonComponent_Call_1300 caller get')
caller.onRelease(releaseCallback1);
caller.release();
})
})
/**
* @tc.number: ACTS_CommonComponent_Call_1400
* @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
* @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
*/
it('ACTS_CommonComponent_Call_1400', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1400 begin');
var caller
function releaseCallback(data) {
expect(data).assertEqual('release');
console.log('ACTS_CommonComponent_Call_1400 releaseCallBack' + data);
setTimeout(()=>{done();}, 100)
}
function releaseCallback1(data) {
expect(data).assertEqual('release');
console.log('ACTS_CommonComponent_Call_1400 releaseCallBack' + data);
setTimeout(() => {
globalThis.abilityContext.startAbilityByCall({
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestSecondAbilityName,
}).then(data => {
caller = data;
caller.onRelease(releaseCallback);
let param = new MySequenceable(1400, "ACTS_CommonComponent_Call_1400", 'default');
caller.callWithResult('testCallWithResult', param).then((data) => {
console.log('ACTS_CommonComponent_Call_1400 call success');
var result = new MySequenceable(0, '', '');
data.readSequenceable(result);
expect(result.num).assertEqual(1400);
expect(result.str).assertEqual('ACTS_CommonComponent_Call_1400');
expect(result.result).assertEqual('ACTS_CommonComponent_Call_1400processed');
caller.release();
}).catch(err => {
console.log('ACTS_CommonComponent_Call_1400 call exception' + err);
globalThis.abilityContext.startAbilityByCall(want)
.then(data => {
console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall SUCCESS`);
expect().assertFail();
caller.releas
e();
don
e();
})
.catch(error => {
console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall Catch`);
done();
});
},100);
}
globalThis.abilityContext.startAbilityByCall({
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestSecondAbilityName,
}).then(data => {
caller = data;
console.log('ACTS_CommonComponent_Call_1400 caller get')
caller.onRelease(releaseCallback1);
caller.release();
})
})
/**
...
...
@@ -297,17 +116,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1500 begin');
var caller;
try{
caller = await globalThis.abilityContext.startAbilityByCall({
let want = {
bundleName: systemAppCalleeABundleName,
abilityName: systemAppCalleeAMainAbilityName,
});
}catch(error){
console.log('ACTS_CommonComponent_Call_1500 start err'+error);
expect(error=="Error: function request remote error").assertTrue();
done();
}
globalThis.abilityContext.startAbilityByCall(want)
.then(data => {
console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall SUCCESS`);
expect().assertFail();
done();
})
.catch(error => {
console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall Catch`);
done();
});
})
/**
...
...
@@ -317,49 +139,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1600', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1600 begin');
let caller;
let exceptionFlag = false;
try {
caller = await globalThis.abilityContext.startAbilityByCall({
let want = {
bundleName: thirdAppABundleName,
abilityName: thirdAppAMainAbilityName,
});
console.log('ACTS_CommonComponent_Call_1600 startAbilityByCall' + JSON.stringify(caller))
} catch(err) {
console.log('ACTS_CommonComponent_Call_1600 exception' + err);
exceptionFlag = true;
expect(err.message).assertEqual("function request remote error");
}
expect(exceptionFlag).assertEqual(true);
globalThis.abilityContext.startAbilityByCall(want)
.then(data => {
console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall SUCCESS`);
expect().assertFail();
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_1800
* @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
* @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
*/
it('ACTS_CommonComponent_Call_1800', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1800 begin');
let caller;
let exceptionFlag = false;
try {
caller = await globalThis.abilityContext.startAbilityByCall({
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestThirdAbilityName,
});
console.log('ACTS_CommonComponent_Call_1800 startAbilityByCall' + JSON.stringify(caller))
} catch(err) {
console.log('ACTS_CommonComponent_Call_1800 exception' + err);
exceptionFlag = true;
expect(err.message).assertEqual("function request remote error");
}
expect(exceptionFlag).assertEqual(true);
.catch(error => {
console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall Catch`);
done();
});
})
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录