Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
201b77cf
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看板
未验证
提交
201b77cf
编写于
3月 24, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 24, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8199 【account】【OpenHarmony-3.2-Release】setTimeout内存泄露
Merge pull request !8199 from 郭永强/324haha
上级
1d3dfc46
6d486918
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
191 addition
and
525 deletion
+191
-525
account/appaccount/actsaccountoperatetest/src/main/js/test/AccountCredential.test.js
...untoperatetest/src/main/js/test/AccountCredential.test.js
+0
-23
account/appaccount/actsaccountoperatetest/src/main/js/test/AccountManager.test.js
...ccountoperatetest/src/main/js/test/AccountManager.test.js
+0
-18
account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js
...actsaccountoperatetest/src/main/js/test/AuthToken.test.js
+0
-25
account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js
...accountoperatetest/src/main/js/test/Authenticator.test.js
+37
-46
account/appaccount/actsaccountoperatetest/src/main/js/test/ChangeOnOff.js
...nt/actsaccountoperatetest/src/main/js/test/ChangeOnOff.js
+22
-34
account/appaccount/actsaccountoperatetest/src/main/js/test/CustomData.test.js
...ctsaccountoperatetest/src/main/js/test/CustomData.test.js
+0
-24
account/appaccount/actsaccountoperatetest/src/main/js/test/ErrCode.test.js
...t/actsaccountoperatetest/src/main/js/test/ErrCode.test.js
+0
-22
account/appaccount/actsaccountoperatetest/src/main/js/test/ErrPermission.test.js
...accountoperatetest/src/main/js/test/ErrPermission.test.js
+0
-17
account/appaccount/actsaccountoperatetest/src/main/js/test/RemoveAccount.test.js
...accountoperatetest/src/main/js/test/RemoveAccount.test.js
+0
-17
account/appaccount/actsaccountoperatetest/src/main/js/test/SetAppAccess.test.js
...saccountoperatetest/src/main/js/test/SetAppAccess.test.js
+0
-24
account/appaccount/actsaccounttest/src/main/js/test/AppAccess.test.js
...ccount/actsaccounttest/src/main/js/test/AppAccess.test.js
+0
-22
account/appaccount/actsaccounttest/src/main/js/test/AssociatedData.test.js
...t/actsaccounttest/src/main/js/test/AssociatedData.test.js
+0
-23
account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
...nt/actsaccounttest/src/main/js/test/Authenticator.test.js
+1
-12
account/appaccount/actsaccounttest/src/main/js/test/CreatManager.test.js
...unt/actsaccounttest/src/main/js/test/CreatManager.test.js
+1
-18
account/appaccount/actsaccounttest/src/main/js/test/Credential.test.js
...count/actsaccounttest/src/main/js/test/Credential.test.js
+0
-22
account/appaccount/actsaccounttest/src/main/js/test/DeleteAccount.test.js
...nt/actsaccounttest/src/main/js/test/DeleteAccount.test.js
+0
-16
account/appaccount/actsaccounttest/src/main/js/test/ExtraInfo.test.js
...ccount/actsaccounttest/src/main/js/test/ExtraInfo.test.js
+0
-22
account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
...unt/actsaccounttest/src/main/js/test/NoPermission.test.js
+0
-15
account/appaccount/actsaccounttest/src/main/js/test/OAuthToken.test.js
...count/actsaccounttest/src/main/js/test/OAuthToken.test.js
+0
-22
account/appaccount/actsgetaccountsbyowner/signature/openharmony_sx.p7b
...count/actsgetaccountsbyowner/signature/openharmony_sx.p7b
+0
-0
account/appaccount/actsgetaccountsbyowner/src/main/config.json
...nt/appaccount/actsgetaccountsbyowner/src/main/config.json
+4
-0
account/appaccount/actsgetaccountsbyowner/src/main/js/test/Getaccountsbyowner.test.js
...countsbyowner/src/main/js/test/Getaccountsbyowner.test.js
+53
-47
account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
...ctsgetallaccounts/src/main/js/test/Getallaccounts.test.js
+37
-29
account/appaccount/getallaccounts/actsgetallaccountsnoparameter/src/main/js/test/Getallaccounts.test.js
...countsnoparameter/src/main/js/test/Getallaccounts.test.js
+36
-27
未找到文件。
account/appaccount/actsaccountoperatetest/src/main/js/test/AccountCredential.test.js
浏览文件 @
201b77cf
...
@@ -20,29 +20,6 @@ const EACHTIMEOUT = 500;
...
@@ -20,29 +20,6 @@ const EACHTIMEOUT = 500;
const
ERR_JS_CREDENTIAL_NOT_EXIST
=
12300102
;
const
ERR_JS_CREDENTIAL_NOT_EXIST
=
12300102
;
export
default
function
ActsAppAccountCredential
()
{
export
default
function
ActsAppAccountCredential
()
{
describe
(
'
ActsAppAccountCredential
'
,
function
()
{
describe
(
'
ActsAppAccountCredential
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAppAccountCredential_0100
* @tc.number : ActsAppAccountCredential_0100
* @tc.name : The correct calls setAssociatedData and getCredential get the credential
* @tc.name : The correct calls setAssociatedData and getCredential get the credential
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/AccountManager.test.js
浏览文件 @
201b77cf
...
@@ -15,26 +15,8 @@
...
@@ -15,26 +15,8 @@
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
TIMEOUT
=
5000
;
export
default
function
ActsAccountManager
()
{
export
default
function
ActsAccountManager
()
{
describe
(
'
ActsAccountManager
'
,
function
()
{
describe
(
'
ActsAccountManager
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
/*
/*
* @tc.number : ActsAccountManager_0100
* @tc.number : ActsAccountManager_0100
* @tc.name : createAppAccountManager
* @tc.name : createAppAccountManager
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js
浏览文件 @
201b77cf
...
@@ -19,9 +19,6 @@ import featureAbility from '@ohos.ability.featureAbility'
...
@@ -19,9 +19,6 @@ import featureAbility from '@ohos.ability.featureAbility'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
AccountErrCode
}
from
'
./AccountErrCode.test.js
'
import
{
AccountErrCode
}
from
'
./AccountErrCode.test.js
'
const
TIMEOUT
=
1000
;
const
EACHTIMEOUT
=
500
;
const
LENGTHLIMIT
=
512
;
const
LENGTHLIMIT
=
512
;
const
TOKENLENGTHLIMIT
=
1024
;
const
TOKENLENGTHLIMIT
=
1024
;
const
AUTHTYPELENGTHLIMIT
=
1024
;
const
AUTHTYPELENGTHLIMIT
=
1024
;
...
@@ -30,28 +27,6 @@ const ERR_JS_AUTH_TYPE_NOT_FOUND = 12300107;
...
@@ -30,28 +27,6 @@ const ERR_JS_AUTH_TYPE_NOT_FOUND = 12300107;
const
OWNERSELF
=
"
com.example.actsaccountoperatetest
"
;
const
OWNERSELF
=
"
com.example.actsaccountoperatetest
"
;
export
default
function
ActsAccountAuthToken
()
{
export
default
function
ActsAccountAuthToken
()
{
describe
(
'
ActsAccountAuthToken
'
,
function
()
{
describe
(
'
ActsAccountAuthToken
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
});
/*
/*
* @tc.number : testGetEntriesString101
* @tc.number : testGetEntriesString101
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js
浏览文件 @
201b77cf
...
@@ -23,16 +23,6 @@ const owner = 'com.example.accountauthenticator'
...
@@ -23,16 +23,6 @@ const owner = 'com.example.accountauthenticator'
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
export
default
function
ActsAccountAppAccess
()
{
export
default
function
ActsAccountAppAccess
()
{
describe
(
'
ActsAccountAuthenticator
'
,
function
()
{
describe
(
'
ActsAccountAuthenticator
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountAuthenticator beforeAll start====
"
);
console
.
debug
(
"
====>ActsAccountAuthenticator beforeAll start====
"
);
await
featureAbility
.
startAbilityForResult
(
await
featureAbility
.
startAbilityForResult
(
...
@@ -167,6 +157,8 @@ export default function ActsAccountAppAccess() {
...
@@ -167,6 +157,8 @@ export default function ActsAccountAppAccess() {
done
();
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0400 delete_account_err
"
);
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0400 delete_account_err
"
);
expect
().
assertFail
();
done
();
});
});
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0400 err:
"
+
JSON
.
stringify
(
err
))
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0400 err:
"
+
JSON
.
stringify
(
err
))
...
@@ -197,10 +189,12 @@ export default function ActsAccountAppAccess() {
...
@@ -197,10 +189,12 @@ export default function ActsAccountAppAccess() {
expect
(
account
.
Constants
.
KEY_BOOLEAN_RESULT
).
assertEqual
(
'
booleanResult
'
)
expect
(
account
.
Constants
.
KEY_BOOLEAN_RESULT
).
assertEqual
(
'
booleanResult
'
)
appAccountManager
.
removeAccount
(
name
).
then
((
data
)
=>
{
appAccountManager
.
removeAccount
(
name
).
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0500 delete_account_success
"
);
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0500 delete_account_success
"
);
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0500 delete_account_err
"
);
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0500 delete_account_err
"
);
expect
().
assertFail
();
done
();
});
});
done
()
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0500 err:
"
+
JSON
.
stringify
(
err
))
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0500 err:
"
+
JSON
.
stringify
(
err
))
expect
(
typeof
(
err
)
!=
undefined
).
assertTrue
();
expect
(
typeof
(
err
)
!=
undefined
).
assertTrue
();
...
@@ -228,10 +222,12 @@ export default function ActsAccountAppAccess() {
...
@@ -228,10 +222,12 @@ export default function ActsAccountAppAccess() {
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 data:
"
+
JSON
.
stringify
(
data
));
appAccountManager
.
removeAccount
(
'
CheckAccountLabels_0600
'
).
then
((
data
)
=>
{
appAccountManager
.
removeAccount
(
'
CheckAccountLabels_0600
'
).
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 delete_account_success
"
);
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 delete_account_success
"
);
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 delete_account_err
"
);
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 delete_account_err
"
);
expect
().
assertFail
();
done
();
});
});
done
()
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 err:
"
+
JSON
.
stringify
(
err
))
console
.
debug
(
"
====>ActsAccountCheckAccountLabels_0600 err:
"
+
JSON
.
stringify
(
err
))
expect
().
assertFail
();
expect
().
assertFail
();
...
@@ -271,19 +267,19 @@ export default function ActsAccountAppAccess() {
...
@@ -271,19 +267,19 @@ export default function ActsAccountAppAccess() {
appAccountManager
.
setAppAccess
(
name
,
owner
,
false
,
(
err
,
data
)
=>
{
appAccountManager
.
setAppAccess
(
name
,
owner
,
false
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0100 disableAppAccount_err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0100 disableAppAccount_err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
appAccountManager
.
checkAppAccess
(
name
,
owner
,(
err
,
data
)
=>
{
appAccountManager
.
checkAppAccess
(
name
,
owner
,
async
(
err
,
data
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0100 third_err:
"
+
JSON
.
stringify
(
err
))
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0100 third_err:
"
+
JSON
.
stringify
(
err
))
expect
(
err
).
assertEqual
(
null
)
expect
(
err
).
assertEqual
(
null
)
expect
(
data
).
assertEqual
(
false
)
expect
(
data
).
assertEqual
(
false
)
try
{
try
{
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0100 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0100 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0100 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0100 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
done
();
})
})
})
})
...
@@ -315,18 +311,18 @@ export default function ActsAccountAppAccess() {
...
@@ -315,18 +311,18 @@ export default function ActsAccountAppAccess() {
expect
(
data
).
assertEqual
(
true
);
expect
(
data
).
assertEqual
(
true
);
appAccountManager
.
setAppAccess
(
name
,
owner
,
false
).
then
((
data
)
=>
{
appAccountManager
.
setAppAccess
(
name
,
owner
,
false
).
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0200 disabAppAccess_data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0200 disabAppAccess_data:
"
+
JSON
.
stringify
(
data
));
appAccountManager
.
checkAppAccess
(
name
,
owner
).
then
((
data
)
=>
{
appAccountManager
.
checkAppAccess
(
name
,
owner
).
then
(
async
(
data
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0200 third_data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0200 third_data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertEqual
(
false
);
expect
(
data
).
assertEqual
(
false
);
try
{
try
{
appAccountManager
.
removeAccount
(
name
)
a
wait
a
ppAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0200 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0200 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0100 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountCheckAppAccess_0100 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0200 third_err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>ActsAccountCheckAppAccess_0200 third_err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
...
@@ -381,21 +377,20 @@ export default function ActsAccountAppAccess() {
...
@@ -381,21 +377,20 @@ export default function ActsAccountAppAccess() {
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 getAccountCredential_err:
"
+
JSON
.
stringify
(
err
))
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 getAccountCredential_err:
"
+
JSON
.
stringify
(
err
))
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 getAccountCredential_success:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 getAccountCredential_success:
"
+
JSON
.
stringify
(
data
));
appAccountManager
.
deleteCredential
(
name
,
"
PIN
"
,
(
err
,
data
)
=>
{
appAccountManager
.
deleteCredential
(
name
,
"
PIN
"
,
async
(
err
,
data
)
=>
{
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 deleteCredential_err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 deleteCredential_err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
).
assertEqual
(
null
);
expect
(
err
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 deleteCredential_data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountDeleteCredential_0100 deleteCredential_data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertEqual
(
null
);
expect
(
data
).
assertEqual
(
null
);
try
{
try
{
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountDeleteCredential_0100 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountDeleteCredential_0100 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountDeleteCredential_0100 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountDeleteCredential_0100 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
done
();
}
}
done
();
})
})
})
})
});
});
...
@@ -417,17 +412,17 @@ export default function ActsAccountAppAccess() {
...
@@ -417,17 +412,17 @@ export default function ActsAccountAppAccess() {
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 setAccountCredential_success
"
);
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 setAccountCredential_success
"
);
appAccountManager
.
getCredential
(
name
,
"
PIN
"
).
then
((
data
)
=>
{
appAccountManager
.
getCredential
(
name
,
"
PIN
"
).
then
((
data
)
=>
{
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 getAccountCredential_data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 getAccountCredential_data:
"
+
JSON
.
stringify
(
data
));
appAccountManager
.
deleteCredential
(
name
,
"
PIN
"
).
then
((
data
)
=>
{
appAccountManager
.
deleteCredential
(
name
,
"
PIN
"
).
then
(
async
(
data
)
=>
{
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 data:
"
+
JSON
.
stringify
(
data
));
try
{
try
{
appAccountManager
.
removeAccount
(
name
)
a
wait
a
ppAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountDeleteCredential_0200 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountDeleteCredential_0200 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountDeleteCredential_0200 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountDeleteCredential_0200 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>ActsAccountDeleteCredential_0200 err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
...
@@ -473,12 +468,10 @@ export default function ActsAccountAppAccess() {
...
@@ -473,12 +468,10 @@ export default function ActsAccountAppAccess() {
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountVerifyCredential_0100 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountVerifyCredential_0100 removeAccount_success
'
)
done
();
}
catch
{
}
catch
{
console
.
debug
(
'
====>ActsAccountVerifyCredential_0100 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountVerifyCredential_0100 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
}
}
done
();
done
();
},
},
onRequestRedirected
:
null
,
onRequestRedirected
:
null
,
...
@@ -511,7 +504,6 @@ export default function ActsAccountAppAccess() {
...
@@ -511,7 +504,6 @@ export default function ActsAccountAppAccess() {
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountVerifyCredential_0200 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountVerifyCredential_0200 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountVerifyCredential_0200 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountVerifyCredential_0200 removeAccount_err
'
)
...
@@ -549,7 +541,6 @@ export default function ActsAccountAppAccess() {
...
@@ -549,7 +541,6 @@ export default function ActsAccountAppAccess() {
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0100 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0100 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0100 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0100 removeAccount_err
'
)
...
@@ -586,7 +577,6 @@ export default function ActsAccountAppAccess() {
...
@@ -586,7 +577,6 @@ export default function ActsAccountAppAccess() {
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0200 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0200 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0200 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountSetAuthenticatorProperties_0200 removeAccount_err
'
)
...
@@ -625,17 +615,18 @@ export default function ActsAccountAppAccess() {
...
@@ -625,17 +615,18 @@ export default function ActsAccountAppAccess() {
await
appAccountManager
.
removeAccount
(
name
);
await
appAccountManager
.
removeAccount
(
name
);
expect
(
err
).
assertEqual
(
null
)
expect
(
err
).
assertEqual
(
null
)
done
();
done
();
return
}
}
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0100 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0100 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0100 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0100 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
done
();
done
();
}
}
done
();
});
});
});
});
...
@@ -662,17 +653,17 @@ export default function ActsAccountAppAccess() {
...
@@ -662,17 +653,17 @@ export default function ActsAccountAppAccess() {
await
appAccountManager
.
removeAccount
(
name
);
await
appAccountManager
.
removeAccount
(
name
);
expect
(
err
).
assertEqual
(
null
)
expect
(
err
).
assertEqual
(
null
)
done
();
done
();
return
;
}
}
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0200 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0200 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0200 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0200 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
done
();
}
}
done
();
});
});
});
});
...
@@ -700,17 +691,17 @@ export default function ActsAccountAppAccess() {
...
@@ -700,17 +691,17 @@ export default function ActsAccountAppAccess() {
await
appAccountManager
.
removeAccount
(
name
);
await
appAccountManager
.
removeAccount
(
name
);
expect
(
err
).
assertEqual
(
null
)
expect
(
err
).
assertEqual
(
null
)
done
();
done
();
return
;
}
}
try
{
try
{
await
appAccountManager
.
removeAccount
(
name
)
await
appAccountManager
.
removeAccount
(
name
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0300 removeAccount_success
'
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0300 removeAccount_success
'
)
done
();
}
}
catch
{
catch
{
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0300 removeAccount_err
'
)
console
.
debug
(
'
====>ActsAccountSelectAccountByOptions_0300 removeAccount_err
'
)
expect
().
assertFail
()
expect
().
assertFail
()
done
();
}
}
done
();
});
});
});
});
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/ChangeOnOff.js
浏览文件 @
201b77cf
...
@@ -21,18 +21,14 @@ const TIMEOUT = 2000;
...
@@ -21,18 +21,14 @@ const TIMEOUT = 2000;
export
default
function
ActsAccountOnOff
()
{
export
default
function
ActsAccountOnOff
()
{
describe
(
'
ActsAccountOnOff
'
,
async
function
()
{
describe
(
'
ActsAccountOnOff
'
,
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
)
{
done
();
});
async
function
testInit
(){
async
function
testInit
(){
console
.
debug
(
"
====>startAbility start====
"
);
console
.
debug
(
"
====>startAbility start====
"
);
...
@@ -83,9 +79,9 @@ export default function ActsAccountOnOff() {
...
@@ -83,9 +79,9 @@ export default function ActsAccountOnOff() {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
removeAccount
(
"
onoff_setcredential
"
,
removeAccountCallback
);
appAccountManager
.
removeAccount
(
"
onoff_setcredential
"
,
removeAccountCallback
);
}
}
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
(
"
====>setCredential start====
"
);
console
.
debug
(
"
====>setCredential start====
"
);
try
{
try
{
await
appAccountManager
.
setCredential
(
"
onoff_setcredential
"
,
"
credentialType
"
,
"
credential
"
);
await
appAccountManager
.
setCredential
(
"
onoff_setcredential
"
,
"
credentialType
"
,
"
credential
"
);
...
@@ -96,7 +92,6 @@ export default function ActsAccountOnOff() {
...
@@ -96,7 +92,6 @@ export default function ActsAccountOnOff() {
done
();
done
();
}
}
console
.
debug
(
"
====>setCredential finish====
"
);
console
.
debug
(
"
====>setCredential finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_setcredential
"
]
events
:
[
"
account_on_change_setcredential
"
]
...
@@ -111,10 +106,9 @@ export default function ActsAccountOnOff() {
...
@@ -111,10 +106,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
9
code
:
9
}
}
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
);
});
});
/*
/*
...
@@ -152,9 +146,9 @@ export default function ActsAccountOnOff() {
...
@@ -152,9 +146,9 @@ export default function ActsAccountOnOff() {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
removeAccount
(
"
onoff_removeFir
"
,
removeAccountCallback
);
appAccountManager
.
removeAccount
(
"
onoff_removeFir
"
,
removeAccountCallback
);
}
}
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
(
"
====>removeAccount start====
"
);
console
.
debug
(
"
====>removeAccount start====
"
);
try
{
try
{
await
appAccountManager
.
removeAccount
(
"
onoff_removeSec
"
);
await
appAccountManager
.
removeAccount
(
"
onoff_removeSec
"
);
...
@@ -165,7 +159,6 @@ export default function ActsAccountOnOff() {
...
@@ -165,7 +159,6 @@ export default function ActsAccountOnOff() {
done
();
done
();
}
}
console
.
debug
(
"
====>removeAccount finish====
"
);
console
.
debug
(
"
====>removeAccount finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_remove_another
"
]
events
:
[
"
account_on_remove_another
"
]
...
@@ -180,10 +173,9 @@ export default function ActsAccountOnOff() {
...
@@ -180,10 +173,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
10
code
:
10
}
}
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
);
});
});
/*
/*
...
@@ -212,9 +204,9 @@ export default function ActsAccountOnOff() {
...
@@ -212,9 +204,9 @@ export default function ActsAccountOnOff() {
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
(
"
====>removeAccount start====
"
);
console
.
debug
(
"
====>removeAccount start====
"
);
try
{
try
{
await
appAccountManager
.
removeAccount
(
"
onoff_remove
"
);
await
appAccountManager
.
removeAccount
(
"
onoff_remove
"
);
...
@@ -225,7 +217,6 @@ export default function ActsAccountOnOff() {
...
@@ -225,7 +217,6 @@ export default function ActsAccountOnOff() {
done
();
done
();
}
}
console
.
debug
(
"
====>removeAccount finish====
"
);
console
.
debug
(
"
====>removeAccount finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change_remove
"
]
events
:
[
"
account_on_change_remove
"
]
...
@@ -240,10 +231,9 @@ export default function ActsAccountOnOff() {
...
@@ -240,10 +231,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
11
code
:
11
}
}
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
);
});
});
/*
/*
...
@@ -285,9 +275,9 @@ export default function ActsAccountOnOff() {
...
@@ -285,9 +275,9 @@ export default function ActsAccountOnOff() {
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
commonevent
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
appAccountManager
.
removeAccount
(
"
onoff_disableFir
"
,
removeAccountCallback
);
appAccountManager
.
removeAccount
(
"
onoff_disableFir
"
,
removeAccountCallback
);
}
}
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
.
setAppAccess
(
"
onoff_disableSec
"
,
"
com.example.actsaccountsceneonoff
"
,
false
);
await
appAccountManager
.
setAppAccess
(
"
onoff_disableSec
"
,
"
com.example.actsaccountsceneonoff
"
,
false
);
...
@@ -298,7 +288,6 @@ export default function ActsAccountOnOff() {
...
@@ -298,7 +288,6 @@ export default function ActsAccountOnOff() {
done
();
done
();
}
}
console
.
debug
(
"
====>disableAppAccess finish====
"
);
console
.
debug
(
"
====>disableAppAccess finish====
"
);
},
500
)
}
}
var
commonEventSubscribeInfo
=
{
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_set_another_disable
"
]
events
:
[
"
account_on_set_another_disable
"
]
...
@@ -313,10 +302,9 @@ export default function ActsAccountOnOff() {
...
@@ -313,10 +302,9 @@ export default function ActsAccountOnOff() {
var
commonEventPublishData
=
{
var
commonEventPublishData
=
{
code
:
12
code
:
12
}
}
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
);
});
});
})
})
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/CustomData.test.js
浏览文件 @
201b77cf
...
@@ -15,32 +15,8 @@
...
@@ -15,32 +15,8 @@
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
export
default
function
ActsAccountCustomData
()
{
export
default
function
ActsAccountCustomData
()
{
describe
(
'
ActsAccountCustomData
'
,
function
()
{
describe
(
'
ActsAccountCustomData
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountCustomData_0100
* @tc.number : ActsAccountCustomData_0100
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/ErrCode.test.js
浏览文件 @
201b77cf
...
@@ -20,28 +20,6 @@ const STRCOUNT = 1025;
...
@@ -20,28 +20,6 @@ const STRCOUNT = 1025;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
export
default
function
ActsAccountErrCode
()
{
export
default
function
ActsAccountErrCode
()
{
describe
(
'
ActsAccountErrCode
'
,
function
()
{
describe
(
'
ActsAccountErrCode
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountErrCode_0100
* @tc.number : ActsAccountErrCode_0100
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/ErrPermission.test.js
浏览文件 @
201b77cf
...
@@ -15,26 +15,9 @@
...
@@ -15,26 +15,9 @@
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
TIMEOUT
=
5000
;
const
ERR_PERMISSION_DENIED
=
201
;
const
ERR_PERMISSION_DENIED
=
201
;
export
default
function
ActsAccountErrPermission
()
{
export
default
function
ActsAccountErrPermission
()
{
describe
(
'
ActsAccountErrPermission
'
,
function
()
{
describe
(
'
ActsAccountErrPermission
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
/*
/*
* @tc.number : ActsAccountErrPermission_0100
* @tc.number : ActsAccountErrPermission_0100
* @tc.name : setDataSyncEnabled callback
* @tc.name : setDataSyncEnabled callback
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/RemoveAccount.test.js
浏览文件 @
201b77cf
...
@@ -15,28 +15,11 @@
...
@@ -15,28 +15,11 @@
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
NAMELIMIT
=
512
;
const
NAMELIMIT
=
512
;
const
TIMEOUT
=
5000
;
const
ERR_INVALID_PARAMETER
=
12300002
const
ERR_INVALID_PARAMETER
=
12300002
const
ERR_ACCOUNT_NO_EXIST
=
12300003
const
ERR_ACCOUNT_NO_EXIST
=
12300003
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
export
default
function
ActsAccountRemoveAccount
()
{
export
default
function
ActsAccountRemoveAccount
()
{
describe
(
'
ActsAccountRemoveAccount
'
,
function
()
{
describe
(
'
ActsAccountRemoveAccount
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
/*
/*
* @tc.number : ActsAccountRemoveAccount_0100
* @tc.number : ActsAccountRemoveAccount_0100
...
...
account/appaccount/actsaccountoperatetest/src/main/js/test/SetAppAccess.test.js
浏览文件 @
201b77cf
...
@@ -15,34 +15,10 @@
...
@@ -15,34 +15,10 @@
import
account
from
'
@ohos.account.appAccount
'
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
TIMEOUT
=
5000
;
const
STRCOUNT
=
513
;
const
STRCOUNT
=
513
;
const
EACHTIMEOUT
=
500
;
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
export
default
function
ActsAccountSetAppAccess
()
{
export
default
function
ActsAccountSetAppAccess
()
{
describe
(
'
ActsAccountSetAppAccess
'
,
function
()
{
describe
(
'
ActsAccountSetAppAccess
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountSetAppAccess_0100
* @tc.number : ActsAccountSetAppAccess_0100
...
...
account/appaccount/actsaccounttest/src/main/js/test/AppAccess.test.js
浏览文件 @
201b77cf
...
@@ -20,28 +20,6 @@ const STRCOUNT = 1025;
...
@@ -20,28 +20,6 @@ const STRCOUNT = 1025;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
export
default
function
ActsAccountAppAccess
()
{
export
default
function
ActsAccountAppAccess
()
{
describe
(
'
ActsAccountAppAccess
'
,
function
()
{
describe
(
'
ActsAccountAppAccess
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountAppAccess_0100
* @tc.number : ActsAccountAppAccess_0100
...
...
account/appaccount/actsaccounttest/src/main/js/test/AssociatedData.test.js
浏览文件 @
201b77cf
...
@@ -19,29 +19,6 @@ const TIMEOUT = 5000;
...
@@ -19,29 +19,6 @@ const TIMEOUT = 5000;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
export
default
function
ActsAccountAssociatedData
()
{
export
default
function
ActsAccountAssociatedData
()
{
describe
(
'
ActsAccountAssociatedData
'
,
function
()
{
describe
(
'
ActsAccountAssociatedData
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountAssociatedData_0100
* @tc.number : ActsAccountAssociatedData_0100
* @tc.name : The correct calls setAssociatedData and getAssociatedData get the value
* @tc.name : The correct calls setAssociatedData and getAssociatedData get the value
...
...
account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
浏览文件 @
201b77cf
...
@@ -20,18 +20,8 @@ const NAMELIMIT = 512;
...
@@ -20,18 +20,8 @@ const NAMELIMIT = 512;
const
LENGTHLIMIT
=
1024
;
const
LENGTHLIMIT
=
1024
;
const
name
=
'
zhangsan
'
const
name
=
'
zhangsan
'
const
owner
=
'
com.example.accountauthenticator
'
const
owner
=
'
com.example.accountauthenticator
'
export
default
function
ActsAccountA
ppAccess
()
{
export
default
function
ActsAccountA
uthenticator
()
{
describe
(
'
ActsAccountAuthenticator
'
,
function
()
{
describe
(
'
ActsAccountAuthenticator
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>accountauthenticatorbeforeAll start====
"
);
console
.
debug
(
"
====>accountauthenticatorbeforeAll start====
"
);
await
featureAbility
.
startAbility
(
await
featureAbility
.
startAbility
(
...
@@ -607,7 +597,6 @@ export default function ActsAccountAppAccess() {
...
@@ -607,7 +597,6 @@ export default function ActsAccountAppAccess() {
*/
*/
it
(
'
ActsAccountSelectAccountByOptions_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountSelectAccountByOptions_0100
'
,
0
,
async
function
(
done
)
{
await
sleep
(
1000
)
console
.
debug
(
"
====>ActsAccountSelectAccountByOptions_0100 start====
"
);
console
.
debug
(
"
====>ActsAccountSelectAccountByOptions_0100 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
var
select_options
=
{
allowedAccounts
:[{
"
name
"
:
name
,
"
owner
"
:
owner
}]}
var
select_options
=
{
allowedAccounts
:[{
"
name
"
:
name
,
"
owner
"
:
owner
}]}
...
...
account/appaccount/actsaccounttest/src/main/js/test/CreatManager.test.js
浏览文件 @
201b77cf
...
@@ -17,24 +17,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
...
@@ -17,24 +17,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
export
default
function
ActsCreatAppAccountManager
()
{
export
default
function
ActsCreatAppAccountManager
()
{
describe
(
'
ActsCreatAppAccountManager
'
,
function
()
{
describe
(
'
ActsCreatAppAccountManager
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
/*
/*
* @tc.number : ActsCreatAppAccountManager_0100
* @tc.number : ActsCreatAppAccountManager_0100
* @tc.name : createAppAccountManager
* @tc.name : createAppAccountManager
...
...
account/appaccount/actsaccounttest/src/main/js/test/Credential.test.js
浏览文件 @
201b77cf
...
@@ -19,28 +19,6 @@ const TIMEOUT = 5000;
...
@@ -19,28 +19,6 @@ const TIMEOUT = 5000;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
export
default
function
ActsAccountCredential
()
{
export
default
function
ActsAccountCredential
()
{
describe
(
'
ActsAccountCredential
'
,
function
()
{
describe
(
'
ActsAccountCredential
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountCredential_0100
* @tc.number : ActsAccountCredential_0100
...
...
account/appaccount/actsaccounttest/src/main/js/test/DeleteAccount.test.js
浏览文件 @
201b77cf
...
@@ -18,22 +18,6 @@ const NAMELIMIT = 512;
...
@@ -18,22 +18,6 @@ const NAMELIMIT = 512;
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
export
default
function
ActsAccountDeleteAccount
()
{
export
default
function
ActsAccountDeleteAccount
()
{
describe
(
'
ActsAccountDeleteAccount
'
,
function
()
{
describe
(
'
ActsAccountDeleteAccount
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
/*
/*
* @tc.number : ActsAccountDeleteAccount_0100
* @tc.number : ActsAccountDeleteAccount_0100
...
...
account/appaccount/actsaccounttest/src/main/js/test/ExtraInfo.test.js
浏览文件 @
201b77cf
...
@@ -19,28 +19,6 @@ const TIMEOUT = 5000;
...
@@ -19,28 +19,6 @@ const TIMEOUT = 5000;
const
EACHTIMEOUT
=
500
;
const
EACHTIMEOUT
=
500
;
export
default
function
ActsAccountSetGetExtraInfo
()
{
export
default
function
ActsAccountSetGetExtraInfo
()
{
describe
(
'
ActsAccountSetGetExtraInfo
'
,
function
()
{
describe
(
'
ActsAccountSetGetExtraInfo
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountSetGetExtraInfo_0100
* @tc.number : ActsAccountSetGetExtraInfo_0100
...
...
account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
浏览文件 @
201b77cf
...
@@ -19,21 +19,6 @@ const TIMEOUT = 5000;
...
@@ -19,21 +19,6 @@ const TIMEOUT = 5000;
const
ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED
=
4521993
;
const
ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED
=
4521993
;
export
default
function
ActsAccountNoPermission
()
{
export
default
function
ActsAccountNoPermission
()
{
describe
(
'
ActsAccountNoPermission
'
,
function
()
{
describe
(
'
ActsAccountNoPermission
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
/*
/*
* @tc.number : ActsAccountNoPermission_0100
* @tc.number : ActsAccountNoPermission_0100
...
...
account/appaccount/actsaccounttest/src/main/js/test/OAuthToken.test.js
浏览文件 @
201b77cf
...
@@ -29,28 +29,6 @@ const OWNERLENGTHLIMIT = 1024;
...
@@ -29,28 +29,6 @@ const OWNERLENGTHLIMIT = 1024;
const
OWNERSELF
=
"
com.example.actsaccounttest
"
;
const
OWNERSELF
=
"
com.example.actsaccounttest
"
;
export
default
function
ActsAccountOAuthToken
()
{
export
default
function
ActsAccountOAuthToken
()
{
describe
(
'
ActsAccountOAuthToken
'
,
function
()
{
describe
(
'
ActsAccountOAuthToken
'
,
function
()
{
function
sleep
(
delay
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
()
},
delay
)
}).
then
(()
=>
{
console
.
info
(
`sleep #{time} over ...`
)
})
}
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll start====
"
);
await
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
});
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeAll enter====
"
);
await
sleep
(
EACHTIMEOUT
);
done
();
});
/*
/*
* @tc.number : testGetEntriesString101
* @tc.number : testGetEntriesString101
...
...
account/appaccount/actsgetaccountsbyowner/signature/openharmony_sx.p7b
浏览文件 @
201b77cf
无法预览此类型文件
account/appaccount/actsgetaccountsbyowner/src/main/config.json
浏览文件 @
201b77cf
...
@@ -49,6 +49,10 @@
...
@@ -49,6 +49,10 @@
{
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
}
],
],
"abilities"
:
[
"abilities"
:
[
...
...
account/appaccount/actsgetaccountsbyowner/src/main/js/test/Getaccountsbyowner.test.js
浏览文件 @
201b77cf
...
@@ -22,6 +22,16 @@ const SELFBUNDLE = 'com.example.actsgetaccountsbyowner'
...
@@ -22,6 +22,16 @@ const SELFBUNDLE = 'com.example.actsgetaccountsbyowner'
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
const
createAccountOptions
=
{
customData
:{
age
:
'
12
'
}}
export
default
function
GetAccountsByOwner
()
{
export
default
function
GetAccountsByOwner
()
{
describe
(
'
GetAccountsByOwner
'
,
function
()
{
describe
(
'
GetAccountsByOwner
'
,
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 : GetAccountsByOwner_0100
* @tc.number : GetAccountsByOwner_0100
...
@@ -283,10 +293,9 @@ export default function GetAccountsByOwner() {
...
@@ -283,10 +293,9 @@ export default function GetAccountsByOwner() {
done
();
done
();
});
});
}
}
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAccountsByOwner 0900 start====
"
);
console
.
debug
(
"
====>getAccountsByOwner 0900 start====
"
);
appAccountManager
.
getAccountsByOwner
(
SELFBUNDLE
,
getAllCallback
);
appAccountManager
.
getAccountsByOwner
(
SELFBUNDLE
,
getAllCallback
);
},
TIMEOUT
);
});
});
/*
/*
...
@@ -315,31 +324,30 @@ export default function GetAccountsByOwner() {
...
@@ -315,31 +324,30 @@ export default function GetAccountsByOwner() {
},
},
},
},
);
);
setTimeout
(
async
function
(){
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAccountsByOwner 1000 start====
"
);
console
.
debug
(
"
====>getAccountsByOwner 1000 start====
"
);
try
{
try
{
var
data
=
await
appAccountManager
.
getAccountsByOwner
(
SELFBUNDLE
);
var
data
=
await
appAccountManager
.
getAccountsByOwner
(
SELFBUNDLE
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>getAccountsByOwner 1000 fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>getAccountsByOwner 1000 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>getAccountsByOwner 1000 data:
"
+
JSON
.
stringify
(
data
));
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_application_promise
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetaccountsbyowner
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data 1000 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account 1000 start====
"
);
await
appAccountManager
.
removeAccount
(
"
Account_application_promise
"
);
console
.
debug
(
"
====>GetAccountsByOwner_1000 end====
"
);
done
();
done
();
},
TIMEOUT
);
}
console
.
debug
(
"
====>getAccountsByOwner 1000 data:
"
+
JSON
.
stringify
(
data
));
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_application_promise
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetaccountsbyowner
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data 1000 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account 1000 start====
"
);
await
appAccountManager
.
removeAccount
(
"
Account_application_promise
"
);
console
.
debug
(
"
====>GetAccountsByOwner_1000 end====
"
);
done
();
});
});
/*
/*
...
@@ -376,10 +384,9 @@ export default function GetAccountsByOwner() {
...
@@ -376,10 +384,9 @@ export default function GetAccountsByOwner() {
console
.
debug
(
"
====>GetAccountsByOwner_1100 end====
"
);
console
.
debug
(
"
====>GetAccountsByOwner_1100 end====
"
);
done
();
done
();
}
}
setTimeout
(
async
function
(){
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAccountsByOwner 1100 start====
"
);
console
.
debug
(
"
====>getAccountsByOwner 1100 start====
"
);
appAccountManager
.
getAccountsByOwner
(
specifiedBundle
,
getAllCallback
);
appAccountManager
.
getAccountsByOwner
(
specifiedBundle
,
getAllCallback
);
},
TIMEOUT
);
});
});
/*
/*
...
@@ -407,22 +414,21 @@ export default function GetAccountsByOwner() {
...
@@ -407,22 +414,21 @@ export default function GetAccountsByOwner() {
},
},
},
},
);
);
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAccountsByOwner 1200 start====
"
);
console
.
debug
(
"
====>getAccountsByOwner 1200 start====
"
);
try
{
try
{
var
data
=
await
appAccountManager
.
getAccountsByOwner
(
specifiedBundle
);
var
data
=
await
appAccountManager
.
getAccountsByOwner
(
specifiedBundle
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>getAccountsByOwner 1200 fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>getAccountsByOwner 1200 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>getAccountsByOwner 1200 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_name_scene_single
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsscenegetallaccounts
"
);
console
.
debug
(
"
====>GetAccountsByOwner_1200 end====
"
);
done
();
done
();
},
TIMEOUT
);
}
console
.
debug
(
"
====>getAccountsByOwner 1200 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_name_scene_single
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsscenegetallaccounts
"
);
console
.
debug
(
"
====>GetAccountsByOwner_1200 end====
"
);
done
();
});
});
/*
/*
...
...
account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
100755 → 100644
浏览文件 @
201b77cf
...
@@ -20,6 +20,16 @@ const TIMEOUT = 2000;
...
@@ -20,6 +20,16 @@ const TIMEOUT = 2000;
const
LENGTHLIMIT
=
1024
;
const
LENGTHLIMIT
=
1024
;
export
default
function
ActsGetAllAccounts
()
{
export
default
function
ActsGetAllAccounts
()
{
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
...
@@ -286,10 +296,9 @@ export default function ActsGetAllAccounts() {
...
@@ -286,10 +296,9 @@ export default function ActsGetAllAccounts() {
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
);
});
});
/*
/*
...
@@ -319,32 +328,31 @@ export default function ActsGetAllAccounts() {
...
@@ -319,32 +328,31 @@ export default function ActsGetAllAccounts() {
},
},
},
},
);
);
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
);
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>getAllAccounts 1000 fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>getAllAccounts 1000 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>getAllAccounts 1000 data:
"
+
JSON
.
stringify
(
data
));
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_application_promise
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaccounts
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data 1000 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account 1000 start====
"
);
await
appAccountManager
.
deleteAccount
(
"
Account_application_promise
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1000 end====
"
);
done
();
done
();
},
TIMEOUT
);
}
});
console
.
debug
(
"
====>getAllAccounts 1000 data:
"
+
JSON
.
stringify
(
data
));
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_application_promise
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaccounts
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data 1000 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account 1000 start====
"
);
await
appAccountManager
.
deleteAccount
(
"
Account_application_promise
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1000 end====
"
);
done
();
});
/*
/*
* @tc.number : ActsGetAllAccounts_1300
* @tc.number : ActsGetAllAccounts_1300
...
...
account/appaccount/getallaccounts/actsgetallaccountsnoparameter/src/main/js/test/Getallaccounts.test.js
浏览文件 @
201b77cf
...
@@ -20,6 +20,16 @@ const TIMEOUT = 2000;
...
@@ -20,6 +20,16 @@ const TIMEOUT = 2000;
const
SELFBUNDLE
=
'
com.example.getallaccountsnoparameter
'
const
SELFBUNDLE
=
'
com.example.getallaccountsnoparameter
'
export
default
function
ActsGetAllAccountsNoParameter
()
{
export
default
function
ActsGetAllAccountsNoParameter
()
{
describe
(
'
ActsGetAllAccountsNoParameter
'
,
function
()
{
describe
(
'
ActsGetAllAccountsNoParameter
'
,
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 : ActsGetAllAccountsNoParameter_0100
* @tc.number : ActsGetAllAccountsNoParameter_0100
...
@@ -567,34 +577,33 @@ export default function ActsGetAllAccountsNoParameter() {
...
@@ -567,34 +577,33 @@ export default function ActsGetAllAccountsNoParameter() {
},
},
},
},
);
);
setTimeout
(
async
function
(){
await
sleep
(
TIMEOUT
)
console
.
debug
(
"
====>getAllAccounts 1100 start====
"
);
console
.
debug
(
"
====>getAllAccounts 1100 start====
"
);
try
{
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
();
var
data
=
await
appAccountManager
.
getAllAccounts
();
}
}
catch
(
err
){
catch
(
err
){
console
.
error
(
"
====>getAllAccounts 1100 fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>getAllAccounts 1100 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>getAllAccounts 1100 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
length
).
assertEqual
(
2
);
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_name_scene_single
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccountsceneaccessible
"
);
expect
(
data
[
1
].
name
).
assertEqual
(
"
accessibleAccount_this_application
"
);
expect
(
data
[
1
].
owner
).
assertEqual
(
"
com.example.getallaccountsnoparameter
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data 1100 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account 1100 start====
"
);
await
appAccountManager
.
removeAccount
(
"
accessibleAccount_this_application
"
);
console
.
debug
(
"
====>ActsGetAllAccountsNoParameter_1100 end====
"
);
done
();
done
();
},
TIMEOUT
);
}
console
.
debug
(
"
====>getAllAccounts 1100 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
length
).
assertEqual
(
2
);
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_name_scene_single
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccountsceneaccessible
"
);
expect
(
data
[
1
].
name
).
assertEqual
(
"
accessibleAccount_this_application
"
);
expect
(
data
[
1
].
owner
).
assertEqual
(
"
com.example.getallaccountsnoparameter
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data 1100 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account 1100 start====
"
);
await
appAccountManager
.
removeAccount
(
"
accessibleAccount_this_application
"
);
console
.
debug
(
"
====>ActsGetAllAccountsNoParameter_1100 end====
"
);
done
();
});
});
})
})
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录