提交 8ce0042e 编写于 作者: C chengxingzhen

Modify codex

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 448892dc
......@@ -52,6 +52,7 @@ export default function test() {
subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent);
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
await sleep(1000);
})
/**
......@@ -570,17 +571,18 @@ export default function test() {
}, 10000);
}
function onAcquiredCallBack(_, data) {
async function onAcquiredCallBack(_, data) {
expect(data.event).assertEqual("FMS_FormOnState_commonEvent");
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000"));
console.debug("====>FMS_disableFormsUpdate_1000 onAcquiredCallBack====>" + JSON.stringify(data));
expect(data.parameters.kind).assertEqual("visible");
expect(data.data).assertEqual("0");
formId = data.parameters.formId;
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
commonEvent.subscribe(subscriberOnState, onFormDisableCallBack);
console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility notify disable start`);
featureAbility.startAbility({
await featureAbility.startAbility({
want: {
bundleName: "com.ohos.st.formsystemhostg",
abilityName: "com.ohos.st.formsystemhostg.MainAbility",
......@@ -604,7 +606,7 @@ export default function test() {
console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility notify disable end`);
}
commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack);
commonEvent.subscribe(subscriberOnState, onAcquiredCallBack);
console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility servicea start`);
await featureAbility.startAbility({
want: {
......@@ -681,17 +683,18 @@ export default function test() {
}, 10000);
}
function onAcquiredCallBack(_, data) {
async function onAcquiredCallBack(_, data) {
expect(data.event).assertEqual("FMS_FormOnState_commonEvent");
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100"));
console.debug("====>FMS_disableFormsUpdate_1100 onAcquiredCallBack====>" + JSON.stringify(data));
expect(data.parameters.kind).assertEqual("visible");
expect(data.data).assertEqual("0");
formId = data.parameters.formId;
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
commonEvent.subscribe(subscriberOnState, onFormDisableCallBack);
console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility notify disable start`);
featureAbility.startAbility({
await featureAbility.startAbility({
want: {
bundleName: "com.ohos.st.formsystemhostg",
abilityName: "com.ohos.st.formsystemhostg.MainAbility",
......@@ -715,7 +718,7 @@ export default function test() {
console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility notify disable end`);
}
commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack);
commonEvent.subscribe(subscriberOnState, onAcquiredCallBack);
console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility servicea start`);
await featureAbility.startAbility({
want: {
......@@ -743,6 +746,14 @@ export default function test() {
});
}
const sleep = async delay => {
return new Promise((resolve, _) => {
setTimeout(async () => {
resolve(0);
}, delay);
});
};
const delPublishCallback = async (tcNumber, done) => {
console.info(`${tcNumber} delPublishCallBack start`);
setTimeout(function () {
......
......@@ -52,6 +52,7 @@ export default function test() {
subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent);
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
await sleep(1000);
})
/**
......@@ -868,6 +869,14 @@ export default function test() {
});
}
const sleep = async delay => {
return new Promise((resolve, _) => {
setTimeout(async () => {
resolve(0);
}, delay);
});
};
const delPublishCallback = async (tcNumber, done) => {
console.info(`${tcNumber} delPublishCallBack start`);
setTimeout(function () {
......
......@@ -48,6 +48,7 @@ export default function test() {
subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent);
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
await sleep(1000);
})
/**
......@@ -508,6 +509,14 @@ export default function test() {
});
}
const sleep = async delay => {
return new Promise((resolve, _) => {
setTimeout(async () => {
resolve(0);
}, delay);
});
};
const delPublishCallback = async (tcNumber, done) => {
console.info(`${tcNumber} delPublishCallBack start`);
setTimeout(function () {
......
......@@ -43,6 +43,7 @@ export default function test() {
subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event);
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
await sleep(1000);
})
/**
......@@ -750,7 +751,7 @@ export default function test() {
function onStateCallBack(_, data) {
console.info("!!!====>FMS_notifyInvisibleForms_1500 onStateCallBack data:====>" + JSON.stringify(data));
expect(data.event).assertEqual("FMS_FormOnState_commonEvent");
expect(data.data != "0").assertEqual(true);
expect(data.data).assertEqual("7");
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1500"))
setTimeout(function () {
......@@ -791,6 +792,14 @@ export default function test() {
});
}
const sleep = async delay => {
return new Promise((resolve, _) => {
setTimeout(async () => {
resolve(0);
}, delay);
});
};
const delPublishCallback = async (tcNumber, done) => {
console.info(`${tcNumber} delPublishCallBack start`);
setTimeout(function () {
......
......@@ -46,6 +46,7 @@ export default function test() {
subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event);
subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent);
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
await sleep(1000);
})
......@@ -495,7 +496,7 @@ export default function test() {
expect(data.data).assertEqual("0");
assertFormId = data.parameters.formId;
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1100"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1100"));
}
commonEvent.subscribe(subscriberOnState, onVisibleCallBack);
......@@ -924,7 +925,6 @@ export default function test() {
formIds.push(data.data);
console.debug("====>FMS_notifyVisibleForms_1500 formIds====>" + formIds);
subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event);
commonEvent.subscribe(subscriberSupply, onVisibleSupplyCallBack);
console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyVisible start`);
for (var i = 0; i < 3; i++) {
......@@ -1347,6 +1347,14 @@ export default function test() {
});
}
const sleep = async delay => {
return new Promise((resolve, _) => {
setTimeout(async () => {
resolve(0);
}, delay);
});
};
const delPublishCallback = async (tcNumber, done) => {
console.info(`${tcNumber} delPublishCallBack start`);
setTimeout(function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册