Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b18492ab
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,发现更多精彩内容 >>
未验证
提交
b18492ab
编写于
10月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5927 错误码整改XTS适配---Call调用与Extension相关
Merge pull request !5927 from HuangXW/ErrorCode_Call_Extension
上级
22c96b0a
a5da8324
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
106 addition
and
81 deletion
+106
-81
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
...temcallentrytest/entry/src/main/ets/test/Ability.test.ets
+84
-60
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
...rhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+7
-7
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
...coverhaptest/entry/src/main/ets/test/VerificationTest.ets
+15
-14
未找到文件。
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
b18492ab
...
...
@@ -47,6 +47,14 @@ var subscriberInfo = {
var caseDepBundles = [];
var subscriber = null;
const ERROR_CODE_INVALID_PARAM = 401;
const ERROR_CODE_CALLER_RELEASED = 16200001;
const ERROR_CODE_CLAAEE_INVALID = 16200002;
const ERROR_CODE_FUNC_REGISTERED = 16200004;
const ERROR_CODE_FUNC_NOT_EXIST = 16200005;
const ERROR_CODE_INNER_ERROR = 16000050;
const ERROR_CODE_TYPE_ERROR = 16000002;
class MySequenceable {
num: number = 0;
str: String = "default";
...
...
@@ -588,19 +596,21 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1700', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1700 begin');
var caller;
var exceptionFlag = false;
try {
caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
bundleName: systemAppCalleeABundleName,
abilityName: systemAppCalleeAThirdAbilityName,
});
} catch(err) {
console.log('ACTS_CommonComponent_Call_1700 exception' + err);
await globalThis.globalThis.abilityContext.startAbilityByCall({
bundleName: systemAppCalleeABundleName,
abilityName: systemAppCalleeAThirdAbilityName,
}).then(data => {
expect().assertFail();
done();
}).catch(err => {
console.log('ACTS_CommonComponent_Call_1700 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_TYPE_ERROR);
exceptionFlag = true;
expect(err.message).assertEqual("function request remote error"
);
}
}
);
expect(exceptionFlag).assertEqual(true);
done();
})
...
...
@@ -655,8 +665,9 @@ export default function abilityTest() {
try {
globalThis.callee.on('', onTest);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3100 callee.on err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_3100 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -680,8 +691,9 @@ export default function abilityTest() {
try {
globalThis.callee.on(null, onTest);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3200 callee.on err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_3200 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -705,8 +717,9 @@ export default function abilityTest() {
try {
globalThis.callee.on(undefined, onTest);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3300 callee.on err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_3300 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -726,8 +739,9 @@ export default function abilityTest() {
try {
globalThis.callee.off('');
} catch (err) {
console.log('ACTS_CommonComponent_Call_3400 callee.off err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_3400 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -747,8 +761,9 @@ export default function abilityTest() {
try {
globalThis.callee.off(null);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3500 callee.off err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_3500 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -768,8 +783,9 @@ export default function abilityTest() {
try {
globalThis.callee.off(undefined);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3600 callee.off err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_3600 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -788,8 +804,9 @@ export default function abilityTest() {
try {
globalThis.callee.on('testCall', "");
} catch (err) {
console.log('ACTS_CommonComponent_Call_4300 call err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_4300 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -808,8 +825,9 @@ export default function abilityTest() {
try {
globalThis.callee.on('testCall', null);
} catch (err) {
console.log('ACTS_CommonComponent_Call_4400 call err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_4400 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -828,8 +846,9 @@ export default function abilityTest() {
try {
globalThis.callee.on('testCall', undefined);
} catch (err) {
console.log('ACTS_CommonComponent_Call_4500 call err' + err);
expect(err.message).assertEqual("function input parameter error");
console.log('ACTS_CommonComponent_Call_4500 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
...
...
@@ -861,8 +880,9 @@ export default function abilityTest() {
try {
globalThis.callee.on('ACTS_CommonComponent_Call_5000', testCallback_5100);
} catch (err) {
console.log('ACTS_CommonComponent_Call_5000 call err' + err);
expect(err.message).assertEqual("function is registered");
console.log('ACTS_CommonComponent_Call_5000 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_FUNC_REGISTERED);
finishFlag = 1;
}
...
...
@@ -897,8 +917,9 @@ export default function abilityTest() {
try {
globalThis.callee.off('ACTS_CommonComponent_Call_5100');
} catch (err) {
console.log('ACTS_CommonComponent_Call_5100 call err' + err);
expect(err.message).assertEqual("function not registered");
console.log('ACTS_CommonComponent_Call_5100 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_FUNC_NOT_EXIST);
finishFlag = 1;
}
...
...
@@ -914,17 +935,19 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_5200', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5200 begin');
let caller;
let exceptionFlag = false;
try {
caller = await globalThis.globalThis.abilityContext.startAbilityByCall(null);
console.log('ACTS_CommonComponent_Call_5200 startAbilityByCall' + JSON.stringify(caller))
} catch(err) {
console.log('ACTS_CommonComponent_Call_5200 exception' + err);
exceptionFlag = true;
expect(err.message).assertEqual("function input parameter error");
}
await globalThis.globalThis.abilityContext.startAbilityByCall(null)
.then(data => {
expect().assertFail();
done();
}).catch(err => {
console.log('ACTS_CommonComponent_Call_5200 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
exceptionFlag = true;
});
expect(exceptionFlag).assertEqual(true);
done();
...
...
@@ -937,20 +960,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_5300', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5300 begin');
let caller;
let exceptionFlag = false;
try {
caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
bundleName: "",
abilityName: "",
});
console.log('ACTS_CommonComponent_Call_5300 startAbilityByCall' + JSON.stringify(caller))
} catch(err) {
console.log('ACTS_CommonComponent_Call_5300 exception' + err);
await globalThis.globalThis.abilityContext.startAbilityByCall({
bundleName: "",
abilityName: "",
}).then(data => {
expect().assertFail();
done();
}).catch(err => {
console.log('ACTS_CommonComponent_Call_5300 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INNER_ERROR);
exceptionFlag = true;
expect(err.message).assertEqual("function request remote error");
}
});
expect(exceptionFlag).assertEqual(true);
done();
...
...
@@ -963,17 +986,18 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_5400', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5400 begin');
let caller;
let exceptionFlag = false;
try {
caller = await globalThis.globalThis.abilityContext.startAbilityByCall(undefined);
console.log('ACTS_CommonComponent_Call_5400 startAbilityByCall' + JSON.stringify(caller))
} catch(err) {
console.log('ACTS_CommonComponent_Call_5400 exception' + err);
await globalThis.globalThis.abilityContext.startAbilityByCall(undefined)
.then(data => {
expect().assertFail();
done();
}).catch(err => {
console.log('ACTS_CommonComponent_Call_5400 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
exceptionFlag = true;
expect(err.message).assertEqual("function input parameter error");
}
});
expect(exceptionFlag).assertEqual(true);
done();
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
浏览文件 @
b18492ab
...
...
@@ -24,9 +24,9 @@ import appManager from '@ohos.application.appManager'
import
applicationContext
from
'@ohos.application.context'
import
commonEvent
from
'@ohos.commonEvent'
;
import
ability
from
'@ohos.ability.ability'
FormDimension
var
EXTENSION_INFO_ERR
=
2097152
var
USERID_ERR
=
2097177
var
EXTENSION_INFO_ERR
=
16000001
var
CROSS_USER_DENY
=
201
var
trueInfo
;
var
array
=
new
Array
();
function
sleep
(
time
)
{
...
...
@@ -102,7 +102,7 @@ export default function ApiCoverTest() {
expect
(
"case execute failed"
)
.
assertEqual
(
"data"
);
})
.
catch
((
error
)
=>
{
console
.
error
(
`Ability: startServiceExtensionAbilityWithAccount failed: ${JSON.stringify(error)}`
);
expect
(
USERID_ERR
)
.
assertEqual
(
error
.
code
);
expect
(
CROSS_USER_DENY
)
.
assertEqual
(
error
.
code
);
})
done
()
})
...
...
@@ -124,7 +124,7 @@ export default function ApiCoverTest() {
expect
(
"case execute failed"
)
.
assertEqual
(
data
);
})
.
catch
((
error
)
=>
{
console
.
error
(
`Ability: stopServiceExtensionAbilityWithAccount failed: ${JSON.stringify(error)}`
);
expect
(
USERID_ERR
)
.
assertEqual
(
error
.
code
);
expect
(
CROSS_USER_DENY
)
.
assertEqual
(
error
.
code
);
})
done
()
})
...
...
@@ -193,7 +193,7 @@ export default function ApiCoverTest() {
await
globalThis
.
abilityContext
.
startServiceExtensionAbilityWithAccount
(
want
,
999
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
`Ability: startServiceExtensionAbilityWithAccount failed: ${JSON.stringify(err)}`
);
expect
(
USERID_ERR
)
.
assertEqual
(
err
.
code
);
expect
(
CROSS_USER_DENY
)
.
assertEqual
(
err
.
code
);
}
else
{
console
.
log
(
`Ability: startServiceExtensionAbilityWithAccount success: ${JSON.stringify(data)}`
);
expect
(
"case execute failed"
)
.
assertEqual
(
data
);
...
...
@@ -217,7 +217,7 @@ export default function ApiCoverTest() {
globalThis
.
abilityContext
.
stopServiceExtensionAbilityWithAccount
(
want
,
999
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
`Ability: stopServiceExtensionAbilityWithAccount failed: ${JSON.stringify(err)}`
);
expect
(
USERID_ERR
)
.
assertEqual
(
err
.
code
);
expect
(
CROSS_USER_DENY
)
.
assertEqual
(
err
.
code
);
}
else
{
console
.
log
(
`Ability: stopServiceExtensionAbilityWithAccount success: ${JSON.stringify(data)}`
);
expect
(
"case execute failed"
)
.
assertEqual
(
data
);
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
浏览文件 @
b18492ab
...
...
@@ -18,6 +18,7 @@ import AbilityConstant from "@ohos.application.AbilityConstant";
import appManager from "@ohos.application.appManager";
import wantConstant from '@ohos.ability.wantConstant';
var INVALID_PARAM = 401
var TAG
export default function verificationTest(){
...
...
@@ -280,34 +281,34 @@ export default function verificationTest(){
*/
it('SUB_AA_OpenHarmony_SetMissionLabel_0100', 0, async function(done) {
TAG = 'SUB_AA_OpenHarmony_SetMissionLabel_0100 ==>';
let label = undefined;
let code1 = 0;
let code2 = 0;
try {
let label = undefined
let code1 = 0
let code2 = 0
globalThis.abilityContext.setMissionLabel(label).then((data) => {
await globalThis.abilityContext.setMissionLabel(label).then((data) => {
console.info(TAG + "setMissionLabel data = " + JSON.stringify(data));
}).catch((err) => {
code1 = err.code
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
});
} catch (err) {
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
expect(err.code).assertEqual(INVALID_PARAM);
}
globalThis.abilityContext.setMissionLabel(label, (err, data) => {
try {
await globalThis.abilityContext.setMissionLabel(label, (err, data) => {
code2 = err.code
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
console.info(TAG + "setMissionLabel data = " + JSON.stringify(data));
})
setTimeout(()=>{
expect(code1).assertEqual(-1);
expect(code2).assertEqual(-1);
done()
}, 3000)
} catch (err) {
console.info(TAG + "catch err = " + JSON.stringify(err));
expect().assertFail();
done();
console.info(TAG + "setMissionLabel err = " + JSON.stringify(err));
expect(err.code).assertEqual(INVALID_PARAM);
}
done();
})
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录