Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
373beb46
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看板
未验证
提交
373beb46
编写于
5月 05, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 05, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8579 【Account】【3.1Release】Memory Leak Rectification
Merge pull request !8579 from 翟孟超/memleak0428
上级
13d07f89
41d8605a
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
286 addition
and
300 deletion
+286
-300
account/appaccount/actsaccounttest/entry/src/main/js/test/AppAccess.test.js
.../actsaccounttest/entry/src/main/js/test/AppAccess.test.js
+7
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/AssociatedData.test.js
...accounttest/entry/src/main/js/test/AssociatedData.test.js
+7
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/CreatManager.test.js
...tsaccounttest/entry/src/main/js/test/CreatManager.test.js
+7
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/Credential.test.js
...actsaccounttest/entry/src/main/js/test/Credential.test.js
+7
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/DeleteAccount.test.js
...saccounttest/entry/src/main/js/test/DeleteAccount.test.js
+7
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/ExtraInfo.test.js
.../actsaccounttest/entry/src/main/js/test/ExtraInfo.test.js
+7
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/NoPermission.test.js
...tsaccounttest/entry/src/main/js/test/NoPermission.test.js
+8
-8
account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
...actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
+9
-7
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
...ppaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
+159
-178
account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js
...allaccounts/entry/src/main/js/test/Getallaccounts.test.js
+52
-47
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/Syncenable.test.js
...checksyncenable/entry/src/main/js/test/Syncenable.test.js
+8
-6
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js
...ssiblemultiple/entry/src/main/js/test/Getmultiple.test.js
+8
-6
未找到文件。
account/appaccount/actsaccounttest/entry/src/main/js/test/AppAccess.test.js
浏览文件 @
373beb46
...
@@ -19,14 +19,13 @@ const TIMEOUT = 5000;
...
@@ -19,14 +19,13 @@ const TIMEOUT = 5000;
const
STRCOUNT
=
1025
;
const
STRCOUNT
=
1025
;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountAppAccess
'
,
function
()
{
describe
(
'
ActsAccountAppAccess
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/AssociatedData.test.js
浏览文件 @
373beb46
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountAssociatedData
'
,
function
()
{
describe
(
'
ActsAccountAssociatedData
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/CreatManager.test.js
浏览文件 @
373beb46
...
@@ -17,14 +17,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -17,14 +17,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
describe
(
'
ActsCreatAppAccountManager
'
,
function
()
{
describe
(
'
ActsCreatAppAccountManager
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/Credential.test.js
浏览文件 @
373beb46
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountCredential
'
,
function
()
{
describe
(
'
ActsAccountCredential
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/DeleteAccount.test.js
浏览文件 @
373beb46
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
NAMELIMIT
=
512
;
const
NAMELIMIT
=
512
;
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
describe
(
'
ActsAccountDeleteAccount
'
,
function
()
{
describe
(
'
ActsAccountDeleteAccount
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/ExtraInfo.test.js
浏览文件 @
373beb46
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -18,14 +18,13 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountSetGetExtraInfo
'
,
function
()
{
describe
(
'
ActsAccountSetGetExtraInfo
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/NoPermission.test.js
浏览文件 @
373beb46
...
@@ -18,15 +18,15 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -18,15 +18,15 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED
=
4521993
;
const
ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED
=
4521993
;
describe
(
'
ActsAccountNoPermission
'
,
function
()
{
describe
(
'
ActsAccountNoPermission
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
await
sleep
(
TIMEOUT
);
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
浏览文件 @
373beb46
...
@@ -29,23 +29,25 @@ const OWNERLENGTHLIMIT = 1024;
...
@@ -29,23 +29,25 @@ const OWNERLENGTHLIMIT = 1024;
const
OWNERSELF
=
"
com.example.actsaccounttest
"
;
const
OWNERSELF
=
"
com.example.actsaccounttest
"
;
describe
(
'
ActsAccountOAuthToken
'
,
function
()
{
describe
(
'
ActsAccountOAuthToken
'
,
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
let
timeoutId
=
null
;
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
continue
;
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
}
});
await
promise
clearTimeout
(
timeoutId
)
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
console
.
debug
(
"
====>beforeAll start====
"
);
sleep
(
TIMEOUT
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
done
();
});
});
beforeEach
(
async
function
(
done
)
{
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll enter====
"
);
console
.
debug
(
"
====>beforeAll enter====
"
);
sleep
(
EACHTIMEOUT
);
await
sleep
(
EACHTIMEOUT
);
done
();
done
();
});
});
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
浏览文件 @
373beb46
...
@@ -20,15 +20,15 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -20,15 +20,15 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
describe
(
'
ActsAccountChangeOnOff
'
,
async
function
()
{
describe
(
'
ActsAccountChangeOnOff
'
,
async
function
()
{
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
timeoutId
=
null
;
setTimeout
(()
=>
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
},
delay
)
});
}).
then
(()
=>
{
await
promise
console
.
info
(
`sleep #{time} over ...`
)
clearTimeout
(
timeoutId
)
})
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>startAbility start====
"
);
console
.
debug
(
"
====>startAbility start====
"
);
await
featureAbility
.
startAbility
(
await
featureAbility
.
startAbility
(
...
@@ -82,9 +82,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -82,9 +82,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
disableAppAccess
(
"
changeonoff_extra
"
,
"
com.example.actsaccountsceneonoff
"
,
disCallback
);
appAccountManager
.
disableAppAccess
(
"
changeonoff_extra
"
,
"
com.example.actsaccountsceneonoff
"
,
disCallback
);
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
);
console
.
debug
(
"
====>setAccountExtraInfo start====
"
);
console
.
debug
(
"
====>setAccountExtraInfo start====
"
);
try
{
try
{
await
appAccountManager
.
setAccountExtraInfo
(
"
changeonoff_extra
"
,
"
change_extra
"
);
await
appAccountManager
.
setAccountExtraInfo
(
"
changeonoff_extra
"
,
"
change_extra
"
);
...
@@ -95,7 +95,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -95,7 +95,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>setAccountExtraInfo finish====
"
);
console
.
debug
(
"
====>setAccountExtraInfo finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_extra
"
]
events
:
[
"
account_on_change_extra
"
]
...
@@ -110,10 +109,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -110,10 +109,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
1
code
:
1
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -145,9 +143,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -145,9 +143,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_associatedata
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_associatedata
"
,
deleteAccountCallback
);
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
)
console
.
debug
(
"
====>setAssociatedData start====
"
);
console
.
debug
(
"
====>setAssociatedData start====
"
);
try
{
try
{
await
appAccountManager
.
setAssociatedData
(
"
onoff_associatedata
"
,
"
change_key
"
,
"
change_value
"
);
await
appAccountManager
.
setAssociatedData
(
"
onoff_associatedata
"
,
"
change_key
"
,
"
change_value
"
);
...
@@ -158,7 +156,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -158,7 +156,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>setAssociatedData finish====
"
);
console
.
debug
(
"
====>setAssociatedData finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_associatedata
"
]
events
:
[
"
account_on_change_associatedata
"
]
...
@@ -173,10 +170,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -173,10 +170,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
2
code
:
2
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -208,9 +204,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -208,9 +204,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_credential
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_credential
"
,
deleteAccountCallback
);
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
)
console
.
debug
(
"
====>setAccountCredential start====
"
);
console
.
debug
(
"
====>setAccountCredential start====
"
);
try
{
try
{
await
appAccountManager
.
setAccountCredential
(
"
onoff_credential
"
,
"
credentialType
"
,
"
credential
"
);
await
appAccountManager
.
setAccountCredential
(
"
onoff_credential
"
,
"
credentialType
"
,
"
credential
"
);
...
@@ -221,7 +217,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -221,7 +217,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>setAccountCredential finish====
"
);
console
.
debug
(
"
====>setAccountCredential finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_credential
"
]
events
:
[
"
account_on_change_credential
"
]
...
@@ -236,10 +231,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -236,10 +231,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
3
code
:
3
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -275,9 +269,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -275,9 +269,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_deleteFir
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_deleteFir
"
,
deleteAccountCallback
);
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
)
console
.
debug
(
"
====>deleteAccount start====
"
);
console
.
debug
(
"
====>deleteAccount start====
"
);
try
{
try
{
await
appAccountManager
.
deleteAccount
(
"
onoff_deleteSec
"
);
await
appAccountManager
.
deleteAccount
(
"
onoff_deleteSec
"
);
...
@@ -288,7 +282,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -288,7 +282,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>deleteAccount finish====
"
);
console
.
debug
(
"
====>deleteAccount finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_delete_another
"
]
events
:
[
"
account_on_delete_another
"
]
...
@@ -303,10 +296,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -303,10 +296,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
4
code
:
4
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -333,9 +325,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -333,9 +325,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
done
();
done
();
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
)
console
.
debug
(
"
====>deleteAccount start====
"
);
console
.
debug
(
"
====>deleteAccount start====
"
);
try
{
try
{
await
appAccountManager
.
deleteAccount
(
"
onoff_delete
"
);
await
appAccountManager
.
deleteAccount
(
"
onoff_delete
"
);
...
@@ -346,7 +338,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -346,7 +338,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>deleteAccount finish====
"
);
console
.
debug
(
"
====>deleteAccount finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_delete
"
]
events
:
[
"
account_on_change_delete
"
]
...
@@ -361,10 +352,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -361,10 +352,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
5
code
:
5
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -404,9 +394,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -404,9 +394,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_enableFir
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_enableFir
"
,
deleteAccountCallback
);
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
)
console
.
debug
(
"
====>disableAppAccess start====
"
);
console
.
debug
(
"
====>disableAppAccess start====
"
);
try
{
try
{
await
appAccountManager
.
disableAppAccess
(
"
onoff_enableSec
"
,
"
com.example.actsaccountsceneonoff
"
);
await
appAccountManager
.
disableAppAccess
(
"
onoff_enableSec
"
,
"
com.example.actsaccountsceneonoff
"
);
...
@@ -417,7 +407,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -417,7 +407,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>disableAppAccess finish====
"
);
console
.
debug
(
"
====>disableAppAccess finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_disable_another
"
]
events
:
[
"
account_on_disable_another
"
]
...
@@ -432,10 +421,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -432,10 +421,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
6
code
:
6
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -467,9 +455,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -467,9 +455,9 @@ describe('ActsAccountChangeOnOff', async function () {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_disable
"
,
deleteAccountCallback
);
appAccountManager
.
deleteAccount
(
"
onoff_disable
"
,
deleteAccountCallback
);
}
}
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
));
setTimeout
(
async
function
(){
await
sleep
(
500
)
console
.
debug
(
"
====>disableAppAccess start====
"
);
console
.
debug
(
"
====>disableAppAccess start====
"
);
try
{
try
{
await
appAccountManager
.
disableAppAccess
(
"
onoff_disable
"
,
"
com.example.actsaccountsceneonoff
"
);
await
appAccountManager
.
disableAppAccess
(
"
onoff_disable
"
,
"
com.example.actsaccountsceneonoff
"
);
...
@@ -480,7 +468,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -480,7 +468,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
}
}
console
.
debug
(
"
====>disableAppAccess finish====
"
);
console
.
debug
(
"
====>disableAppAccess finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_disable
"
]
events
:
[
"
account_on_change_disable
"
]
...
@@ -495,10 +482,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -495,10 +482,9 @@ describe('ActsAccountChangeOnOff', async function () {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
7
code
:
7
}
}
setTimeout
(
function
(){
await
sleep
(
1000
)
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
);
},
1000
);
});
});
/*
/*
...
@@ -651,7 +637,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -651,7 +637,7 @@ describe('ActsAccountChangeOnOff', async function () {
}
}
twiceSign
=
twiceSign
+
1
;
twiceSign
=
twiceSign
+
1
;
}
}
function
changeOnSecondCallback
(
data
){
async
function
changeOnSecondCallback
(
data
){
console
.
debug
(
"
====>second receive change 1000 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>second receive change 1000 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
...
@@ -664,7 +650,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -664,7 +650,7 @@ describe('ActsAccountChangeOnOff', async function () {
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
}
twiceSign
=
twiceSign
+
1
;
twiceSign
=
twiceSign
+
1
;
setTimeout
(
async
function
(){
await
sleep
(
1000
)
console
.
debug
(
"
====>off start====
"
);
console
.
debug
(
"
====>off start====
"
);
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>off ActsAccountChangeOnOff_1000 finish====
"
);
console
.
debug
(
"
====>off ActsAccountChangeOnOff_1000 finish====
"
);
...
@@ -676,7 +662,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -676,7 +662,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
});
});
});
});
},
1000
)
}
}
try
{
try
{
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccounttest
"
],
changeOnFirstCallback
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccounttest
"
],
changeOnFirstCallback
);
...
@@ -744,7 +729,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -744,7 +729,7 @@ describe('ActsAccountChangeOnOff', async function () {
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
setTimeout
(
async
function
(){
await
sleep
(
1000
)
console
.
debug
(
"
====>off 1100 start====
"
);
console
.
debug
(
"
====>off 1100 start====
"
);
expect
(
sameSign
).
assertEqual
(
1
);
expect
(
sameSign
).
assertEqual
(
1
);
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
...
@@ -756,7 +741,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -756,7 +741,6 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
});
});
});
});
},
1000
)
});
});
/*
/*
...
@@ -786,9 +770,9 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -786,9 +770,9 @@ describe('ActsAccountChangeOnOff', async function () {
}
}
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>first off ActsAccountChangeOnOff_1200 finish====
"
);
console
.
debug
(
"
====>first off ActsAccountChangeOnOff_1200 finish====
"
);
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
async
function
(){
console
.
debug
(
"
====>second off ActsAccountChangeOnOff_1200 finish====
"
);
console
.
debug
(
"
====>second off ActsAccountChangeOnOff_1200 finish====
"
);
setTimeout
(
async
function
(){
await
sleep
(
1000
)
console
.
debug
(
"
====>delete account 1200 start====
"
);
console
.
debug
(
"
====>delete account 1200 start====
"
);
appAccountManager
.
deleteAccount
(
"
onoff_repeatoff
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
onoff_repeatoff
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account ActsAccountChangeOnOff_1200 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>delete account ActsAccountChangeOnOff_1200 err:
"
+
JSON
.
stringify
(
err
));
...
@@ -796,7 +780,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -796,7 +780,6 @@ describe('ActsAccountChangeOnOff', async function () {
console
.
debug
(
"
====>ActsAccountChangeOnOff_1200 end====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_1200 end====
"
);
done
();
done
();
});
});
},
1000
)
});
});
});
});
}
}
...
@@ -855,7 +838,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -855,7 +838,7 @@ describe('ActsAccountChangeOnOff', async function () {
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
setTimeout
(
async
function
(){
await
sleep
(
1000
)
console
.
debug
(
"
====>delete account 1300 start====
"
);
console
.
debug
(
"
====>delete account 1300 start====
"
);
appAccountManager
.
deleteAccount
(
"
onoff_same
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
onoff_same
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account ActsAccountChangeOnOff_1300 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>delete account ActsAccountChangeOnOff_1300 err:
"
+
JSON
.
stringify
(
err
));
...
@@ -863,7 +846,6 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -863,7 +846,6 @@ describe('ActsAccountChangeOnOff', async function () {
console
.
debug
(
"
====>ActsAccountChangeOnOff_1300 end====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_1300 end====
"
);
done
();
done
();
});
});
},
1000
)
});
});
/*
/*
...
@@ -902,7 +884,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -902,7 +884,7 @@ describe('ActsAccountChangeOnOff', async function () {
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
setTimeout
(
async
function
(){
await
sleep
(
1000
)
console
.
debug
(
"
====>delete account 1400 start====
"
);
console
.
debug
(
"
====>delete account 1400 start====
"
);
appAccountManager
.
deleteAccount
(
"
onoff_same
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
onoff_same
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account ActsAccountChangeOnOff_1400 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>delete account ActsAccountChangeOnOff_1400 err:
"
+
JSON
.
stringify
(
err
));
...
@@ -910,6 +892,5 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -910,6 +892,5 @@ describe('ActsAccountChangeOnOff', async function () {
console
.
debug
(
"
====>ActsAccountChangeOnOff_1400 end====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_1400 end====
"
);
done
();
done
();
});
});
},
1000
)
});
});
})
})
\ No newline at end of file
account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js
浏览文件 @
373beb46
...
@@ -20,6 +20,15 @@ const TIMEOUT = 2000;
...
@@ -20,6 +20,15 @@ const TIMEOUT = 2000;
const
LENGTHLIMIT
=
1024
;
const
LENGTHLIMIT
=
1024
;
describe
(
'
ActsGetAllAccounts
'
,
function
()
{
describe
(
'
ActsGetAllAccounts
'
,
function
()
{
async
function
sleep
(
delay
)
{
let
timeoutId
=
null
;
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
});
await
promise
clearTimeout
(
timeoutId
)
}
/*
/*
* @tc.number : ActsGetAllAccounts_0100
* @tc.number : ActsGetAllAccounts_0100
* @tc.name : getAllAccounts callback
* @tc.name : getAllAccounts callback
...
@@ -285,10 +294,9 @@ describe('ActsGetAllAccounts', function () {
...
@@ -285,10 +294,9 @@ describe('ActsGetAllAccounts', function () {
done
();
done
();
});
});
}
}
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAllAccounts 0900 start====
"
);
console
.
debug
(
"
====>getAllAccounts 0900 start====
"
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
getAllCallback
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
getAllCallback
);
},
TIMEOUT
);
});
});
/*
/*
...
@@ -318,7 +326,7 @@ describe('ActsGetAllAccounts', function () {
...
@@ -318,7 +326,7 @@ describe('ActsGetAllAccounts', function () {
},
},
},
},
);
);
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAllAccounts 1000 start====
"
);
console
.
debug
(
"
====>getAllAccounts 1000 start====
"
);
try
{
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
var
data
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
...
@@ -342,7 +350,6 @@ describe('ActsGetAllAccounts', function () {
...
@@ -342,7 +350,6 @@ describe('ActsGetAllAccounts', function () {
await
appAccountManager
.
deleteAccount
(
"
Account_application_promise
"
);
await
appAccountManager
.
deleteAccount
(
"
Account_application_promise
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1000 end====
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1000 end====
"
);
done
();
done
();
},
TIMEOUT
);
});
});
/*
/*
...
@@ -379,10 +386,9 @@ describe('ActsGetAllAccounts', function () {
...
@@ -379,10 +386,9 @@ describe('ActsGetAllAccounts', function () {
console
.
debug
(
"
====>ActsGetAllAccounts_1100 end====
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1100 end====
"
);
done
();
done
();
}
}
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAllAccounts 1100 start====
"
);
console
.
debug
(
"
====>getAllAccounts 1100 start====
"
);
appAccountManager
.
getAllAccounts
(
specifiedBundle
,
getAllCallback
);
appAccountManager
.
getAllAccounts
(
specifiedBundle
,
getAllCallback
);
},
TIMEOUT
);
});
});
/*
/*
...
@@ -410,7 +416,7 @@ describe('ActsGetAllAccounts', function () {
...
@@ -410,7 +416,7 @@ describe('ActsGetAllAccounts', function () {
},
},
},
},
);
);
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAllAccounts 1200 start====
"
);
console
.
debug
(
"
====>getAllAccounts 1200 start====
"
);
try
{
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
specifiedBundle
);
var
data
=
await
appAccountManager
.
getAllAccounts
(
specifiedBundle
);
...
@@ -425,7 +431,6 @@ describe('ActsGetAllAccounts', function () {
...
@@ -425,7 +431,6 @@ describe('ActsGetAllAccounts', function () {
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsscenegetallaccounts
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsscenegetallaccounts
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1200 end====
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1200 end====
"
);
done
();
done
();
},
TIMEOUT
);
});
});
/*
/*
...
...
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/Syncenable.test.js
浏览文件 @
373beb46
...
@@ -30,16 +30,18 @@ describe('ActsSetCheckSyncEnable', function () {
...
@@ -30,16 +30,18 @@ describe('ActsSetCheckSyncEnable', function () {
var
atManager
=
abilityAccessCtrl
.
createAtManager
();
var
atManager
=
abilityAccessCtrl
.
createAtManager
();
var
result
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
PERMISSION_USER_NAME
,
PERMISSION_USER_SET
);
var
result
=
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
PERMISSION_USER_NAME
,
PERMISSION_USER_SET
);
console
.
debug
(
"
tokenId
"
+
tokenID
+
"
result:
"
+
result
);
console
.
debug
(
"
tokenId
"
+
tokenID
+
"
result:
"
+
result
);
sleep
(
TIMEOUT
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
done
();
})
})
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
let
timeoutId
=
null
;
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
continue
;
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
}
});
await
promise
clearTimeout
(
timeoutId
)
}
}
/*
/*
...
...
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js
浏览文件 @
373beb46
...
@@ -33,15 +33,17 @@ describe('ActsGetAllAccessibleMultiple', function () {
...
@@ -33,15 +33,17 @@ describe('ActsGetAllAccessibleMultiple', function () {
},
},
},
},
);
);
sleep
(
TIMEOUT
);
await
sleep
(
TIMEOUT
);
done
();
done
();
});
});
function
sleep
(
delay
)
{
async
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
let
timeoutId
=
null
;
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
var
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
continue
;
timeoutId
=
setTimeout
(()
=>
resolve
(
"
done!
"
),
delay
);
}
});
await
promise
clearTimeout
(
timeoutId
)
}
}
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录