Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7e29ccc4
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看板
提交
7e29ccc4
编写于
10月 18, 2022
作者:
1
15829070344
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【账号】osAccount三方接口错误验证归一
Signed-off-by:
N
15829070344
<
hehaitao5@huawei.com
>
上级
b72d47ff
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
26 addition
and
16 deletion
+26
-16
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
...countthirdpartytest/src/main/js/test/OsAccountGet.test.js
+22
-10
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
...ccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
+4
-6
未找到文件。
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
浏览文件 @
7e29ccc4
...
...
@@ -16,10 +16,20 @@ import osaccount from '@ohos.account.osAccount'
import
bundle
from
'
@ohos.bundle
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR
=
4653057
;
export
default
function
ActsOsAccountThirdPartyTest_third_2
()
{
describe
(
'
ActsOsAccountThirdPartyTest_third_2
'
,
function
()
{
afterEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>afterEach start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
accounts
=
await
osAccountManager
.
queryAllCreatedOsAccounts
()
for
(
i
=
0
;
i
<
accounts
.
length
;
i
++
){
var
localId
=
accounts
[
i
].
localId
if
(
localId
!=
100
){
await
osAccountManager
.
removeOsAccount
(
localId
)
}
}
done
();
})
/*
* @tc.number : ActsOsAccountGetIdFormUid_0100
* @tc.name : getOsAccountLocalIdFromUid callback
...
...
@@ -79,7 +89,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
expect
(
localId
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0300 end====
"
);
done
();
...
...
@@ -100,7 +110,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
await
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
);
}
catch
(
err
){
console
.
debug
(
"
====>get localId by uid err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0400 end====
"
);
done
();
}
...
...
@@ -119,7 +129,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
expect
(
localId
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0500 end====
"
);
done
();
...
...
@@ -140,7 +150,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
await
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
);
}
catch
(
err
){
console
.
debug
(
"
====>get localId by uid err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0600 end====
"
);
done
();
}
...
...
@@ -387,7 +397,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localId
;
var
OsAccountInfo
=
await
osAccountManager
.
createOsAccount
(
"
accountIdSerialB
"
,
osaccount
.
OsAccountType
.
G
uest
);
var
OsAccountInfo
=
await
osAccountManager
.
createOsAccount
(
"
accountIdSerialB
"
,
osaccount
.
OsAccountType
.
G
UEST
);
console
.
debug
(
"
====>create os account OsAccountInfo:
"
+
JSON
.
stringify
(
OsAccountInfo
));
expect
(
OsAccountInfo
.
localName
).
assertEqual
(
"
accountIdSerialB
"
);
localId
=
OsAccountInfo
.
localId
;
...
...
@@ -505,7 +515,8 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
osAccountManager
.
queryActivatedOsAccountIds
((
err
,
dataArray
)
=>
{
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
)
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray
"
+
dataArray
.
length
);
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray:
"
+
dataArray
);
expect
(
dataArray
.
length
).
assertEqual
(
1
)
done
();
})
})
...
...
@@ -518,8 +529,9 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
it
(
'
ActsOsAccountQueryActivedOsAccountIds_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryActivedOsAccountIds_0200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
queryActivatedOsAccountIds
().
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsOsAccountQueryActivedOsAccountIds_0200 data
"
+
JSON
.
stringify
(
data
))
osAccountManager
.
queryActivatedOsAccountIds
().
then
((
dataArray
)
=>
{
console
.
debug
(
"
====>ActsOsAccountQueryActivedOsAccountIds_0200 data
"
+
JSON
.
stringify
(
dataArray
))
expect
(
dataArray
.
length
).
assertEqual
(
1
)
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
"
====>ActsOsAccountQueryActivedOsAccountIds_0200 err
"
+
JSON
.
stringify
(
err
));
...
...
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
浏览文件 @
7e29ccc4
...
...
@@ -17,8 +17,6 @@ import distributedAccount from '@ohos.account.distributedAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
=
4587542
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
=
4587545
;
export
default
function
ActsOsAccountThirdPartyTest_third_1
()
{
describe
(
'
ActsOsAccountThirdPartyTest_third_1
'
,
function
()
{
...
...
@@ -132,7 +130,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
var
nonExistLocalId
=
1000
;
AccountManager
.
isOsAccountActived
(
nonExistLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0300 end
"
);
done
();
})
...
...
@@ -153,7 +151,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0400 end
"
);
done
();
}
...
...
@@ -439,7 +437,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
var
osAccountLocalId
=
1000
;
AccountManager
.
isOsAccountVerified
(
osAccountLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountIsVerified_0900 end====
"
);
done
();
})
...
...
@@ -460,7 +458,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountIsVerified_1000 end====
"
);
done
();
}
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
ede4c825
·
11月 04, 2022
mentioned in commit
ede4c825
mentioned in commit ede4c825283eebf30e4601a44e271609ada11442
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录