提交 dfa05022 编写于 作者: X xinking129

change code

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 5b9356c0
...@@ -514,27 +514,20 @@ export default function abilityTest() { ...@@ -514,27 +514,20 @@ export default function abilityTest() {
] ]
} }
}; };
globalThis.abilitycontext.startAbility(want).then(() => { await globalThis.abilitycontext.startAbility(want).then(() => {
console.info('startAbility first succeed'); console.info('startAbility first succeed');
setTimeout(() => { expect(true).assertTrue();
globalThis.abilitycontext.startAbility(want).then(() => {
console.info('startAbility second succeed');
setTimeout(()=> {
abilityDelegator.executeShellCommand('pkill -f com.example.mytest5').then((data) => {
console.log('pkill -f successful ' + JSON.stringify(data))
}).catch((err) => { }).catch((err) => {
console.log('pkill -f err is ' + JSON.stringify(err)) console.error(`startAbility first failed, error is ${JSON.stringify(err)}`);
});
done();
}, 1000)
}).catch((err) => {
console.error(`startAbility second failed, error is ${JSON.stringify(err)}`);
expect(true).assertFalse(); expect(true).assertFalse();
done(); done();
}); });
}, 1000); await globalThis.abilitycontext.startAbility(want).then(() => {
console.info('startAbility second succeed');
expect(true).assertTrue();
done();
}).catch((err) => { }).catch((err) => {
console.error(`startAbility first failed, error is ${JSON.stringify(err)}`); console.error(`startAbility second failed, error is ${JSON.stringify(err)}`);
expect(true).assertFalse(); expect(true).assertFalse();
done(); done();
}); });
...@@ -547,7 +540,7 @@ export default function abilityTest() { ...@@ -547,7 +540,7 @@ export default function abilityTest() {
* @tc.level:1 * @tc.level:1
*/ */
it('ACTS_NFC_SelectTypes_1300',0, async function (done) { it('ACTS_NFC_SelectTypes_1300',0, async function (done) {
hilog.info(DOMAIN, TAG, '%{public}s', 'ACTS_NFC_SelectTypes_1200 begin'); hilog.info(DOMAIN, TAG, '%{public}s', 'ACTS_NFC_SelectTypes_1300 begin');
let want = { let want = {
action: "ohos.nfc.tag.action.TAG_FOUND", action: "ohos.nfc.tag.action.TAG_FOUND",
type: '', type: '',
...@@ -557,27 +550,20 @@ export default function abilityTest() { ...@@ -557,27 +550,20 @@ export default function abilityTest() {
] ]
} }
}; };
globalThis.abilitycontext.startAbility(want).then(() => { await globalThis.abilitycontext.startAbility(want).then(() => {
console.info('startAbility first succeed'); console.info('startAbility first succeed');
setTimeout(() => { expect(true).assertTrue();
globalThis.abilitycontext.startAbility(want).then(() => {
console.info('startAbility second succeed');
setTimeout(()=> {
abilityDelegator.executeShellCommand('pkill -f com.example.mytest4').then((data) => {
console.log('pkill -f successful ' + JSON.stringify(data))
}).catch((err) => {
console.log('pkill -f err is ' + JSON.stringify(err))
});
done();
}, 1000)
}).catch((err) => { }).catch((err) => {
console.error(`startAbility second failed, error is ${JSON.stringify(err)}`); console.error(`startAbility first failed, error is ${JSON.stringify(err)}`);
expect(true).assertFalse(); expect(true).assertFalse();
done(); done();
}); });
}, 1000); await globalThis.abilitycontext.startAbility(want).then(() => {
console.info('startAbility second succeed');
expect(true).assertTrue();
done();
}).catch((err) => { }).catch((err) => {
console.error(`startAbility first failed, error is ${JSON.stringify(err)}`); console.error(`startAbility second failed, error is ${JSON.stringify(err)}`);
expect(true).assertFalse(); expect(true).assertFalse();
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册