提交 526d6724 编写于 作者: Z zhaimengchao

【account】【master】用例时序问题

Signed-off-by: Nzhaimengchao <zhaimengchao@huawei.com>
上级 1c436c2b
...@@ -21,26 +21,26 @@ const LENGTHLIMIT = 1024; ...@@ -21,26 +21,26 @@ const LENGTHLIMIT = 1024;
const SELFBUNDLE = 'com.example.actsgetaccountsbyowner' const SELFBUNDLE = 'com.example.actsgetaccountsbyowner'
const createAccountOptions = {customData:{age:'12'}} const createAccountOptions = {customData:{age:'12'}}
export default function GetAccountsByOwner() { export default function GetAccountsByOwner() {
beforeAll(async function (done) { describe('GetAccountsByOwner', function () {
console.debug("====>startAbility first start===="); beforeAll(async function (done) {
await featureAbility.startAbility( console.debug("====>startAbility start====");
{ await featureAbility.startAbility(
want:
{ {
deviceId: "", want:
bundleName: "com.example.actsscenegetallaccounts", {
abilityName: "com.example.actsscenegetallaccounts.MainAbility", deviceId: "",
action: "action1", bundleName: "com.example.actsscenegetallaccounts",
parameters: abilityName: "com.example.actsscenegetallaccounts.MainAbility",
{}, action: "action1",
parameters:
{},
},
}, },
}, );
); await sleep(TIMEOUT);
sleep(TIMEOUT); done();
done(); });
});
describe('GetAccountsByOwner', function () {
async function sleep(delay) { async function sleep(delay) {
let timeoutId = null; let timeoutId = null;
var promise = new Promise((resolve, reject) => { var promise = new Promise((resolve, reject) => {
...@@ -315,7 +315,7 @@ export default function GetAccountsByOwner() { ...@@ -315,7 +315,7 @@ export default function GetAccountsByOwner() {
console.debug("====>creat finish===="); console.debug("====>creat finish====");
console.debug("====>add account 1000 start===="); console.debug("====>add account 1000 start====");
await appAccountManager.createAccount("Account_application_promise"); await appAccountManager.createAccount("Account_application_promise");
sleep(TIMEOUT) await 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);
...@@ -361,7 +361,7 @@ export default function GetAccountsByOwner() { ...@@ -361,7 +361,7 @@ export default function GetAccountsByOwner() {
console.debug("====>GetAccountsByOwner_1100 end===="); console.debug("====>GetAccountsByOwner_1100 end====");
done(); done();
} }
sleep(TIMEOUT) await sleep(TIMEOUT)
console.debug("====>getAccountsByOwner 1100 start===="); console.debug("====>getAccountsByOwner 1100 start====");
appAccountManager.getAccountsByOwner(specifiedBundle, getAllCallback); appAccountManager.getAccountsByOwner(specifiedBundle, getAllCallback);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册