Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9d14d9ec
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看板
提交
9d14d9ec
编写于
3月 10, 2023
作者:
G
gwx1146427
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【account】【master】修改用例权限和api终审接口名称
Signed-off-by:
N
gwx1146427
<
guoyongqiang8@huawei.com
>
上级
4c5a6e73
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
80 addition
and
68 deletion
+80
-68
account/appaccount/actsaccountoperatetest/signature/openharmony_sx.p7b
...count/actsaccountoperatetest/signature/openharmony_sx.p7b
+0
-0
account/appaccount/actsaccountoperatetest/src/main/config.json
...nt/appaccount/actsaccountoperatetest/src/main/config.json
+4
-0
account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js
...accountoperatetest/src/main/js/test/Authenticator.test.js
+5
-4
account/appaccount/actsaccounttest/signature/openharmony_sx.p7b
...t/appaccount/actsaccounttest/signature/openharmony_sx.p7b
+0
-0
account/appaccount/actsaccounttest/src/main/config.json
account/appaccount/actsaccounttest/src/main/config.json
+4
-0
account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
...nt/actsaccounttest/src/main/js/test/Authenticator.test.js
+8
-5
account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/Common/utils.js
...ctsaccountauthenticator/entry/src/main/js/Common/utils.js
+2
-2
account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/ServiceAbility/service.js
...authenticator/entry/src/main/js/ServiceAbility/service.js
+1
-1
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountQuery.test.js
...untthirdpartytest/src/main/js/test/OsAccountQuery.test.js
+56
-56
未找到文件。
account/appaccount/actsaccountoperatetest/signature/openharmony_sx.p7b
浏览文件 @
9d14d9ec
无法预览此类型文件
account/appaccount/actsaccountoperatetest/src/main/config.json
浏览文件 @
9d14d9ec
...
...
@@ -45,6 +45,10 @@
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"abilities"
:
[
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js
浏览文件 @
9d14d9ec
...
...
@@ -46,11 +46,12 @@ export default function ActsAccountAppAccess() {
parameters
:
{},
},
},
)
await
sleep
(
1500
);
console
.
debug
(
"
====>ActsAccountAuthenticator beforeAll end====
"
);
},
(
err
,
data
)
=>
{
console
.
debug
(
"
====>accountauthenticatorfeatureAbility.startAbilityForResult err:
"
+
JSON
.
stringify
(
err
))
console
.
debug
(
"
====>accountauthenticatorfeatureAbility.startAbilityForResult data:
"
+
JSON
.
stringify
(
data
))
done
();
})
console
.
debug
(
"
====>ActsAccountAuthenticator beforeAll end====
"
);
});
beforeEach
(
async
(
done
)
=>
{
console
.
debug
(
"
====>afterEach start====
"
);
...
...
account/appaccount/actsaccounttest/signature/openharmony_sx.p7b
100755 → 100644
浏览文件 @
9d14d9ec
无法预览此类型文件
account/appaccount/actsaccounttest/src/main/config.json
浏览文件 @
9d14d9ec
...
...
@@ -42,6 +42,10 @@
"name"
:
"ohos.permission.REMOVE_CACHE_FILES"
,
"reason"
:
"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
...
...
account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
浏览文件 @
9d14d9ec
...
...
@@ -33,6 +33,7 @@ export default function ActsAccountAppAccess() {
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>accountauthenticatorbeforeAll start====
"
);
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -44,10 +45,12 @@ export default function ActsAccountAppAccess() {
parameters
:
{},
},
},
)
await
sleep
(
1000
)
},
(
err
,
data
)
=>
{
console
.
debug
(
"
====>accountauthenticatorfeatureAbility.startAbility err:
"
+
JSON
.
stringify
(
err
)
)
console
.
debug
(
"
====>accountauthenticatorfeatureAbility.startAbility data:
"
+
JSON
.
stringify
(
data
))
done
();
})
console
.
debug
(
"
====>accountauthenticatorfeatureAbility.startAbility end
"
)
});
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>afterEach start====
"
);
...
...
account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/Common/utils.js
浏览文件 @
9d14d9ec
...
...
@@ -261,7 +261,7 @@ class MyAuthenticator extends rpc.RemoteObject {
case
5
:
name
=
readString8
(
data
)
callback
=
new
MyAuthenticatorCallback
(
data
.
readRemoteObject
())
this
.
authenticatorImpl
.
is
AccountRemovable
(
name
,
callback
)
this
.
authenticatorImpl
.
check
AccountRemovable
(
name
,
callback
)
break
}
return
true
...
...
@@ -345,7 +345,7 @@ class MyAuthenticatorImpl {
callback
.
onResult
(
10016
,
{})
}
is
AccountRemovable
(
name
,
callback
)
{
check
AccountRemovable
(
name
,
callback
)
{
console
.
log
(
TAG
+
"
name:
"
+
name
)
var
isRemovable
=
this
.
accountRemovability
[
name
]
if
(
isRemovable
==
undefined
||
isRemovable
==
false
)
{
...
...
account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/ServiceAbility/service.js
浏览文件 @
9d14d9ec
...
...
@@ -160,7 +160,7 @@ class MyAuthenticator extends account_appAccount.Authenticator {
callback
.
onResult
(
10016
,
{})
}
is
AccountRemovable
(
name
,
callback
)
{
check
AccountRemovable
(
name
,
callback
)
{
console
.
log
(
TAG
+
"
name:
"
+
name
)
var
isRemovable
=
false
;
try
{
...
...
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountQuery.test.js
浏览文件 @
9d14d9ec
...
...
@@ -34,20 +34,20 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
})
/*
* @tc.number : ActsOsAccountQueryIdFormUid_0100
* @tc.name :
queryOsAccountLocalIdFrom
Uid callback
* @tc.name :
getOsAccountLocalIdFor
Uid callback
* @tc.desc : Verify that the user localId is obtained by uid
*/
it
(
'
ActsOsAccountQueryIdFormUid_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryIdFormUid_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
testLocalId
=
await
osAccountManager
.
queryOsAccountLocalIdFromProcess
();
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalId
();
console
.
debug
(
"
====>testLocalId:
"
+
testLocalId
)
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
bundleName
=
"
com.example.actsosaccountthirdpartytest
"
;
var
bundleInfo
=
await
bundle
.
getBundleInfo
(
bundleName
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
var
uid
=
bundleInfo
.
uid
;
console
.
debug
(
"
====>obtained uid:
"
+
uid
);
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
uid
,
(
err
,
localId
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
uid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -59,19 +59,19 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormUid_0200
* @tc.name :
queryOsAccountLocalIdFrom
Uid promise
* @tc.name :
getOsAccountLocalIdFor
Uid promise
* @tc.desc : Verify that the user localId is obtained by uid
*/
it
(
'
ActsOsAccountQueryIdFormUid_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryIdFormUid_0200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
testLocalId
=
await
osAccountManager
.
queryOsAccountLocalIdFromProcess
();
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalId
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
bundleName
=
"
com.example.actsosaccountthirdpartytest
"
;
var
bundleInfo
=
await
bundle
.
getBundleInfo
(
bundleName
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
var
uid
=
bundleInfo
.
uid
;
console
.
debug
(
"
====>obtained uid:
"
+
uid
);
var
localId
=
await
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
uid
);
var
localId
=
await
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
uid
);
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
localId
).
assertEqual
(
testLocalId
);
console
.
debug
(
"
====>ActsOsAccountQueryIdFormUid_0200 end====
"
);
...
...
@@ -80,7 +80,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormUid_0300
* @tc.name :
queryOsAccountLocalIdFrom
Uid callback
* @tc.name :
getOsAccountLocalIdFor
Uid callback
* @tc.desc : Authentication failed to query user by uid -1
*/
it
(
'
ActsOsAccountQueryIdFormUid_0300
'
,
0
,
async
function
(
done
)
{
...
...
@@ -88,7 +88,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
incorrectUid
=
-
1
;
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
incorrectUid
,
(
err
,
localId
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
incorrectUid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
ERR_INVALID_PARAMETER
);
...
...
@@ -100,7 +100,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormUid_0400
* @tc.name :
queryOsAccountLocalIdFrom
Uid promise
* @tc.name :
getOsAccountLocalIdFor
Uid promise
* @tc.desc : Authentication failed to query user by uid -1
*/
it
(
'
ActsOsAccountQueryIdFormUid_0400
'
,
0
,
async
function
(
done
)
{
...
...
@@ -109,7 +109,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
incorrectUid
=
-
1
;
try
{
await
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
incorrectUid
);
await
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
incorrectUid
);
}
catch
(
err
){
console
.
debug
(
"
====>get localId by uid err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_INVALID_PARAMETER
);
...
...
@@ -120,7 +120,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormUid_0500
* @tc.name :
queryOsAccountLocalIdFrom
Uid callback
* @tc.name :
getOsAccountLocalIdFor
Uid callback
* @tc.desc : Authentication failed to query user by uid 2147483648
*/
it
(
'
ActsOsAccountQueryIdFormUid_0500
'
,
0
,
async
function
(
done
)
{
...
...
@@ -128,7 +128,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
incorrectUid
=
2147483648
;
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
incorrectUid
,
(
err
,
localId
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
incorrectUid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
ERR_INVALID_PARAMETER
);
...
...
@@ -140,7 +140,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormUid_0600
* @tc.name :
queryOsAccountLocalIdFrom
Uid promise
* @tc.name :
getOsAccountLocalIdFor
Uid promise
* @tc.desc : Authentication failed to query user by uid 2147483648
*/
it
(
'
ActsOsAccountQueryIdFormUid_0600
'
,
0
,
async
function
(
done
)
{
...
...
@@ -149,7 +149,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
incorrectUid
=
2147483648
;
try
{
await
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
incorrectUid
);
await
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
incorrectUid
);
}
catch
(
err
){
console
.
debug
(
"
====>get localId by uid err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_INVALID_PARAMETER
);
...
...
@@ -160,7 +160,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormProcess_0100
* @tc.name :
queryOsAccountLocalIdFromProcess
callback
* @tc.name :
getOsAccountLocalId
callback
* @tc.desc : Verify that the user localId obtained from the current process uid
*/
it
(
'
ActsOsAccountQueryIdFormProcess_0100
'
,
0
,
async
function
(
done
)
{
...
...
@@ -169,9 +169,9 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
bundleName
=
"
com.example.actsosaccountthirdpartytest
"
;
var
bundleInfo
=
await
bundle
.
getBundleInfo
(
bundleName
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
var
uid
=
bundleInfo
.
uid
;
var
testLocalId
=
await
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
uid
)
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
uid
)
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
queryOsAccountLocalIdFromProcess
((
err
,
localId
)
=>
{
osAccountManager
.
getOsAccountLocalId
((
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by process:
"
+
localId
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -183,7 +183,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryIdFormProcess_0200
* @tc.name :
queryOsAccountLocalIdFromProcess
promise
* @tc.name :
getOsAccountLocalId
promise
* @tc.desc : Verify that the user localId obtained from the current process uid
*/
it
(
'
ActsOsAccountQueryIdFormProcess_0200
'
,
0
,
async
function
(
done
)
{
...
...
@@ -192,10 +192,10 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
bundleName
=
"
com.example.actsosaccountthirdpartytest
"
;
var
bundleInfo
=
await
bundle
.
getBundleInfo
(
bundleName
,
bundle
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
var
uid
=
bundleInfo
.
uid
;
var
testLocalId
=
await
osAccountManager
.
queryOsAccountLocalIdFrom
Uid
(
uid
)
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalIdFor
Uid
(
uid
)
console
.
debug
(
"
====>testLocalId obtained by process:
"
+
testLocalId
)
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localId
=
await
osAccountManager
.
queryOsAccountLocalIdFromProcess
();
var
localId
=
await
osAccountManager
.
getOsAccountLocalId
();
console
.
debug
(
"
====>localId obtained by process:
"
+
localId
);
expect
(
localId
).
assertEqual
(
testLocalId
);
console
.
debug
(
"
====>ActsOsAccountQueryIdFormProcess_0200 end====
"
);
...
...
@@ -239,15 +239,15 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0100
* @tc.name :
querySerialNumberBy
OsAccountLocalId callback
* @tc.name :
getSerialNumberFor
OsAccountLocalId callback
* @tc.desc : Verify query serialNumber by 100 user and query 100 user by serialNumber
*/
it
(
'
ActsOsAccountQueryLocalIdSerial_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryLocalIdSerial_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
testLocalId
=
await
osAccountManager
.
queryOsAccountLocalIdFromProcess
();
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalId
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
querySerialNumberBy
OsAccountLocalId
(
testLocalId
,
(
err
,
serialNumber
)
=>
{
osAccountManager
.
getSerialNumberFor
OsAccountLocalId
(
testLocalId
,
(
err
,
serialNumber
)
=>
{
console
.
debug
(
"
====>ger serialNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId: 100
"
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -255,7 +255,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000001
"
);
osAccountManager
.
queryOsAccountLocalIdBy
SerialNumber
(
serialNumber
,
(
err
,
localId
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
SerialNumber
(
serialNumber
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>ger localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get localId:
"
+
localId
+
"
by serialNumber:
"
+
serialNumber
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -268,21 +268,21 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0200
* @tc.name :
querySerialNumberBy
OsAccountLocalId promise
* @tc.name :
getSerialNumberFor
OsAccountLocalId promise
* @tc.desc : Verify query serialNumber by 100 user and query 100 user by serialNumber
*/
it
(
'
ActsOsAccountQueryLocalIdSerial_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryLocalIdSerial_0200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
testLocalId
=
await
osAccountManager
.
queryOsAccountLocalIdFromProcess
();
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalId
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
serialNumber
=
await
osAccountManager
.
querySerialNumberBy
OsAccountLocalId
(
testLocalId
);
var
serialNumber
=
await
osAccountManager
.
getSerialNumberFor
OsAccountLocalId
(
testLocalId
);
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId: 100
"
);
var
serialNumberStr
=
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000001
"
);
var
localId
=
await
osAccountManager
.
queryOsAccountLocalIdBy
SerialNumber
(
serialNumber
);
var
localId
=
await
osAccountManager
.
getOsAccountLocalIdFor
SerialNumber
(
serialNumber
);
console
.
debug
(
"
====>get localId:
"
+
localId
+
"
by serialNumber:
"
+
serialNumber
);
expect
(
localId
).
assertEqual
(
testLocalId
);
console
.
debug
(
"
====>ActsOsAccountQueryLocalIdSerial_0200 end====
"
);
...
...
@@ -291,14 +291,14 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0300
* @tc.name :
queryOsAccountLocalIdBy
SerialNumber callback
* @tc.name :
getOsAccountLocalIdFor
SerialNumber callback
* @tc.desc : Verify query serialNumber by 0 user and query 0 user by serialNumber
*/
it
(
'
ActsOsAccountQueryLocalIdSerial_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryLocalIdSerial_0300 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
querySerialNumberBy
OsAccountLocalId
(
0
,
(
err
,
serialNumber
)
=>
{
osAccountManager
.
getSerialNumberFor
OsAccountLocalId
(
0
,
(
err
,
serialNumber
)
=>
{
console
.
debug
(
"
====>ger serialNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId: 0
"
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -306,7 +306,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000000
"
);
osAccountManager
.
queryOsAccountLocalIdBy
SerialNumber
(
serialNumber
,
(
err
,
localId
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
SerialNumber
(
serialNumber
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>ger localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get localId:
"
+
localId
+
"
by serialNumber:
"
+
serialNumber
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -319,20 +319,20 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0400
* @tc.name :
queryOsAccountLocalIdBy
SerialNumber promise
* @tc.name :
getOsAccountLocalIdFor
SerialNumber promise
* @tc.desc : Verify query serialNumber by 0 user and query 0 user by serialNumber
*/
it
(
'
ActsOsAccountQueryLocalIdSerial_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryLocalIdSerial_0400 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
serialNumber
=
await
osAccountManager
.
querySerialNumberBy
OsAccountLocalId
(
0
);
var
serialNumber
=
await
osAccountManager
.
getSerialNumberFor
OsAccountLocalId
(
0
);
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId: 0
"
);
var
serialNumberStr
=
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000000
"
);
var
localId
=
await
osAccountManager
.
queryOsAccountLocalIdBy
SerialNumber
(
serialNumber
);
var
localId
=
await
osAccountManager
.
getOsAccountLocalIdFor
SerialNumber
(
serialNumber
);
console
.
debug
(
"
====>get localId:
"
+
localId
+
"
by serialNumber:
"
+
serialNumber
);
expect
(
localId
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountQueryLocalIdSerial_0400 end====
"
);
...
...
@@ -341,7 +341,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0500
* @tc.name :
querySerialNumberBy
OsAccountLocalId callback
* @tc.name :
getSerialNumberFor
OsAccountLocalId callback
* @tc.desc : Verify the query for the newly created user serialNumber and query the owning user through the
* serialNumber
*/
...
...
@@ -368,11 +368,11 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
expect
(
data
.
isActived
).
assertEqual
(
false
);
expect
(
data
.
isCreateCompleted
).
assertEqual
(
true
)
localId
=
data
.
localId
;
osAccountManager
.
querySerialNumberBy
OsAccountLocalId
(
localId
,
(
err
,
serialNumber
)
=>
{
osAccountManager
.
getSerialNumberFor
OsAccountLocalId
(
localId
,
(
err
,
serialNumber
)
=>
{
console
.
debug
(
"
====>queryOsAccountById err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId:
"
+
localId
);
expect
(
err
).
assertEqual
(
null
);
osAccountManager
.
queryOsAccountLocalIdBy
SerialNumber
(
serialNumber
,
(
err
,
getlocalId
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
SerialNumber
(
serialNumber
,
(
err
,
getlocalId
)
=>
{
console
.
debug
(
"
====>ger localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get localId:
"
+
getlocalId
+
"
by serialNumber:
"
+
serialNumber
);
expect
(
err
).
assertEqual
(
null
);
...
...
@@ -390,7 +390,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0600
* @tc.name :
queryOsAccountLocalIdBy
SerialNumber promise
* @tc.name :
getOsAccountLocalIdFor
SerialNumber promise
* @tc.desc : Verify the query for the newly created user serialNumber and query the owning user through the
* serialNumber
*/
...
...
@@ -403,9 +403,9 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console
.
debug
(
"
====>create os account OsAccountInfo:
"
+
JSON
.
stringify
(
OsAccountInfo
));
expect
(
OsAccountInfo
.
localName
).
assertEqual
(
"
accountIdSerialB
"
);
localId
=
OsAccountInfo
.
localId
;
var
serialNumber
=
await
osAccountManager
.
querySerialNumberBy
OsAccountLocalId
(
localId
);
var
serialNumber
=
await
osAccountManager
.
getSerialNumberFor
OsAccountLocalId
(
localId
);
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId:
"
+
localId
);
var
getlocalId
=
await
osAccountManager
.
queryOsAccountLocalIdBy
SerialNumber
(
serialNumber
);
var
getlocalId
=
await
osAccountManager
.
getOsAccountLocalIdFor
SerialNumber
(
serialNumber
);
console
.
debug
(
"
====>get localId:
"
+
getlocalId
+
"
by serialNumber:
"
+
serialNumber
);
expect
(
getlocalId
).
assertEqual
(
localId
);
await
osAccountManager
.
removeOsAccount
(
localId
);
...
...
@@ -509,13 +509,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountGetActivedOsAccountIds_0100
* @tc.name : getActivatedOsAccountIds callback
* @tc.name : getActivatedOsAccount
Local
Ids callback
* @tc.desc : query activated osAccount Ids
*/
it
(
'
ActsOsAccountGetActivedOsAccountIds_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountGetActivedOsAccountIds_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
getActivatedOsAccountIds
((
err
,
dataArray
)
=>
{
osAccountManager
.
getActivatedOsAccount
Local
Ids
((
err
,
dataArray
)
=>
{
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
)
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray:
"
+
dataArray
);
...
...
@@ -526,13 +526,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountGetActivedOsAccountIds_0200
* @tc.name : getActivatedOsAccountIds promise
* @tc.name : getActivatedOsAccount
Local
Ids promise
* @tc.desc : query activated osAccount Ids
*/
it
(
'
ActsOsAccountGetActivedOsAccountIds_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountGetActivedOsAccountIds_0200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
getActivatedOsAccountIds
().
then
((
dataArray
)
=>
{
osAccountManager
.
getActivatedOsAccount
Local
Ids
().
then
((
dataArray
)
=>
{
console
.
debug
(
"
====>ActsOsAccountGetActivedOsAccountIds_0200 data
"
+
JSON
.
stringify
(
dataArray
))
expect
(
dataArray
.
length
).
assertEqual
(
1
)
done
();
...
...
@@ -584,13 +584,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/**
* @tc.number ActsOsAccountQueryDomainTest_0300
* @tc.name Test createOsAccountForDomain
queryOsAccountLocalIdFrom
Domain callback
* @tc.desc Test createOsAccountForDomain
queryOsAccountLocalIdFrom
Domain API functionality
* @tc.name Test createOsAccountForDomain
getOsAccountLocalIdFor
Domain callback
* @tc.desc Test createOsAccountForDomain
getOsAccountLocalIdFor
Domain API functionality
*/
it
(
'
ActsOsAccountQueryDomainTest_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryDomainTest_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
queryOsAccountLocalIdFrom
Domain
({
domain
:
""
,
accountName
:
""
},
(
err
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
Domain
({
domain
:
""
,
accountName
:
""
},
(
err
)
=>
{
console
.
debug
(
"
====>ActsOsAccountQueryDomainTest_0300 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
)
console
.
debug
(
"
====>ActsOsAccountQueryDomainTest_0300 end====
"
);
...
...
@@ -600,13 +600,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/**
* @tc.number ActsOsAccountQueryDomainTest_0400
* @tc.name Test createOsAccountForDomain
queryOsAccountLocalIdFrom
Domain pormise
* @tc.desc Test createOsAccountForDomain
queryOsAccountLocalIdFrom
Domain API functionality
* @tc.name Test createOsAccountForDomain
getOsAccountLocalIdFor
Domain pormise
* @tc.desc Test createOsAccountForDomain
getOsAccountLocalIdFor
Domain API functionality
*/
it
(
'
ActsOsAccountQueryDomainTest_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryDomainTest_0400 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
queryOsAccountLocalIdFrom
Domain
({
domain
:
""
,
accountName
:
""
}).
then
((
accountID
)
=>
{
osAccountManager
.
getOsAccountLocalIdFor
Domain
({
domain
:
""
,
accountName
:
""
}).
then
((
accountID
)
=>
{
console
.
debug
(
"
ActsOsAccountQueryDomainTest_0400 accountID:
"
+
JSON
.
stringify
(
accountID
))
done
();
}).
catch
((
err
)
=>
{
...
...
@@ -659,15 +659,15 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountCheckConstraints_3300
* @tc.name : checkConstraintEnabled callback
* @tc.name : check
OsAccount
ConstraintEnabled callback
* @tc.desc : the application call interface does not meet the permissions
*/
it
(
'
ActsOsAccountCheckConstraints_3300
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountCheckConstraints_3300 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
checkConstraintEnabled
(
100
,
"
constraint.bluetooth
"
,
(
err
,
result
)
=>
{
console
.
debug
(
"
====>checkConstraintEnabled err:
"
+
JSON
.
stringify
(
err
));
AccountManager
.
check
OsAccount
ConstraintEnabled
(
100
,
"
constraint.bluetooth
"
,
(
err
,
result
)
=>
{
console
.
debug
(
"
====>check
OsAccount
ConstraintEnabled err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
expect
(
result
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountCheckConstraints_3300 end====
"
);
...
...
@@ -677,7 +677,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/*
* @tc.number : ActsOsAccountPermission_3400
* @tc.name : checkConstraintEnabled promise
* @tc.name : check
OsAccount
ConstraintEnabled promise
* @tc.desc : the application call interface does not meet the permissions
*/
it
(
'
ActsOsAccountCheckConstraints_3400
'
,
0
,
async
function
(
done
){
...
...
@@ -685,11 +685,11 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
try
{
await
AccountManager
.
checkConstraintEnabled
(
100
,
"
constraint.bluetooth
"
);
await
AccountManager
.
check
OsAccount
ConstraintEnabled
(
100
,
"
constraint.bluetooth
"
);
done
();
}
catch
(
err
){
console
.
debug
(
"
====>checkConstraintEnabled err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>check
OsAccount
ConstraintEnabled err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountCheckConstraints_3400 end====
"
);
done
();
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
75dc8c8e
·
3月 14, 2023
mentioned in commit
75dc8c8e
mentioned in commit 75dc8c8e4ed9dad0cc8c4f09c822fcb9238e9414
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录