未验证 提交 ea6e72ee 编写于 作者: O openharmony_ci 提交者: Gitee

!5117 【账号】XTS冻结适配,NoPermission_0700

Merge pull request !5117 from 何海涛/0823_0616_unavailiable
......@@ -198,7 +198,8 @@ export default function ActsAccountNoPermission() {
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 0700 err:" + JSON.stringify(err));
expect(err.code).assertEqual(account.ResultCode.ERROR_PERMISSION_DENIED);
expect(err).assertEqual(null);
expect(data.length>0).assertEqual(true);
appAccountManager.deleteAccount("getAll_callback_nopermission", (err)=>{
console.debug("====>delete account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
......
......@@ -30,7 +30,11 @@ export default function ActsAccountChangeOnOff() {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
beforeAll(async function (done) {
done();
});
async function testInit(){
console.debug("====>startAbility start====");
await featureAbility.startAbility(
{
......@@ -46,8 +50,7 @@ export default function ActsAccountChangeOnOff() {
},
);
await sleep(TIMEOUT);
done();
});
}
/*
* @tc.number : ActsAccountChangeOnOff_0100
......@@ -56,6 +59,7 @@ export default function ActsAccountChangeOnOff() {
* the additional information
*/
it('ActsAccountChangeOnOff_0100', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0100 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......@@ -124,6 +128,7 @@ export default function ActsAccountChangeOnOff() {
* the associatal data
*/
it('ActsAccountChangeOnOff_0200', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0200 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......@@ -187,6 +192,7 @@ export default function ActsAccountChangeOnOff() {
* the credential
*/
it('ActsAccountChangeOnOff_0300', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0300 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......@@ -250,6 +256,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
*/
it('ActsAccountChangeOnOff_0400', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0400 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......@@ -317,6 +324,7 @@ export default function ActsAccountChangeOnOff() {
* the only authorized account
*/
it('ActsAccountChangeOnOff_0500', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0500 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......@@ -325,7 +333,7 @@ export default function ActsAccountChangeOnOff() {
console.debug("====>enableAppAccess ActsAccountChangeOnOff_0500 start");
await appAccountManager.enableAppAccess("onoff_delete", "com.example.actsaccountsceneonoff");
function unSubscriberCallback(err){
console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
}
function subscriberCallback(err, data){
console.debug("====>subscriberCallback 0500 data:" + JSON.stringify(data));
......@@ -375,6 +383,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
*/
it('ActsAccountChangeOnOff_0600', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0600 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......@@ -446,6 +455,7 @@ export default function ActsAccountChangeOnOff() {
* the only authorized account
*/
it('ActsAccountChangeOnOff_0700', 0, async function (done) {
testInit();
console.debug("====>ActsAccountChangeOnOff_0700 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
......
......@@ -459,6 +459,8 @@ export default function ActsGetAllAccounts() {
var nonexistentBundle = "com.example.actsgetallaccountsnonexistent";
try{
var data = await appAccountManager.getAllAccounts(nonexistentBundle);
expect().assertFail();
done();
}
catch(err){
console.debug("====>getAllAccounts 1400 err:" + JSON.stringify(err));
......
......@@ -14,6 +14,7 @@
*/
import account from '@ohos.account.appAccount'
import commonevent from '@ohos.commonEvent'
import featureAbility from '@ohos.ability.featureAbility'
const ACCOUNT_TEST_ONOFF_EXTRA = 1
const ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA = 2
......@@ -46,6 +47,7 @@ export default {
appAccountManager.off('change', function (){
console.debug("====>scene off finish====");
});
featureAbility.terminateSelf()
}
// Subscribe to the callback of account information changes, verify the received account information, and send
......
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import account from '@ohos.account.appAccount'
import featureAbility from '@ohos.ability.featureAbility'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
......@@ -33,6 +34,7 @@ export default {
console.debug("====>add account scene err:" + JSON.stringify(err));
appAccountManager.enableAppAccess("account_name_scene_single", enableBundle, (err)=>{
console.debug("====>enableAppAccess scene err:" + JSON.stringify(err));
featureAbility.terminateSelf()
});
});
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册