提交 4ed745ba 编写于 作者: X xinking129

change code

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 d42460e9
...@@ -12,10 +12,12 @@ ...@@ -12,10 +12,12 @@
{ {
"test-file-name": [ "test-file-name": [
"ActsNFCSelectTypesTest.hap", "ActsNFCSelectTypesTest.hap",
"ActsNFCSelectTypesTestRelyFifth.hap",
"ActsNFCSelectTypesTestRelyFirst.hap", "ActsNFCSelectTypesTestRelyFirst.hap",
"ActsNFCSelectTypesTestRelyFourth.hap", "ActsNFCSelectTypesTestRelyFourth.hap",
"ActsNFCSelectTypesTestRelyMultiAbility.hap", "ActsNFCSelectTypesTestRelyMultiAbility.hap",
"ActsNFCSelectTypesTestRelyMultiHapFirst.hap", "ActsNFCSelectTypesTestRelyMultiHapFirst.hap",
"ActsNFCSelectTypesTestRelyMultiHapFourth.hap",
"ActsNFCSelectTypesTestRelyMultiHapSecond.hap", "ActsNFCSelectTypesTestRelyMultiHapSecond.hap",
"ActsNFCSelectTypesTestRelyMultiHapThird.hap", "ActsNFCSelectTypesTestRelyMultiHapThird.hap",
"ActsNFCSelectTypesTestRelySecond.hap", "ActsNFCSelectTypesTestRelySecond.hap",
......
...@@ -519,7 +519,7 @@ export default function abilityTest() { ...@@ -519,7 +519,7 @@ export default function abilityTest() {
}).catch(err => { }).catch(err => {
console.log('pkill -f err is ' + JSON.stringify(err)) console.log('pkill -f err is ' + JSON.stringify(err))
}); });
},1000) },5000)
await sleep(1000); await sleep(1000);
setTimeout(()=> { setTimeout(()=> {
globalThis.abilitycontext.startAbility( globalThis.abilitycontext.startAbility(
...@@ -527,11 +527,19 @@ export default function abilityTest() { ...@@ -527,11 +527,19 @@ export default function abilityTest() {
if (err.code) { if (err.code) {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`);
expect(true).assertFalse(); expect(true).assertFalse();
done();
return; return;
} }
console.info('startAbility succeed'); console.info('startAbility succeed');
expect(true).assertTrue(); expect(true).assertTrue();
setTimeout(()=> {
abilityDelegator.executeShellCommand('pkill -f com.example.mytest5').then(data => {
console.log('pkill -f successful ' + JSON.stringify(data))
}).catch(err => {
console.log('pkill -f err is ' + JSON.stringify(err))
});
done(); done();
},1000)
}); });
},1000) },1000)
...@@ -569,17 +577,25 @@ export default function abilityTest() { ...@@ -569,17 +577,25 @@ export default function abilityTest() {
}).catch(err => { }).catch(err => {
console.log('pkill -f err is ' + JSON.stringify(err)) console.log('pkill -f err is ' + JSON.stringify(err))
}); });
},1000) },5000)
globalThis.abilitycontext.startAbility( globalThis.abilitycontext.startAbility(
want, (err) => { want, (err) => {
if (err.code) { if (err.code) {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`);
expect(true).assertFalse(); expect(true).assertFalse();
done();
return; return;
} }
console.info('startAbility succeed'); console.info('startAbility succeed');
expect(true).assertTrue(); expect(true).assertTrue();
setTimeout(()=> {
abilityDelegator.executeShellCommand('pkill -f com.example.mytest5').then(data => {
console.log('pkill -f successful ' + JSON.stringify(data))
}).catch(err => {
console.log('pkill -f err is ' + JSON.stringify(err))
});
done(); done();
},1000)
}); });
}) })
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册