Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
46bb5b4b
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看板
未验证
提交
46bb5b4b
编写于
8月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5102 【账号】XTS冻结适配,NoPermission_0700/0800
Merge pull request !5102 from 何海涛/0823_Unavailable
上级
938fbfa5
36529685
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
219 addition
and
7 deletion
+219
-7
account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
...unt/actsaccounttest/src/main/js/test/NoPermission.test.js
+2
-1
account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
+14
-4
account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
...ctsgetallaccounts/src/main/js/test/Getallaccounts.test.js
+2
-0
account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
...sceneonoff/entry/src/main/js/default/pages/index/index.js
+3
-1
account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/js/default/pages/index/index.js
...llaccounts/entry/src/main/js/default/pages/index/index.js
+2
-0
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
...countthirdpartytest/src/main/js/test/OsAccountGet.test.js
+194
-1
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
...ccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
+2
-0
未找到文件。
account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
浏览文件 @
46bb5b4b
...
@@ -198,7 +198,8 @@ export default function ActsAccountNoPermission() {
...
@@ -198,7 +198,8 @@ export default function ActsAccountNoPermission() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
(
err
,
data
)
=>
{
appAccountManager
.
getAllAccounts
(
selfBundle
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 0700 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 0700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
account
.
ResultCode
.
ERROR_PERMISSION_DENIED
);
expect
(
err
).
assertEqual
(
null
);
expect
(
data
.
length
>
0
).
assertEqual
(
true
);
appAccountManager
.
deleteAccount
(
"
getAll_callback_nopermission
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
getAll_callback_nopermission
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account 0700 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>delete account 0700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
...
...
account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
浏览文件 @
46bb5b4b
...
@@ -30,7 +30,11 @@ export default function ActsAccountChangeOnOff() {
...
@@ -30,7 +30,11 @@ export default function ActsAccountChangeOnOff() {
console
.
info
(
`sleep #{time} over ...`
)
console
.
info
(
`sleep #{time} over ...`
)
})
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
done
();
});
async
function
testInit
(){
console
.
debug
(
"
====>startAbility start====
"
);
console
.
debug
(
"
====>startAbility start====
"
);
await
featureAbility
.
startAbility
(
await
featureAbility
.
startAbility
(
{
{
...
@@ -46,8 +50,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -46,8 +50,7 @@ export default function ActsAccountChangeOnOff() {
},
},
);
);
await
sleep
(
TIMEOUT
);
await
sleep
(
TIMEOUT
);
done
();
}
});
/*
/*
* @tc.number : ActsAccountChangeOnOff_0100
* @tc.number : ActsAccountChangeOnOff_0100
...
@@ -56,6 +59,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -56,6 +59,7 @@ export default function ActsAccountChangeOnOff() {
* the additional information
* the additional information
*/
*/
it
(
'
ActsAccountChangeOnOff_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0100
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0100 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0100 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -124,6 +128,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -124,6 +128,7 @@ export default function ActsAccountChangeOnOff() {
* the associatal data
* the associatal data
*/
*/
it
(
'
ActsAccountChangeOnOff_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0200
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0200 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0200 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -187,6 +192,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -187,6 +192,7 @@ export default function ActsAccountChangeOnOff() {
* the credential
* the credential
*/
*/
it
(
'
ActsAccountChangeOnOff_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0300
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0300 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0300 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -250,6 +256,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -250,6 +256,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
* authorized account
*/
*/
it
(
'
ActsAccountChangeOnOff_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0400
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0400 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0400 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -317,6 +324,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -317,6 +324,7 @@ export default function ActsAccountChangeOnOff() {
* the only authorized account
* the only authorized account
*/
*/
it
(
'
ActsAccountChangeOnOff_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0500
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0500 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0500 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -325,7 +333,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -325,7 +333,7 @@ export default function ActsAccountChangeOnOff() {
console
.
debug
(
"
====>enableAppAccess ActsAccountChangeOnOff_0500 start
"
);
console
.
debug
(
"
====>enableAppAccess ActsAccountChangeOnOff_0500 start
"
);
await
appAccountManager
.
enableAppAccess
(
"
onoff_delete
"
,
"
com.example.actsaccountsceneonoff
"
);
await
appAccountManager
.
enableAppAccess
(
"
onoff_delete
"
,
"
com.example.actsaccountsceneonoff
"
);
function
unSubscriberCallback
(
err
){
function
unSubscriberCallback
(
err
){
console
.
debug
(
"
====>unsubscribe 0500 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>unsubscribe 0500 err:
"
+
JSON
.
stringify
(
err
));
}
}
function
subscriberCallback
(
err
,
data
){
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0500 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0500 data:
"
+
JSON
.
stringify
(
data
));
...
@@ -375,6 +383,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -375,6 +383,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
* authorized account
*/
*/
it
(
'
ActsAccountChangeOnOff_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0600
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0600 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0600 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -446,6 +455,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -446,6 +455,7 @@ export default function ActsAccountChangeOnOff() {
* the only authorized account
* the only authorized account
*/
*/
it
(
'
ActsAccountChangeOnOff_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0700
'
,
0
,
async
function
(
done
)
{
testInit
();
console
.
debug
(
"
====>ActsAccountChangeOnOff_0700 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0700 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
...
account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
浏览文件 @
46bb5b4b
...
@@ -459,6 +459,8 @@ export default function ActsGetAllAccounts() {
...
@@ -459,6 +459,8 @@ export default function ActsGetAllAccounts() {
var
nonexistentBundle
=
"
com.example.actsgetallaccountsnonexistent
"
;
var
nonexistentBundle
=
"
com.example.actsgetallaccountsnonexistent
"
;
try
{
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
nonexistentBundle
);
var
data
=
await
appAccountManager
.
getAllAccounts
(
nonexistentBundle
);
expect
().
assertFail
();
done
();
}
}
catch
(
err
){
catch
(
err
){
console
.
debug
(
"
====>getAllAccounts 1400 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 1400 err:
"
+
JSON
.
stringify
(
err
));
...
...
account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
浏览文件 @
46bb5b4b
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
*/
*/
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
commonevent
from
'
@ohos.commonEvent
'
import
commonevent
from
'
@ohos.commonEvent
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
const
ACCOUNT_TEST_ONOFF_EXTRA
=
1
const
ACCOUNT_TEST_ONOFF_EXTRA
=
1
const
ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA
=
2
const
ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA
=
2
...
@@ -46,6 +47,7 @@ export default {
...
@@ -46,6 +47,7 @@ export default {
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>scene off finish====
"
);
console
.
debug
(
"
====>scene off finish====
"
);
});
});
featureAbility
.
terminateSelf
()
}
}
// Subscribe to the callback of account information changes, verify the received account information, and send
// Subscribe to the callback of account information changes, verify the received account information, and send
...
@@ -247,7 +249,7 @@ export default {
...
@@ -247,7 +249,7 @@ export default {
default
:
default
:
console
.
debug
(
"
====>receive event enter default====
"
);
console
.
debug
(
"
====>receive event enter default====
"
);
break
;
break
;
}
}
}
}
var
subscriber
var
subscriber
commonevent
.
createSubscriber
(
commonEventSubscribeInfo
).
then
(
function
(
data
){
commonevent
.
createSubscriber
(
commonEventSubscribeInfo
).
then
(
function
(
data
){
...
...
account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/js/default/pages/index/index.js
浏览文件 @
46bb5b4b
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
...
@@ -33,6 +34,7 @@ export default {
...
@@ -33,6 +34,7 @@ export default {
console
.
debug
(
"
====>add account scene err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>add account scene err:
"
+
JSON
.
stringify
(
err
));
appAccountManager
.
enableAppAccess
(
"
account_name_scene_single
"
,
enableBundle
,
(
err
)
=>
{
appAccountManager
.
enableAppAccess
(
"
account_name_scene_single
"
,
enableBundle
,
(
err
)
=>
{
console
.
debug
(
"
====>enableAppAccess scene err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>enableAppAccess scene err:
"
+
JSON
.
stringify
(
err
));
featureAbility
.
terminateSelf
()
});
});
});
});
},
},
...
...
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
100755 → 100644
浏览文件 @
46bb5b4b
...
@@ -235,7 +235,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
...
@@ -235,7 +235,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
var
testLocalId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
getSerialNumberByOsAccountLocalId
(
100
,
(
err
,
serialNumber
)
=>
{
osAccountManager
.
getSerialNumberByOsAccountLocalId
(
testLocalId
,
(
err
,
serialNumber
)
=>
{
console
.
debug
(
"
====>ger serialNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>ger serialNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId: 100
"
);
console
.
debug
(
"
====>get serialNumber:
"
+
serialNumber
+
"
by localId: 100
"
);
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
...
@@ -349,6 +349,12 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
...
@@ -349,6 +349,12 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
expect
(
data
.
isVerified
).
assertEqual
(
false
);
expect
(
data
.
isVerified
).
assertEqual
(
false
);
expect
(
data
.
distributedInfo
.
name
!=
null
).
assertEqual
(
true
);
expect
(
data
.
distributedInfo
.
name
!=
null
).
assertEqual
(
true
);
expect
(
data
.
domainInfo
.
domain
==
""
).
assertEqual
(
true
);
expect
(
data
.
domainInfo
.
domain
==
""
).
assertEqual
(
true
);
expect
(
data
.
photo
==
""
).
assertEqual
(
true
);
expect
(
data
.
createTime
!=
""
).
assertEqual
(
true
);
expect
(
data
.
lastLoginTime
>=
0
).
assertEqual
(
true
);
expect
(
data
.
serialNumber
.
toString
().
length
==
16
).
assertEqual
(
true
);
expect
(
data
.
isActived
).
assertEqual
(
false
);
expect
(
data
.
isCreateCompleted
).
assertEqual
(
true
)
localId
=
data
.
localId
;
localId
=
data
.
localId
;
osAccountManager
.
getSerialNumberByOsAccountLocalId
(
localId
,
(
err
,
serialNumber
)
=>
{
osAccountManager
.
getSerialNumberByOsAccountLocalId
(
localId
,
(
err
,
serialNumber
)
=>
{
console
.
debug
(
"
====>queryOsAccountById err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>queryOsAccountById err:
"
+
JSON
.
stringify
(
err
));
...
@@ -487,5 +493,192 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
...
@@ -487,5 +493,192 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
console
.
debug
(
"
====>ActsOsAccountGetCount_0200 end====
"
);
console
.
debug
(
"
====>ActsOsAccountGetCount_0200 end====
"
);
done
();
done
();
})
})
/*
* @tc.number : ActsOsAccountQueryActivedOsAccountIds_0100
* @tc.name : queryActivatedOsAccountIds callback
* @tc.desc : query activated osAccount Ids
*/
it
(
'
ActsOsAccountQueryActivedOsAccountIds_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQueryActivedOsAccountIds_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
queryActivatedOsAccountIds
((
err
,
dataArray
)
=>
{
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
)
console
.
info
(
"
====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray
"
+
dataArray
.
length
);
done
();
})
})
/*
* @tc.number : ActsOsAccountQueryActivedOsAccountIds_0200
* @tc.name : queryActivatedOsAccountIds promise
* @tc.desc : query activated osAccount Ids
*/
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
))
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
"
====>ActsOsAccountQueryActivedOsAccountIds_0200 err
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
)
done
();
});
})
/*
* @tc.number : ActsOsAccountConstraints_0300
* @tc.name : Constraints callback
* @tc.desc : get 0 local user all constraints
*/
it
(
'
ActsOsAccountConstraints_3100
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountConstraints_3100 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
AccountManager
.
getOsAccountAllConstraints
(
0
,
(
err
,
constraints
)
=>
{
console
.
debug
(
"
====>getOsAccountAllConstraints err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getOsAccountAllConstraints:
"
+
JSON
.
stringify
(
constraints
));
expect
(
err
).
assertEqual
(
null
);
expect
(
constraints
.
length
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountConstraints_3100 end====
"
);
done
();
})
})
/*
* @tc.number : ActsOsAccountConstraints_0400
* @tc.name : Constraints promise
* @tc.desc : get 0 local user all constraints
*/
it
(
'
ActsOsAccountConstraints_3200
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountConstraints_3200 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
get AccountManager finish====
"
);
AccountManager
.
getOsAccountAllConstraints
(
0
).
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsOsAccountConstraints_3200 getOsAccountAllConstraints data:
"
+
data
);
done
();
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsOsAccountConstraints_3200 getOsAccountAllConstraints err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFalse
()
done
();
})
})
/**
* @tc.number ActsAccountDomainTest_0300
* @tc.name Test createOsAccountForDomain getOsAccountLocalIdFromDomain callback
* @tc.desc Test createOsAccountForDomain getOsAccountLocalIdFromDomain API functionality
*/
it
(
'
ActsOsAccountDomainTest_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountDomainTest_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
getOsAccountLocalIdFromDomain
({
domain
:
""
,
accountName
:
""
},
(
err
)
=>
{
console
.
debug
(
"
====>ActsOsAccountDomainTest_0300 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
)
console
.
debug
(
"
====>ActsOsAccountDomainTest_0300 end====
"
);
done
();
})
});
/**
* @tc.number ActsAccountDomainTest_0400
* @tc.name Test createOsAccountForDomain getOsAccountLocalIdFromDomain pormise
* @tc.desc Test createOsAccountForDomain getOsAccountLocalIdFromDomain API functionality
*/
it
(
'
ActsOsAccountDomainTest_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountDomainTest_0400 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
osAccountManager
.
getOsAccountLocalIdFromDomain
({
domain
:
""
,
accountName
:
""
}).
then
((
accountID
)
=>
{
console
.
debug
(
"
ActsOsAccountDomainTest_0400 accountID:
"
+
JSON
.
stringify
(
accountID
))
done
();
}).
catch
((
err
)
=>
{
console
.
debug
(
"
ActsOsAccountDomainTest_0400 err:
"
+
JSON
.
stringify
(
err
))
expect
(
err
.
code
!=
0
).
assertEqual
(
true
)
done
();
})
});
/*
* @tc.number : ActsOsAccountQuery_1700
* @tc.name : queryCurrentOsAccount callback
* @tc.desc : Get the os account information to which the application belongs
*/
it
(
'
ActsOsAccountQuery_2100
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountQuery_2100 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
queryCurrentOsAccount
((
err
,
data
)
=>
{
console
.
debug
(
"
====>queryCurrentOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>queryCurrentOsAccount data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountQuery_2100 end====
"
);
done
();
})
})
/*
* @tc.number : ActsOsAccountQuery_1800
* @tc.name : queryCurrentOsAccount promise
* @tc.desc : Get the os account information to which the application belongs
*/
it
(
'
ActsOsAccountQuery_2200
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountQuery_2200 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
data
=
await
AccountManager
.
queryCurrentOsAccount
();
console
.
debug
(
"
====>queryCurrentOsAccount data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
localId
).
assertEqual
(
100
);
expect
(
data
.
type
.
ADMIN
).
assertEqual
(
0
);
var
serialNumberStr
=
data
.
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000001
"
);
expect
(
data
.
isCreateCompleted
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_2200 end====
"
);
done
();
})
/*
* @tc.number : ActsOsAccountPermission_3300
* @tc.name : isOsAccountConstraintEnable callback
* @tc.desc : the application call interface does not meet the permissions
*/
it
(
'
ActsOsAccountConstraints_3300
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountConstraints_3300 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountConstraintEnable
(
100
,
"
constraint.bluetooth
"
,
(
err
,
result
)
=>
{
console
.
debug
(
"
====>isOsAccountConstraintEnable err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
expect
(
result
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountConstraints_3300 end====
"
);
done
();
})
})
/*
* @tc.number : ActsOsAccountPermission_3400
* @tc.name : isOsAccountConstraintEnable promise
* @tc.desc : the application call interface does not meet the permissions
*/
it
(
'
ActsOsAccountConstraints_3400
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountConstraints_3400 start====
"
);
var
AccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
try
{
await
AccountManager
.
isOsAccountConstraintEnable
(
100
,
"
constraint.bluetooth
"
);
done
();
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountConstraintEnable err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountConstraints_3400 end====
"
);
done
();
}
})
})
})
}
}
\ No newline at end of file
account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
浏览文件 @
46bb5b4b
...
@@ -499,5 +499,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
...
@@ -499,5 +499,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console
.
debug
(
"
====>ActsOsAccountIsTest_0200 end====
"
);
console
.
debug
(
"
====>ActsOsAccountIsTest_0200 end====
"
);
done
();
done
();
})
})
})
})
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录