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

!1887 Change signture and add limit test

Merge pull request !1887 from 高曦/master_account_0211
......@@ -35,7 +35,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
this.timeout = 8000;
this.timeout = 30000;
configService.setConfig(this)
require('../../../test/List.test')
......
......@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR = 4587574;
const ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR = 4587571;
describe('ActsOsAccountSystemTest', function () {
/*
......@@ -161,7 +161,6 @@ describe('ActsOsAccountSystemTest', function () {
var isActiveHandred = await osAccountManager.isOsAccountActived(100);
console.debug("====>localId: 100 isOsAccountActived:" + isActiveHandred);
expect(isActiveHandred).assertFalse();
await osAccountManager.activateOsAccount(100);
await osAccountManager.removeOsAccount(osLocalId);
console.debug("====>ActsOsAccountActivate_0400 end====");
done();
......
......@@ -15,10 +15,10 @@
import osaccount from '@ohos.account.osaccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const ERR_OS_ACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR = 4587526;
const ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR = 4587532;
const ERR_OSACCOUNT_KIT_LOCAL_NAME_EMPTY_ERROR = 4587581;
const ERR_OSACCOUNT_KIT_CANNOT_DELETE_ID_ERROR = 4587584;
const ERR_OS_ACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR = 4587523;
const ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR = 4587529;
const ERR_OSACCOUNT_KIT_LOCAL_NAME_EMPTY_ERROR = 4587578;
const ERR_OSACCOUNT_KIT_CANNOT_DELETE_ID_ERROR = 4587581;
describe('ActsOsAccountSystemTest', function () {
/*
......@@ -605,6 +605,7 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>second createOsAccount OsAccountInfo:" + JSON.stringify(accountInfoSec));
var localIdSec = accountInfoSec.localId;
var serialNumSec = accountInfoSec.serialNumber;
await osAccountManager.removeOsAccount(localIdSec);
console.debug("====>first create localId: " + localIdFir + " second create localId: " + localIdSec);
console.debug("====>first create serialNumber: " + serialNumFir + " second serialNumber: " + serialNumSec);
expect(localIdFir).assertEqual(localIdSec);
......
......@@ -19,3 +19,4 @@ require('./Set.test.js')
require('./Constraints.test.js')
require('./Photo.test.js')
require('./Create.test.js')
require('./Limit.test.js')
\ No newline at end of file
......@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osaccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587558;
const ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587555;
describe('ActsOsAccountSystemTest', function () {
/*
......
......@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const TIMEOUT = 1000;
const OSACCOUNTMAXNUMBER = 999;
const ERR_OSACCOUNT_KIT_QUERY_OS_ACCOUNT_BY_ID_ERROR = 4587556;
const ERR_OSACCOUNT_KIT_QUERY_OS_ACCOUNT_BY_ID_ERROR = 4587553;
describe('ActsOsAccountSystemTest', function () {
/*
......@@ -377,7 +377,7 @@ describe('ActsOsAccountSystemTest', function () {
/*
* @tc.number : ActsOsAccountQuery_1600
* @tc.name : queryMaxOsAccountNumber callback
* @tc.name : queryMaxOsAccountNumber promise
* @tc.desc : Query the maximum number of users that can be created on the device
*/
it('ActsOsAccountQuery_1600', 0, async function (done) {
......@@ -404,12 +404,12 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err));
console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data));
expect(err.code).assertEqual(0);
expect(data.localId).assertEqual(0);
expect(data.localId).assertEqual(100);
expect(data.type.ADMIN).assertEqual(0);
var serialNumberStr = data.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000000");
expect(serialIntercept).assertEqual("00000001");
expect(data.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountQuery_1700 end====");
done();
......@@ -427,12 +427,12 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>get os AccountManager finish====");
var data = await AccountManager.queryCurrentOsAccount();
console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data));
expect(data.localId).assertEqual(0);
expect(data.localId).assertEqual(100);
expect(data.type.ADMIN).assertEqual(0);
var serialNumberStr = data.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000000");
expect(serialIntercept).assertEqual("00000001");
expect(data.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountQuery_1800 end====");
done();
......@@ -462,7 +462,7 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err));
console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(currentOsInfo));
expect(err.code).assertEqual(0);
expect(currentOsInfo.localId).assertEqual(0);
expect(currentOsInfo.localId).assertEqual(100);
AccountManager.removeOsAccount(createLocalId, (err)=>{
console.debug("====>remove localId: " + createLocalId + " err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
......@@ -491,7 +491,7 @@ describe('ActsOsAccountSystemTest', function () {
await AccountManager.activateOsAccount(createLocalId);
var currentOsInfo = await AccountManager.queryCurrentOsAccount();
console.debug("====>queryCurrentOsAccount:" + JSON.stringify(currentOsInfo));
expect(currentOsInfo.localId).assertEqual(0);
expect(currentOsInfo.localId).assertEqual(100);
await AccountManager.removeOsAccount(createLocalId);
console.debug("====>ActsOsAccountQuery_2000 end====");
done();
......
......@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_NAME_ERROR = 4587564;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587566;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_NAME_ERROR = 4587561;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587563;
describe('ActsOsAccountSystemTest', function () {
/*
......
......@@ -35,7 +35,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
this.timeout = 8000;
this.timeout = 15000;
configService.setConfig(this)
require('../../../test/List.test')
......
......@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import bundle from '@ohos.bundle'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERROR = 4587551;
const ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR = 4653057;
describe('ActsOsAccountThirdPartyTest', function () {
/*
......@@ -36,7 +36,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(0);
expect(localId).assertEqual(0);
expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormUid_0100 end====");
done();
});
......@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>obtained uid:" + uid);
var localId = await osAccountManager.getOsAccountLocalIdFromUid(uid);
console.debug("====>localId obtained by uid:" + localId);
expect(localId).assertEqual(0);
expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormUid_0200 end====");
done();
});
......@@ -75,7 +75,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
osAccountManager.getOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERROR);
expect(err.code).assertEqual(ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR);
expect(localId).assertEqual(0);
console.debug("====>ActsOsAccountGetIdFormUid_0300 end====");
done();
......@@ -96,7 +96,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
await osAccountManager.getOsAccountLocalIdFromUid(incorrectUid);
}catch(err){
console.debug("====>get localId by uid err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERROR);
expect(err.code).assertEqual(ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR);
console.debug("====>ActsOsAccountGetIdFormUid_0400 end====");
done();
}
......@@ -115,7 +115,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
osAccountManager.getOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERROR);
expect(err.code).assertEqual(ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR);
expect(localId).assertEqual(0);
console.debug("====>ActsOsAccountGetIdFormUid_0500 end====");
done();
......@@ -136,7 +136,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
await osAccountManager.getOsAccountLocalIdFromUid(incorrectUid);
}catch(err){
console.debug("====>get localId by uid err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERROR);
expect(err.code).assertEqual(ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR);
console.debug("====>ActsOsAccountGetIdFormUid_0600 end====");
done();
}
......@@ -155,7 +155,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by process:" + localId);
expect(err.code).assertEqual(0);
expect(localId).assertEqual(0);
expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormProcess_0100 end====");
done();
});
......@@ -172,7 +172,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>get AccountManager finish====");
var localId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>localId obtained by process:" + localId);
expect(localId).assertEqual(0);
expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormProcess_0200 end====");
done();
});
......
......@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR = 4587545;
const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR = 4587548;
const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR = 4587542;
const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR = 4587545;
describe('ActsOsAccountThirdPartyTest', function () {
/*
......@@ -33,7 +33,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId deviceId:" + deviceId);
expect(err.code).assertEqual(0);
expect(deviceId).assertEqual("0");
expect(deviceId).assertEqual("");
console.debug("====>ActsOsAccountDeviceId_0100 end====");
done();
})
......@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
done();
}
console.debug("====>getDistributedVirtualDeviceId:" + deviceId);
expect(deviceId).assertEqual("0");
expect(deviceId).assertEqual("");
console.debug("====>ActsOsAccountDeviceId_0200 end====");
done();
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册