提交 22bfee1c 编写于 作者: J jidong

modify sleep logic in app account xts

Signed-off-by: Njidong <jidong4@huawei.com>
上级 2dda39d7
......@@ -20,22 +20,25 @@ const STRCOUNT = 1025;
const EACHTIMEOUT = 500;
describe('ActsAccountAppAccess', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
})
beforeEach(async function (done) {
console.debug("====>beforeEach enter====");
sleep(EACHTIMEOUT);
await sleep(EACHTIMEOUT);
done();
})
......
......@@ -19,22 +19,25 @@ const TIMEOUT = 5000;
const EACHTIMEOUT = 500;
describe('ActsAccountAssociatedData', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
})
beforeEach(async function (done) {
console.debug("====>beforeEach enter====");
sleep(EACHTIMEOUT);
await sleep(EACHTIMEOUT);
done();
})
......
......@@ -18,15 +18,18 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const TIMEOUT = 5000;
describe('ActsCreatAppAccountManager', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
});
......
......@@ -19,22 +19,25 @@ const TIMEOUT = 5000;
const EACHTIMEOUT = 500;
describe('ActsAccountCredential', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
})
beforeEach(async function (done) {
console.debug("====>beforeEach enter====");
sleep(EACHTIMEOUT);
await sleep(EACHTIMEOUT);
done();
})
......
......@@ -19,15 +19,18 @@ const NAMELIMIT = 512;
const TIMEOUT = 5000;
describe('ActsAccountDeleteAccount', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
});
......
......@@ -19,22 +19,25 @@ const TIMEOUT = 5000;
const EACHTIMEOUT = 500;
describe('ActsAccountSetGetExtraInfo', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
})
beforeEach(async function (done) {
console.debug("====>beforeEach enter====");
sleep(EACHTIMEOUT);
await sleep(EACHTIMEOUT);
done();
})
......
......@@ -19,15 +19,17 @@ const TIMEOUT = 5000;
const ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED = 4521993;
describe('ActsAccountNoPermission', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
});
......
......@@ -30,22 +30,25 @@ const OWNERSELF = "com.example.actsaccounttest";
describe('ActsAccountOAuthToken', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>beforeAll start====");
sleep(TIMEOUT);
await sleep(TIMEOUT);
console.debug("====>beforeAll end====");
done();
});
beforeEach(async function (done) {
console.debug("====>beforeAll enter====");
sleep(EACHTIMEOUT);
await sleep(EACHTIMEOUT);
done();
});
......
......@@ -20,6 +20,15 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const TIMEOUT = 5000;
describe('ActsAccountChangeOnOff', async function () {
function sleep(delay) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
console.debug("====>startAbility start====");
await featureAbility.startAbility(
......@@ -35,7 +44,8 @@ describe('ActsAccountChangeOnOff', async function () {
},
},
);
setTimeout(done(), TIMEOUT);
await sleep(TIMEOUT);
done();
});
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册