Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
369291cb
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看板
提交
369291cb
编写于
11月 23, 2022
作者:
L
lichenchen
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用账号atcs用例配合底层错误码返回结果整改
Signed-off-by:
N
lichenchen
<
lichenchen15@huawei.com
>
上级
31d61ec3
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
161 addition
and
106 deletion
+161
-106
account/appaccount/actsaccountoperatetest/src/main/js/test/AccountErrCode.test.js
...ccountoperatetest/src/main/js/test/AccountErrCode.test.js
+56
-0
account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js
...actsaccountoperatetest/src/main/js/test/AuthToken.test.js
+84
-88
account/appaccount/actsaccountoperatetest/src/main/js/test/CreateAccount.test.js
...accountoperatetest/src/main/js/test/CreateAccount.test.js
+6
-5
account/appaccount/actsaccountoperatetest/src/main/js/test/SetAppAccess.test.js
...saccountoperatetest/src/main/js/test/SetAppAccess.test.js
+15
-13
未找到文件。
account/appaccount/actsaccountoperatetest/src/main/js/test/AccountErrCode.test.js
0 → 100644
浏览文件 @
369291cb
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
const
AccountErrCode
=
{
"
ERR_JS_SUCCESS
"
:
0
,
"
ERR_JS_PERMISSION_DENIED
"
:
201
,
"
ERR_JS_PARAMETER_ERROR
"
:
401
,
"
ERR_JS_CAPABILITY_NOT_SUPPORTED
"
:
801
,
"
ERR_JS_SYSTEM_SERVICE_EXCEPTION
"
:
12300001
,
"
ERR_JS_INVALID_PARAMETER
"
:
12300002
,
"
ERR_JS_ACCOUNT_NOT_FOUND
"
:
12300003
,
"
ERR_JS_ACCOUNT_ALREADY_EXIST
"
:
12300004
,
"
ERR_JS_MULTI_USER_NOT_SUPPORT
"
:
12300005
,
"
ERR_JS_ACCOUNT_TYPE_NOT_SUPPORT
"
:
12300006
,
"
ERR_JS_ACCOUNT_NUMBER_REACH_LIMIT
"
:
12300007
,
"
ERR_JS_ACCOUNT_RESTRICTED
"
:
12300008
,
"
ERR_JS_ACCOUNT_ALREADY_ACTIVATED
"
:
12300009
,
"
ERR_JS_ACCOUNT_SERVICE_BUSY
"
:
12300010
,
"
ERR_JS_LISTENER_ALREADY_REGISTERED
"
:
12300011
,
"
ERR_JS_LISTENER_NOT_REGISTERED
"
:
12300012
,
"
ERR_JS_AUTH_CREDENTIAL_WRONG_ERROR
"
:
12300101
,
"
ERR_JS_CREDENTIAL_NOT_EXIST
"
:
12300102
,
"
ERR_JS_CREDENTIAL_INPUTER_ALREADY_EXIST
"
:
12300103
,
"
ERR_JS_CREDENTIAL_INPUTER_NOT_EXIST
"
:
12300104
,
"
ERR_JS_TRUST_LEVEL_NOT_SUPPORTED
"
:
12300105
,
"
ERR_JS_AUTH_TYPE_NOT_SUPPORTED
"
:
12300106
,
"
ERR_JS_AUTH_TYPE_NOT_FOUND
"
:
12300107
,
"
ERR_JS_SESSION_NOT_EXIST
"
:
12300108
,
"
ERR_JS_AUTH_CANCELLED
"
:
12300109
,
"
ERR_JS_AUTH_SERVICE_LOCKED
"
:
12300110
,
"
ERR_JS_AUTH_TIMEOUT
"
:
12300111
,
"
ERR_JS_AUTH_SERVICE_BUSY
"
:
12300112
,
"
ERR_JS_ACCOUNT_AUTHENTICATOR_NOT_EXIST
"
:
12300113
,
"
ERR_JS_ACCOUNT_AUTHENTICATOR_SERVICE_EXCEPTION
"
:
12300114
,
"
ERR_JS_INVALID_CONTEXT_ID
"
:
12300002
,
"
ERR_JS_APPLICATION_NOT_EXIST
"
:
12400001
,
"
ERR_JS_CUSTOM_DATA_NOT_FOUND
"
:
12400002
,
"
ERR_JS_CUSTOM_DATA_NUMBER_REACH_LIMIT
"
:
12400003
,
"
ERR_JS_TOKEN_NUMBER_REACH_LIMIT
"
:
12400004
,
"
ERR_JS_AUTHORIZATION_LIST_TOO_LARGE
"
:
12400005
}
account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js
浏览文件 @
369291cb
此差异已折叠。
点击以展开。
account/appaccount/actsaccountoperatetest/src/main/js/test/CreateAccount.test.js
浏览文件 @
369291cb
...
...
@@ -14,12 +14,12 @@
*/
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
AccountErrCode
}
from
'
./AccountErrCode.test.js
'
const
NAMELIMIT
=
512
;
const
LENGTHLIMIT
=
1024
;
const
ERR_PARAMETER_CHECK_FAILD
=
401
const
ERR_INVALID_PARAMETER
=
12300002
const
ERR_ACCOUNT_EXIST
=
12300004
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
//k and v length 1024 ,k and v size 1024
const
createAccountOptionsDiff
=
{
customData
:{
sex
:
'
male
'
}}
export
default
function
ActsAccountCreateAccount
()
{
...
...
@@ -129,7 +129,8 @@ export default function ActsAccountCreateAccount() {
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
createAccount
(
"
account_name_callback_third
"
,
createAccountOptions
,
(
err
)
=>
{
console
.
debug
(
"
====>add account second time ActsAccountCreateAccount_0500 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_ACCOUNT_EXIST
);
console
.
debug
(
"
====>ActsAccountCreateAccount_0500 AccountErrCode.JsErrCode:
"
+
AccountErrCode
.
ERR_JS_ACCOUNT_ALREADY_EXIST
);
expect
(
err
.
code
).
assertEqual
(
AccountErrCode
.
ERR_JS_ACCOUNT_ALREADY_EXIST
);
appAccountManager
.
removeAccount
(
"
account_name_callback_third
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete Account ActsAccountCreateAccount_0500 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -156,7 +157,7 @@ export default function ActsAccountCreateAccount() {
}
catch
(
err
){
console
.
debug
(
"
====>add account for the second time 0600 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_ACCOUNT
_EXIST
);
expect
(
err
.
code
).
assertEqual
(
AccountErrCode
.
ERR_JS_ACCOUNT_ALREADY
_EXIST
);
await
appAccountManager
.
removeAccount
(
"
account_name_promise_third
"
);
console
.
debug
(
"
====>ActsAccountCreateAccount_0600 end====
"
);
done
();
...
...
@@ -521,7 +522,7 @@ export default function ActsAccountCreateAccount() {
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
createAccount
(
"
account_name_callback_same
"
,
createAccountOptionsDiff
,
(
err
)
=>
{
console
.
debug
(
"
====>add account second time ActsAccountCreateAccount_2300 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_ACCOUNT
_EXIST
);
expect
(
err
.
code
).
assertEqual
(
AccountErrCode
.
ERR_JS_ACCOUNT_ALREADY
_EXIST
);
appAccountManager
.
removeAccount
(
"
account_name_callback_same
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete Account ActsAccountCreateAccount_2300 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -548,7 +549,7 @@ export default function ActsAccountCreateAccount() {
}
catch
(
err
){
console
.
debug
(
"
====>add account for the second time err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_ACCOUNT
_EXIST
);
expect
(
err
.
code
).
assertEqual
(
AccountErrCode
.
ERR_JS_ACCOUNT_ALREADY
_EXIST
);
appAccountManager
.
removeAccount
(
"
account_name_promise_same
"
);
console
.
debug
(
"
====>ActsAccountCreateAccount_2400 end====
"
);
done
();
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/SetAppAccess.test.js
浏览文件 @
369291cb
...
...
@@ -427,7 +427,7 @@ export default function ActsAccountSetAppAccess() {
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
setAppAccess
(
"
AppAccess_callback_account
"
,
enableBundle
,
false
,
(
err
)
=>
{
console
.
debug
(
"
====>setAppAccess ActsAccountSetAppAccess_1500 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
==
12400001
).
assertEqual
(
true
);
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
removeAccount
(
"
AppAccess_callback_account
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete Account ActsAccountSetAppAccess_1500 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -459,17 +459,17 @@ export default function ActsAccountSetAppAccess() {
}
console
.
debug
(
"
====>disableAppAccess ActsAccountSetAppAccess_1600 start====
"
);
try
{
await
appAccountManager
.
setAppAccess
(
"
AppAccess_promise_account
"
,
enableBundle
,
false
);
expect
().
assertFail
();
done
();
await
appAccountManager
.
setAppAccess
(
"
AppAccess_promise_account
"
,
enableBundle
,
false
);
}
catch
(
err
){
console
.
debug
(
"
====>disableAppAccess ActsAccountSetAppAccess_1600 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
==
12400001
).
assertEqual
(
true
);
console
.
debug
(
"
====>disableAppAccess ActsAccountSetAppAccess_1800 err:
"
+
JSON
.
stringify
(
err
));
await
appAccountManager
.
removeAccount
(
"
AppAccess_promise_account
"
);
console
.
debug
(
"
====>ActsAccountSetAppAccess_1600 end====
"
);
expect
().
assertFail
();
done
();
}
await
appAccountManager
.
removeAccount
(
"
AppAccess_promise_account
"
);
console
.
debug
(
"
====>ActsAccountSetAppAccess_1600 end====
"
);
done
();
});
/*
...
...
@@ -486,7 +486,7 @@ export default function ActsAccountSetAppAccess() {
console
.
debug
(
"
====>add account ActsAccountSetAppAccess_1700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
setAppAccess
(
"
AppAccess_callback_notExistBundle
"
,
notExistBundle
,
false
,
(
err
)
=>
{
expect
(
err
.
code
==
12400001
).
assertEqual
(
true
);
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
removeAccount
(
"
AppAccess_callback_notExistBundle
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete Account ActsAccountSetAppAccess_1700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -515,13 +515,15 @@ export default function ActsAccountSetAppAccess() {
}
catch
(
err
){
console
.
debug
(
"
====>disableAppAccess ActsAccountSetAppAccess_1800 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
==
12400001
).
assertEqual
(
true
);
console
.
debug
(
"
====>delete account ActsAccountSetAppAccess_1800 start====
"
);
await
appAccountManager
.
removeAccount
(
"
AppAccess_promise_notExistBundle
"
);
console
.
debug
(
"
====>ActsAccountSetAppAccess_1600 end====
"
);
await
appAccountManager
.
removeAccount
(
"
AppAccess_promise_account
"
);
expect
().
assertFail
();
done
();
}
});
console
.
debug
(
"
====>delete account ActsAccountSetAppAccess_1800 start====
"
);
await
appAccountManager
.
removeAccount
(
"
AppAccess_promise_notExistBundle
"
);
console
.
debug
(
"
====>ActsAccountSetAppAccess_1600 end====
"
);
done
();
});
/*
* @tc.number : ActsAccountSetAppAccess_1900
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
939beedb
·
11月 26, 2022
mentioned in commit
939beedb
mentioned in commit 939beedb3fe405b335e8ec5b0d457cac1d2cc7a6
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录