未验证 提交 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 { ...@@ -35,7 +35,7 @@ export default {
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
this.timeout = 8000; this.timeout = 30000;
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
......
...@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount' ...@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000; const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR = 4587574; const ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR = 4587571;
describe('ActsOsAccountSystemTest', function () { describe('ActsOsAccountSystemTest', function () {
/* /*
...@@ -161,7 +161,6 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -161,7 +161,6 @@ describe('ActsOsAccountSystemTest', function () {
var isActiveHandred = await osAccountManager.isOsAccountActived(100); var isActiveHandred = await osAccountManager.isOsAccountActived(100);
console.debug("====>localId: 100 isOsAccountActived:" + isActiveHandred); console.debug("====>localId: 100 isOsAccountActived:" + isActiveHandred);
expect(isActiveHandred).assertFalse(); expect(isActiveHandred).assertFalse();
await osAccountManager.activateOsAccount(100);
await osAccountManager.removeOsAccount(osLocalId); await osAccountManager.removeOsAccount(osLocalId);
console.debug("====>ActsOsAccountActivate_0400 end===="); console.debug("====>ActsOsAccountActivate_0400 end====");
done(); done();
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
import osaccount from '@ohos.account.osaccount' import osaccount from '@ohos.account.osaccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const ERR_OS_ACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR = 4587526; const ERR_OS_ACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR = 4587523;
const ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR = 4587532; const ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR = 4587529;
const ERR_OSACCOUNT_KIT_LOCAL_NAME_EMPTY_ERROR = 4587581; const ERR_OSACCOUNT_KIT_LOCAL_NAME_EMPTY_ERROR = 4587578;
const ERR_OSACCOUNT_KIT_CANNOT_DELETE_ID_ERROR = 4587584; const ERR_OSACCOUNT_KIT_CANNOT_DELETE_ID_ERROR = 4587581;
describe('ActsOsAccountSystemTest', function () { describe('ActsOsAccountSystemTest', function () {
/* /*
...@@ -605,6 +605,7 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -605,6 +605,7 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>second createOsAccount OsAccountInfo:" + JSON.stringify(accountInfoSec)); console.debug("====>second createOsAccount OsAccountInfo:" + JSON.stringify(accountInfoSec));
var localIdSec = accountInfoSec.localId; var localIdSec = accountInfoSec.localId;
var serialNumSec = accountInfoSec.serialNumber; var serialNumSec = accountInfoSec.serialNumber;
await osAccountManager.removeOsAccount(localIdSec);
console.debug("====>first create localId: " + localIdFir + " second create localId: " + localIdSec); console.debug("====>first create localId: " + localIdFir + " second create localId: " + localIdSec);
console.debug("====>first create serialNumber: " + serialNumFir + " second serialNumber: " + serialNumSec); console.debug("====>first create serialNumber: " + serialNumFir + " second serialNumber: " + serialNumSec);
expect(localIdFir).assertEqual(localIdSec); expect(localIdFir).assertEqual(localIdSec);
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import osaccount from '@ohos.account.osaccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const NAMELIMIT = 1024;
const TIMEOUT = 1000;
const EACHTIMEOUT = 3000;
const ERR_OSACCOUNT_KIT_LOCAL_NAME_OUTFLOW_ERROR = 4587577;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587563;
describe('ActsOsAccountSystemTest', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
beforeEach(async function (done) {
console.debug("====>beforeEach enter====");
sleep(EACHTIMEOUT);
done();
})
/*
* @tc.number : ActsOsAccountLimit_0100
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name exceeds the length limit of 1024 characters
*/
it('ActsOsAccountLimit_0100', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0100 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT + 1; i++){
nameLimit += 't';
}
var localId;
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
function onCallback(receiveLocalId){
console.debug("====>receive localId:" + receiveLocalId);
if(receiveLocalId == localId){
console.debug("====> wrongly received localId:" + localId + "after unsubscribing");
expect().assertFail();
done();
}
}
osAccountManager.on("activating", nameLimit, onCallback);
sleep(TIMEOUT);
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err,info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
localId = info.localId;
osAccountManager.activateOsAccount(localId, (err)=>{
console.debug("====>activateOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
sleep(TIMEOUT);
setTimeout(()=>{
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>remove localId" + localId + " err:" +JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_0100 end====");
done();
})
}, TIMEOUT)
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0200
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name exceeds the length limit of 1024 characters
*/
it('ActsOsAccountLimit_0200', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0200 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT + 1; i++){
nameLimit += 't';
}
var localId;
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
function onCallback(receiveLocalId){
console.debug("====>receive localId:" + receiveLocalId);
if(receiveLocalId == localId){
console.debug("====> wrongly received localId:" + localId + "after unsubscribing");
expect().assertFail();
done();
}
}
osAccountManager.on("activate", nameLimit, onCallback);
sleep(TIMEOUT);
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err,info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
localId = info.localId;
osAccountManager.activateOsAccount(localId, (err)=>{
console.debug("====>activateOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
sleep(TIMEOUT);
setTimeout(()=>{
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" +JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_0200 end====");
done();
})
}, TIMEOUT)
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0300
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name length is 1024 characters
*/
it('ActsOsAccountLimit_0300', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0300 start====");
var osAccountManager = osaccount.getAccountManager();
var localId;
var activatingSign = false;
var nameLimit = "";
for(var i = 0; i < NAMELIMIT; i++){
nameLimit += 't';
}
console.debug("====>get AccountManager finish====");
function onCallback(receiveLocalId){
console.debug("====>receive localId:" + receiveLocalId);
if(receiveLocalId == localId){
osAccountManager.off("activating", nameLimit, offCallback);
}
}
function onActivateCallback(receiveId){
console.debug("====>onActivateCallback receive localId:" + receiveId);
if(receiveId == localId){
osAccountManager.off("activate", nameLimit, offActivateCallback);
}
}
function removeCallback(err){
console.debug("====>remove localId: " + localId + " err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>the activating sign is: " + activatingSign);
expect(activatingSign).assertTrue();
console.debug("====>ActsOsAccountLimit_0300 end====");
done();
}
function offCallback(){
console.debug("====>off enter")
activatingSign = true;
}
function offActivateCallback(){
console.debug("====>offActivateCallback enter")
sleep(TIMEOUT);
osAccountManager.removeOsAccount(localId, removeCallback);
}
console.debug("====>on activating start====");
osAccountManager.on("activating", nameLimit, onCallback);
console.debug("====>on activate start====");
osAccountManager.on("activate", nameLimit, onActivateCallback);
sleep(TIMEOUT);
osAccountManager.createOsAccount("osAccountNameA", 1, (err, osAccountInfo)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount osAccountInfo:" + JSON.stringify(osAccountInfo));
localId = osAccountInfo.localId;
expect(err.code).assertEqual(0);
expect(osAccountInfo.localName).assertEqual("osAccountNameA");
osAccountManager.activateOsAccount(localId, (err)=>{
console.debug("====>activateOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
});
});
});
/*
* @tc.number : ActsOsAccountLimit_0400
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name length is 1024 characters
*/
it('ActsOsAccountLimit_0400', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0400 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT; i++){
nameLimit += 't';
}
var localId;
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
function onCallback(receiveLocalId){
console.debug("====>on receive localId:" + receiveLocalId);
if(receiveLocalId == localId){
osAccountManager.off("activate", nameLimit, offCallback);
}
}
function offCallback(receiveLocalId){
console.debug("====>off receive localId:" +receiveLocalId);
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" +JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_0400 end====");
done();
})
}
osAccountManager.on("activate", nameLimit, onCallback);
sleep(TIMEOUT);
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err,info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
localId = info.localId;
osAccountManager.activateOsAccount(localId, (err)=>{
console.debug("====>activateOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0500
* @tc.name : setOsAccountName callback
* @tc.desc : create name length is 1024 characters
*/
it('ActsOsAccountLimit_0500', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0500 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT + 1; i++){
nameLimit += 't';
}
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
osAccountManager.setOsAccountName(localId, nameLimit, (err)=>{
console.debug("====>setOsAccountName err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_LOCAL_NAME_OUTFLOW_ERROR);
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount " + localId + " err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_0500 end====");
done();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0600
* @tc.name : setOsAccountName promise
* @tc.desc : create name length is 1024 characters
*/
it('ActsOsAccountLimit_0600', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0600 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT + 1; i++){
nameLimit += 't';
}
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var info = await osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" +JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
try{
await osAccountManager.setOsAccountName(localId, nameLimit);
console.debug("====>setOsAccountName finish====");
}
catch(err){
console.debug("====>setOsAccountName err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_LOCAL_NAME_OUTFLOW_ERROR);
await osAccountManager.removeOsAccount(localId);
console.debug("====>removeOsAccount " + localId +" finish");
console.debug("====>ActsOsAccountLimit_0600 end====");
done();
}
});
/*
* @tc.number : ActsOsAccountLimit_0700
* @tc.name : setOsAccountName callback
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it('ActsOsAccountLimit_0700', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0700 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT; i++){
nameLimit += 't';
}
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
osAccountManager.setOsAccountName(localId, nameLimit, (err)=>{
console.debug("====>setOsAccountName err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount " + localId + " err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_0700 end====");
done();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0800
* @tc.name : setOsAccountName promise
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it('ActsOsAccountLimit_0800', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0800 start====");
var nameLimit = "";
for(var i = 0; i < NAMELIMIT; i++){
nameLimit += 't';
}
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var info = await osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" +JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
try{
await osAccountManager.setOsAccountName(localId, nameLimit);
}
catch(err){
console.debug("====>setOsAccountName err:" +JSON.stringify(err));
expect().assertFail();
done();
}
await osAccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountLimit_0800 end====");
done();
});
/*
* @tc.number : ActsOsAccountLimit_0900
* @tc.name : setOsAccountProfilePhoto callback
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it('ActsOsAccountLimit_0900', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_0900 start====");
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var photo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA8AAAAIcCAIAAAC2P1AsAAAAAXNSR0IArs4c6QAAAARnQU1BAA"+
"Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAx6SURBVHhe7d0hbFR3HMDxY4rKSkggWTMQLMEUtYppqgZiCZYlrSwJDk3mlrQSBJZkYq"+
"gVgV1RrZmogVRAAvJk67rr9VoqVug3Gekon08vef/33tV/88/v3ju3vrs+OMbble9v3dte2d2ae33x7pULf08uH1jYWn803F+Ov3n+9urGgy"+
"vjbx659TnMjv4AAOA0fDM5nsD15c313Y3xZ+v25Nq+qb9+Pz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"+
"gENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENA"+
"AABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABA"+
"IaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAA"+
"ACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ"+
"0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAI"+
"GABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABg"+
"CAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQE"+
"ADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAAnNhg8A/kgOxh0ol1ZgAAAABJRU"+
"5ErkJggg=="
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
osAccountManager.setOsAccountProfilePhoto(localId, photo, (err)=>{
console.debug("====>setOsAccountProfilePhoto err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR);
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_0900 end====");
done();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_1000
* @tc.name : setOsAccountProfilePhoto promise
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it('ActsOsAccountLimit_1000', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_1000 start====");
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var photo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA8AAAAIcCAIAAAC2P1AsAAAAAXNSR0IArs4c6QAAAARnQU1BAA"+
"Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAx6SURBVHhe7d0hbFR3HMDxY4rKSkggWTMQLMEUtYppqgZiCZYlrSwJDk3mlrQSBJZkYq"+
"gVgV1RrZmogVRAAvJk67rr9VoqVug3Gekon08vef/33tV/88/v3ju3vrs+OMbble9v3dte2d2ae33x7pULf08uH1jYWn803F+Ov3n+9urGgy"+
"vjbx659TnMjv4AAOA0fDM5nsD15c313Y3xZ+v25Nq+qb9+Pz8YDH+8OXj75/Sos2//9BnrGQAATtGxO9Bri7NLj/eXO/dXhy/mj9+Bfj5zY3"+
"56fLrzdO7aby/Hd4/64f2ztXeXJif/ATvQAACclpONcEwu/Kup/Wi+vrz55OqFG/NTk9r+nFMcAhoAgNNyohGOtcXZG+f2PzNrz2cO1rO/Ph"+
"9F9szBlvP5pw+nBwvv7lzZPwUAgDPokwE9vTR38c3ouLC1vnq4ozxcORiDfrN5fnwcDDanX7wcrhzuOj8+7OyZtcklAAD44n16B/r6z8PLo8"+
"MoiOen96/sVfW5mT/Gq8vXhveXx9F87f2To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AABAIaAA"+
"ACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ"+
"0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAI"+
"GABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABg"+
"CAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQE"+
"ADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAAnNhg8A/kgOxh0ol1ZgAAAABJRU"+
"5ErkJggg=="
var info = await osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" +JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
try{
await osAccountManager.setOsAccountProfilePhoto(localId, photo);
}
catch(err){
console.debug("====>setOsAccountProfilePhoto err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR);
await osAccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountLimit_1000 end====");
done();
}
});
/*
* @tc.number : ActsOsAccountLimit_1100
* @tc.name : setOsAccountProfilePhoto callback
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it('ActsOsAccountLimit_1100', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_1100 start====");
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var photo = "data:image/jpeg;base64,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TQM1EO6eSn0AAAAASUVORK5CYII="
osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL, (err, info)=>{
console.debug("====>createOsAccount err:" + JSON.stringify(err));
console.debug("====>createOsAccount info:" + JSON.stringify(info));
expect(err.code).assertEqual(0);
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
osAccountManager.setOsAccountProfilePhoto(localId, photo, (err)=>{
console.debug("====>setOsAccountProfilePhoto err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR);
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>removeOsAccount err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
console.debug("====>ActsOsAccountLimit_1100 end====");
done();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_1200
* @tc.name : setOsAccountProfilePhoto promise
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it('ActsOsAccountLimit_1200', 0, async function (done) {
console.debug("====>ActsOsAccountLimit_1200 start====");
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var photo = "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAdCAYAAADl208VAAAAAXNSR0IArs4c6QAAAARnQU1BA"+
"ACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAvESURBVFhH3Zb3c1TXGYbzD6RMJplEfdV2tasuVFZo1VcNUEMCgSTTJCDIVNOMQYApN"+
"sYIMMR2gBhsmWabJjAgejPIpphibKoNMUUINVRX2l3pyXcFyLuJ4yQz+cXRzDvac+7ee9/nvN/5zv5C/vg/049O/pz1z5MPbt2i8cF9mqqra"+
"X38mPa6Okz19XQ2NmB+0oi1uclOlpYmutpa/qW621t79FNzz8dP536Yt7Y2975HebfiQVFHQwPt9XW01dZy59o3tv7tYRQ1VT8UkBpaa2t6b"+
"upoqO952HPZwlhbmntf/oOemxLZGP1vpNzXCybvsMqiWeR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
"cnUGxienM2YAYMZGOZPbog72ZJAhiSXIsnFS7JZkurICGdpAh68luLFoiQvVg1Qsynflwoxcnjpq1z+9BhXD1bx5baD7JoykHXZv2VTwe84O"+
"T1SoJ24tDSES++msbe0H1vGR1NeHMp7w0IoHx3JRxMMrBkWxdIcPTOTgiiRDjoqUm3r3x5GkV7KRi9AUdLBkkPCSO2jJ9bXh2TlrNF5S7vWS"+
"gv3IrePJxmSUrJ0OKO0a6McyAXhfowLd2OytOwCgR0gjWRmvBfluRq25IVS+cYSzu88yoXdJzn3ySE+nTed1QMc2FjoxoGXotk/ypX9k4LZN"+
"l4vGz+ClYN0lOW6SyIevJ7lxfLBapZkaJhl1DAuWs0IvRf5oe62/u1hFEVIySiKkq6VHBhCqkDF+niSoBaDcg4ZpTFEe8s5JGaTtbKPvFwY4"+
"OchzcKRNIHI0v2B3ABHsgNcGBLkzPwET9ZnqXlvYBgVi5dwemslVduOcHLjAQ6veIdVGTo+Kg7i7OJhfFooLXmolnWFAazM8aMsJ4DlAvVau"+
"hdzUj1ZIJ1tkSQ+Jc5DYDwYKL9gsqTx2Pi3h/k/0I9O/pz1o5M/Z/3o5M9Uv+DvTQM1EO6eSn0AAAAASUVORK5CYII="
var info = await osAccountManager.createOsAccount("aaa", osaccount.OsAccountType.NORMAL);
console.debug("====>createOsAccount info:" +JSON.stringify(info));
expect(info.localName).assertEqual("aaa");
var localId = info.localId;
try{
await osAccountManager.setOsAccountProfilePhoto(localId, photo);
}
catch(err){
console.debug("====>setOsAccountProfilePhoto err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR);
await osAccountManager.removeOsAccount(localId);
console.debug("====>ActsOsAccountLimit_1200 end====");
done();
}
});
})
\ No newline at end of file
...@@ -18,4 +18,5 @@ require('./OnOff.test.js') ...@@ -18,4 +18,5 @@ require('./OnOff.test.js')
require('./Set.test.js') require('./Set.test.js')
require('./Constraints.test.js') require('./Constraints.test.js')
require('./Photo.test.js') require('./Photo.test.js')
require('./Create.test.js') require('./Create.test.js')
\ No newline at end of file require('./Limit.test.js')
\ No newline at end of file
...@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osaccount' ...@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osaccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000; 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 () { describe('ActsOsAccountSystemTest', function () {
/* /*
......
...@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' ...@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const TIMEOUT = 1000; const TIMEOUT = 1000;
const OSACCOUNTMAXNUMBER = 999; 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 () { describe('ActsOsAccountSystemTest', function () {
/* /*
...@@ -377,7 +377,7 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -377,7 +377,7 @@ describe('ActsOsAccountSystemTest', function () {
/* /*
* @tc.number : ActsOsAccountQuery_1600 * @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 * @tc.desc : Query the maximum number of users that can be created on the device
*/ */
it('ActsOsAccountQuery_1600', 0, async function (done) { it('ActsOsAccountQuery_1600', 0, async function (done) {
...@@ -404,12 +404,12 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -404,12 +404,12 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err)); console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err));
console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data)); console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data));
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(data.localId).assertEqual(0); expect(data.localId).assertEqual(100);
expect(data.type.ADMIN).assertEqual(0); expect(data.type.ADMIN).assertEqual(0);
var serialNumberStr = data.serialNumber.toString(); var serialNumberStr = data.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8); var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept); console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000000"); expect(serialIntercept).assertEqual("00000001");
expect(data.isCreateCompleted).assertTrue(); expect(data.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountQuery_1700 end===="); console.debug("====>ActsOsAccountQuery_1700 end====");
done(); done();
...@@ -427,12 +427,12 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -427,12 +427,12 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
var data = await AccountManager.queryCurrentOsAccount(); var data = await AccountManager.queryCurrentOsAccount();
console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data)); console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data));
expect(data.localId).assertEqual(0); expect(data.localId).assertEqual(100);
expect(data.type.ADMIN).assertEqual(0); expect(data.type.ADMIN).assertEqual(0);
var serialNumberStr = data.serialNumber.toString(); var serialNumberStr = data.serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8); var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept); console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000000"); expect(serialIntercept).assertEqual("00000001");
expect(data.isCreateCompleted).assertTrue(); expect(data.isCreateCompleted).assertTrue();
console.debug("====>ActsOsAccountQuery_1800 end===="); console.debug("====>ActsOsAccountQuery_1800 end====");
done(); done();
...@@ -462,7 +462,7 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -462,7 +462,7 @@ describe('ActsOsAccountSystemTest', function () {
console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err)); console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err));
console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(currentOsInfo)); console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(currentOsInfo));
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(currentOsInfo.localId).assertEqual(0); expect(currentOsInfo.localId).assertEqual(100);
AccountManager.removeOsAccount(createLocalId, (err)=>{ AccountManager.removeOsAccount(createLocalId, (err)=>{
console.debug("====>remove localId: " + createLocalId + " err:" + JSON.stringify(err)); console.debug("====>remove localId: " + createLocalId + " err:" + JSON.stringify(err));
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
...@@ -491,7 +491,7 @@ describe('ActsOsAccountSystemTest', function () { ...@@ -491,7 +491,7 @@ describe('ActsOsAccountSystemTest', function () {
await AccountManager.activateOsAccount(createLocalId); await AccountManager.activateOsAccount(createLocalId);
var currentOsInfo = await AccountManager.queryCurrentOsAccount(); var currentOsInfo = await AccountManager.queryCurrentOsAccount();
console.debug("====>queryCurrentOsAccount:" + JSON.stringify(currentOsInfo)); console.debug("====>queryCurrentOsAccount:" + JSON.stringify(currentOsInfo));
expect(currentOsInfo.localId).assertEqual(0); expect(currentOsInfo.localId).assertEqual(100);
await AccountManager.removeOsAccount(createLocalId); await AccountManager.removeOsAccount(createLocalId);
console.debug("====>ActsOsAccountQuery_2000 end===="); console.debug("====>ActsOsAccountQuery_2000 end====");
done(); done();
......
...@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount' ...@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000; const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_NAME_ERROR = 4587564; const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_NAME_ERROR = 4587561;
const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587566; const ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR = 4587563;
describe('ActsOsAccountSystemTest', function () { describe('ActsOsAccountSystemTest', function () {
/* /*
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
this.timeout = 8000; this.timeout = 15000;
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
......
...@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount' ...@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import bundle from '@ohos.bundle' import bundle from '@ohos.bundle'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' 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 () { describe('ActsOsAccountThirdPartyTest', function () {
/* /*
...@@ -36,7 +36,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -36,7 +36,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId); console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(localId).assertEqual(0); expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormUid_0100 end===="); console.debug("====>ActsOsAccountGetIdFormUid_0100 end====");
done(); done();
}); });
...@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>obtained uid:" + uid); console.debug("====>obtained uid:" + uid);
var localId = await osAccountManager.getOsAccountLocalIdFromUid(uid); var localId = await osAccountManager.getOsAccountLocalIdFromUid(uid);
console.debug("====>localId obtained by uid:" + localId); console.debug("====>localId obtained by uid:" + localId);
expect(localId).assertEqual(0); expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormUid_0200 end===="); console.debug("====>ActsOsAccountGetIdFormUid_0200 end====");
done(); done();
}); });
...@@ -75,7 +75,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -75,7 +75,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
osAccountManager.getOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{ osAccountManager.getOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId); 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); expect(localId).assertEqual(0);
console.debug("====>ActsOsAccountGetIdFormUid_0300 end===="); console.debug("====>ActsOsAccountGetIdFormUid_0300 end====");
done(); done();
...@@ -96,7 +96,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -96,7 +96,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
await osAccountManager.getOsAccountLocalIdFromUid(incorrectUid); await osAccountManager.getOsAccountLocalIdFromUid(incorrectUid);
}catch(err){ }catch(err){
console.debug("====>get localId by uid err:" +JSON.stringify(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===="); console.debug("====>ActsOsAccountGetIdFormUid_0400 end====");
done(); done();
} }
...@@ -115,7 +115,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -115,7 +115,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
osAccountManager.getOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{ osAccountManager.getOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId); 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); expect(localId).assertEqual(0);
console.debug("====>ActsOsAccountGetIdFormUid_0500 end===="); console.debug("====>ActsOsAccountGetIdFormUid_0500 end====");
done(); done();
...@@ -136,7 +136,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -136,7 +136,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
await osAccountManager.getOsAccountLocalIdFromUid(incorrectUid); await osAccountManager.getOsAccountLocalIdFromUid(incorrectUid);
}catch(err){ }catch(err){
console.debug("====>get localId by uid err:" +JSON.stringify(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===="); console.debug("====>ActsOsAccountGetIdFormUid_0600 end====");
done(); done();
} }
...@@ -155,7 +155,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -155,7 +155,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by process:" + localId); console.debug("====>localId obtained by process:" + localId);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(localId).assertEqual(0); expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormProcess_0100 end===="); console.debug("====>ActsOsAccountGetIdFormProcess_0100 end====");
done(); done();
}); });
...@@ -172,7 +172,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -172,7 +172,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var localId = await osAccountManager.getOsAccountLocalIdFromProcess(); var localId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>localId obtained by process:" + localId); console.debug("====>localId obtained by process:" + localId);
expect(localId).assertEqual(0); expect(localId).assertEqual(100);
console.debug("====>ActsOsAccountGetIdFormProcess_0200 end===="); console.debug("====>ActsOsAccountGetIdFormProcess_0200 end====");
done(); done();
}); });
......
...@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount' ...@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000; const TIMEOUT = 1000;
const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR = 4587545; const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR = 4587542;
const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR = 4587548; const ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR = 4587545;
describe('ActsOsAccountThirdPartyTest', function () { describe('ActsOsAccountThirdPartyTest', function () {
/* /*
...@@ -33,7 +33,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -33,7 +33,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err)); console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId deviceId:" + deviceId); console.debug("====>getDistributedVirtualDeviceId deviceId:" + deviceId);
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(deviceId).assertEqual("0"); expect(deviceId).assertEqual("");
console.debug("====>ActsOsAccountDeviceId_0100 end===="); console.debug("====>ActsOsAccountDeviceId_0100 end====");
done(); done();
}) })
...@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
done(); done();
} }
console.debug("====>getDistributedVirtualDeviceId:" + deviceId); console.debug("====>getDistributedVirtualDeviceId:" + deviceId);
expect(deviceId).assertEqual("0"); expect(deviceId).assertEqual("");
console.debug("====>ActsOsAccountDeviceId_0200 end===="); console.debug("====>ActsOsAccountDeviceId_0200 end====");
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册