Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3df00c5f
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看板
未验证
提交
3df00c5f
编写于
5月 15, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 15, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8636 【Account】【Master】Xts execution time sequence problem
Merge pull request !8636 from zhaimengchao/master
上级
667f2604
b054ffac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
101 addition
and
93 deletion
+101
-93
account/appaccount/actsaccountoperatetest/src/main/js/test/ChangeOnOff.js
...nt/actsaccountoperatetest/src/main/js/test/ChangeOnOff.js
+67
-63
account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
+34
-30
未找到文件。
account/appaccount/actsaccountoperatetest/src/main/js/test/ChangeOnOff.js
浏览文件 @
3df00c5f
...
@@ -55,8 +55,7 @@ export default function ActsAccountOnOff() {
...
@@ -55,8 +55,7 @@ export default function ActsAccountOnOff() {
* the credential
* the credential
*/
*/
it
(
'
ActsAccountOnOff_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountOnOff_0300
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
500
);
console
.
debug
(
"
====>ActsAccountOnOff_0300 start====
"
);
console
.
debug
(
"
====>ActsAccountOnOff_0300 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -72,26 +71,27 @@ export default function ActsAccountOnOff() {
...
@@ -72,26 +71,27 @@ export default function ActsAccountOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
done
();
done
();
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0300 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0300 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_setcredential
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_setcredential
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
removeAccount
(
"
onoff_setcredential
"
,
removeAccountCallback
);
appAccountManager
.
removeAccount
(
"
onoff_setcredential
"
,
removeAccountCallback
);
}
}
async
function
publishCallback
(
err
){
async
function
publishCallback
(
err
){
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
await
sleep
(
500
)
await
sleep
(
500
)
console
.
debug
(
"
====>setCredential start====
"
);
console
.
debug
(
"
====>setCredential start====
"
);
try
{
try
{
await
appAccountManager
.
setCredential
(
"
onoff_setcredential
"
,
"
credentialType
"
,
"
credential
"
);
await
appAccountManager
.
setCredential
(
"
onoff_setcredential
"
,
"
credentialType
"
,
"
credential
"
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>setCredential fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>setCredential fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
console
.
debug
(
"
====>setCredential finish====
"
);
console
.
debug
(
"
====>setCredential finish====
"
);
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_setcredential
"
]
events
:
[
"
account_on_change_setcredential
"
]
...
@@ -106,7 +106,7 @@ export default function ActsAccountOnOff() {
...
@@ -106,7 +106,7 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
9
code
:
9
}
}
await
sleep
(
10
00
)
await
sleep
(
5
00
)
console
.
debug
(
"
====>publish event account_on_change 0300====
"
);
console
.
debug
(
"
====>publish event account_on_change 0300====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
});
});
...
@@ -118,8 +118,7 @@ export default function ActsAccountOnOff() {
...
@@ -118,8 +118,7 @@ export default function ActsAccountOnOff() {
* authorized account
* authorized account
*/
*/
it
(
'
ActsAccountOnOff_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountOnOff_0400
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
500
);
console
.
debug
(
"
====>ActsAccountOnOff_0400 start====
"
);
console
.
debug
(
"
====>ActsAccountOnOff_0400 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -139,26 +138,27 @@ export default function ActsAccountOnOff() {
...
@@ -139,26 +138,27 @@ export default function ActsAccountOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
done
();
done
();
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0400 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0400 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_remove_another
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_remove_another
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
removeAccount
(
"
onoff_removeFir
"
,
removeAccountCallback
);
appAccountManager
.
removeAccount
(
"
onoff_removeFir
"
,
removeAccountCallback
);
}
}
async
function
publishCallback
(
err
){
async
function
publishCallback
(
err
){
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
await
sleep
(
500
)
await
sleep
(
500
)
console
.
debug
(
"
====>removeAccount start====
"
);
console
.
debug
(
"
====>removeAccount start====
"
);
try
{
try
{
await
appAccountManager
.
removeAccount
(
"
onoff_removeSec
"
);
await
appAccountManager
.
removeAccount
(
"
onoff_removeSec
"
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>removeAccount fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>removeAccount fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
console
.
debug
(
"
====>removeAccount finish====
"
);
console
.
debug
(
"
====>removeAccount finish====
"
);
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_remove_another
"
]
events
:
[
"
account_on_remove_another
"
]
...
@@ -173,9 +173,9 @@ export default function ActsAccountOnOff() {
...
@@ -173,9 +173,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
10
code
:
10
}
}
await
sleep
(
10
00
)
await
sleep
(
5
00
)
console
.
debug
(
"
====>publish event account_on_change 0400====
"
);
console
.
debug
(
"
====>publish event account_on_change 0400====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
});
});
/*
/*
...
@@ -185,8 +185,7 @@ export default function ActsAccountOnOff() {
...
@@ -185,8 +185,7 @@ export default function ActsAccountOnOff() {
* the only authorized account
* the only authorized account
*/
*/
it
(
'
ActsAccountOnOff_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountOnOff_0500
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
500
);
console
.
debug
(
"
====>ActsAccountOnOff_0500 start====
"
);
console
.
debug
(
"
====>ActsAccountOnOff_0500 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -197,26 +196,31 @@ export default function ActsAccountOnOff() {
...
@@ -197,26 +196,31 @@ export default function ActsAccountOnOff() {
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
removeAccountCallback
(
err
){
console
.
debug
(
"
====>remove account 0500 err:
"
+
JSON
.
stringify
(
err
));
done
();
}
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0500 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0500 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_remove
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_remove
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
done
();
await
sleep
(
1000
)
appAccountManager
.
removeAccount
(
"
onoff_remove
"
,
removeAccountCallback
);
}
}
async
function
publishCallback
(
err
){
async
function
publishCallback
(
err
){
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
await
sleep
(
500
)
await
sleep
(
500
)
console
.
debug
(
"
====>removeAccount start====
"
);
console
.
debug
(
"
====>removeAccount start====
"
);
try
{
try
{
await
appAccountManager
.
removeAccount
(
"
onoff_remove
"
);
await
appAccountManager
.
removeAccount
(
"
onoff_remove
"
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>removeAccount fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>removeAccount fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
console
.
debug
(
"
====>removeAccount finish====
"
);
console
.
debug
(
"
====>removeAccount finish====
"
);
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_remove
"
]
events
:
[
"
account_on_change_remove
"
]
...
@@ -231,9 +235,9 @@ export default function ActsAccountOnOff() {
...
@@ -231,9 +235,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
11
code
:
11
}
}
await
sleep
(
10
00
)
await
sleep
(
5
00
)
console
.
debug
(
"
====>publish event account_on_change 0500====
"
);
console
.
debug
(
"
====>publish event account_on_change 0500====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
});
});
/*
/*
...
@@ -243,8 +247,7 @@ export default function ActsAccountOnOff() {
...
@@ -243,8 +247,7 @@ export default function ActsAccountOnOff() {
* authorized account
* authorized account
*/
*/
it
(
'
ActsAccountOnOff_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountOnOff_0600
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
500
);
console
.
debug
(
"
====>ActsAccountOnOff_0600 start====
"
);
console
.
debug
(
"
====>ActsAccountOnOff_0600 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
...
@@ -268,26 +271,27 @@ export default function ActsAccountOnOff() {
...
@@ -268,26 +271,27 @@ export default function ActsAccountOnOff() {
done
();
done
();
});
});
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0600 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0600 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_set_another_disable
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_set_another_disable
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
removeAccount
(
"
onoff_disableFir
"
,
removeAccountCallback
);
appAccountManager
.
removeAccount
(
"
onoff_disableFir
"
,
removeAccountCallback
);
}
}
async
function
publishCallback
(
err
){
async
function
publishCallback
(
err
){
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
await
sleep
(
500
)
await
sleep
(
500
)
console
.
debug
(
"
====>disableAppAccess start====
"
);
console
.
debug
(
"
====>disableAppAccess start====
"
);
try
{
try
{
await
appAccountManager
.
setAppAccess
(
"
onoff_disableSec
"
,
"
com.example.actsaccountsceneonoff
"
,
false
);
await
appAccountManager
.
setAppAccess
(
"
onoff_disableSec
"
,
"
com.example.actsaccountsceneonoff
"
,
false
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>disableAppAccess fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>disableAppAccess fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
console
.
debug
(
"
====>disableAppAccess finish====
"
);
console
.
debug
(
"
====>disableAppAccess finish====
"
);
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_set_another_disable
"
]
events
:
[
"
account_on_set_another_disable
"
]
...
@@ -302,9 +306,9 @@ export default function ActsAccountOnOff() {
...
@@ -302,9 +306,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
12
code
:
12
}
}
await
sleep
(
10
00
)
await
sleep
(
5
00
)
console
.
debug
(
"
====>publish event account_on_change 0600====
"
);
console
.
debug
(
"
====>publish event account_on_change 0600====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
});
});
})
})
...
...
account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
浏览文件 @
3df00c5f
...
@@ -59,8 +59,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -59,8 +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
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -81,11 +80,12 @@ export default function ActsAccountChangeOnOff() {
...
@@ -81,11 +80,12 @@ export default function ActsAccountChangeOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
deleteAccount
(
"
changeonoff_extra
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
changeonoff_extra
"
,
deleteAccountCallback
);
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0100 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0100 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_extra
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_extra
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
disableAppAccess
(
"
changeonoff_extra
"
,
"
com.example.actsaccountsceneonoff
"
,
disCallback
);
appAccountManager
.
disableAppAccess
(
"
changeonoff_extra
"
,
"
com.example.actsaccountsceneonoff
"
,
disCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
...
@@ -119,7 +119,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -119,7 +119,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0100====
"
);
console
.
debug
(
"
====>publish event account_on_change 0100====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
@@ -129,8 +129,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -129,8 +129,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
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -146,11 +145,12 @@ export default function ActsAccountChangeOnOff() {
...
@@ -146,11 +145,12 @@ export default function ActsAccountChangeOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
done
();
done
();
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0200 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0200 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_associatedata
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_associatedata
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
deleteAccount
(
"
onoff_associatedata
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_associatedata
"
,
deleteAccountCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
...
@@ -184,7 +184,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -184,7 +184,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0200====
"
);
console
.
debug
(
"
====>publish event account_on_change 0200====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
@@ -194,8 +194,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -194,8 +194,7 @@ export default function ActsAccountChangeOnOff() {
* the credential
* the credential
*/
*/
it
(
'
ActsAccountChangeOnOff_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0300
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -211,11 +210,12 @@ export default function ActsAccountChangeOnOff() {
...
@@ -211,11 +210,12 @@ export default function ActsAccountChangeOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
done
();
done
();
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0300 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0300 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_credential
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_credential
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
deleteAccount
(
"
onoff_credential
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_credential
"
,
deleteAccountCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
...
@@ -249,7 +249,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -249,7 +249,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0300====
"
);
console
.
debug
(
"
====>publish event account_on_change 0300====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
@@ -259,8 +259,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -259,8 +259,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
* authorized account
*/
*/
it
(
'
ActsAccountChangeOnOff_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0400
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -280,11 +279,12 @@ export default function ActsAccountChangeOnOff() {
...
@@ -280,11 +279,12 @@ export default function ActsAccountChangeOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
done
();
done
();
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0400 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0400 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_delete_another
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_delete_another
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
deleteAccount
(
"
onoff_deleteFir
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_deleteFir
"
,
deleteAccountCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
...
@@ -318,7 +318,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -318,7 +318,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0400====
"
);
console
.
debug
(
"
====>publish event account_on_change 0400====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
@@ -328,8 +328,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -328,8 +328,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
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -340,12 +339,17 @@ export default function ActsAccountChangeOnOff() {
...
@@ -340,12 +339,17 @@ export default function ActsAccountChangeOnOff() {
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
deleteAccountCallback
(
err
){
console
.
debug
(
"
====>delete account 0500 err:
"
+
JSON
.
stringify
(
err
));
done
();
}
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0500 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0500 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_delete
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_delete
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
done
();
await
sleep
(
1000
)
appAccountManager
.
deleteAccount
(
"
onoff_delete
"
,
deleteAccountCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>publish call back err:
"
+
JSON
.
stringify
(
err
));
...
@@ -355,7 +359,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -355,7 +359,7 @@ export default function ActsAccountChangeOnOff() {
await
appAccountManager
.
deleteAccount
(
"
onoff_delete
"
);
await
appAccountManager
.
deleteAccount
(
"
onoff_delete
"
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>deleteAccount fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>deleteAccount fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
...
@@ -378,7 +382,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -378,7 +382,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0500====
"
);
console
.
debug
(
"
====>publish event account_on_change 0500====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
@@ -388,8 +392,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -388,8 +392,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
* authorized account
*/
*/
it
(
'
ActsAccountChangeOnOff_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0600
'
,
0
,
async
function
(
done
)
{
testInit
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -413,11 +416,12 @@ export default function ActsAccountChangeOnOff() {
...
@@ -413,11 +416,12 @@ export default function ActsAccountChangeOnOff() {
done
();
done
();
});
});
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0600 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0600 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_disable_another
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_disable_another
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
deleteAccount
(
"
onoff_enableFir
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_enableFir
"
,
deleteAccountCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
...
@@ -451,7 +455,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -451,7 +455,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0600====
"
);
console
.
debug
(
"
====>publish event account_on_change 0600====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
@@ -461,8 +465,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -461,8 +465,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
();
await
testInit
();
await
sleep
(
1000
);
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
"
);
...
@@ -478,11 +481,12 @@ export default function ActsAccountChangeOnOff() {
...
@@ -478,11 +481,12 @@ export default function ActsAccountChangeOnOff() {
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
done
();
done
();
}
}
function
subscriberCallback
(
err
,
data
){
async
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>subscriberCallback 0700 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>subscriberCallback 0700 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_disable
"
);
expect
(
data
.
event
).
assertEqual
(
"
account_on_change_disable
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
expect
(
data
.
data
).
assertEqual
(
"
SUCCESS
"
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
await
sleep
(
1000
)
appAccountManager
.
deleteAccount
(
"
onoff_disable
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_disable
"
,
deleteAccountCallback
);
}
}
function
publishCallback
(
err
){
function
publishCallback
(
err
){
...
@@ -516,7 +520,7 @@ export default function ActsAccountChangeOnOff() {
...
@@ -516,7 +520,7 @@ export default function ActsAccountChangeOnOff() {
setTimeout
(
function
(){
setTimeout
(
function
(){
console
.
debug
(
"
====>publish event account_on_change 0700====
"
);
console
.
debug
(
"
====>publish event account_on_change 0700====
"
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
commonevent
.
publish
(
"
account_on_change
"
,
commonEventPublishData
,
publishCallback
);
},
10
00
);
},
5
00
);
});
});
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录