Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
805e93a3
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看板
未验证
提交
805e93a3
编写于
11月 03, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6302 【monthly_20221018】【账号】osAccount三方接口错误验证归一
Merge pull request !6302 from 何海涛/cherry-pick-1667316868
上级
feeb1fd0
ede4c825
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
18 deletion
+28
-18
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
+6
-8
未找到文件。
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
浏览文件 @
805e93a3
...
...
@@ -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
浏览文件 @
805e93a3
...
...
@@ -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
();
}
...
...
@@ -208,7 +206,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountActived
(
undefined
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>ActsOsAccountIsActived_0700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
!=
0
).
assertEqual
(
true
)
expect
(
err
.
code
!=
0
).
assertEqual
(
true
)
console
.
debug
(
"
====>receive isOsAccountActived data:
"
+
JSON
.
stringify
(
data
));
done
();
})
...
...
@@ -225,7 +223,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console
.
debug
(
"
====>ActsOsAccountIsActived_0800 get os AccountManager finish====
"
);
AccountManager
.
isOsAccountActived
(
undefined
).
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsOsAccountIsActived_0800 get active status is:
"
+
JSON
.
stringify
(
data
));
done
()
done
()
;
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsOsAccountIsActived_0800 err:
"
+
JSON
.
stringify
(
err
))
expect
(
err
!=
0
).
assertEqual
(
true
);
...
...
@@ -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
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录