未验证 提交 07dfe8a9 编写于 作者: O openharmony_ci 提交者: Gitee

!4619 【lcoation】脚本update

Merge pull request !4619 from 倪钰斐/cherry-pick-1658821288
...@@ -39,7 +39,6 @@ async function changedLocationMode(){ ...@@ -39,7 +39,6 @@ async function changedLocationMode(){
await geolocation.requestEnableLocation().then(async(result) => { await geolocation.requestEnableLocation().then(async(result) => {
await sleep(3000); await sleep(3000);
console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result));
expect(result).assertTrue();
}).catch((error) => { }).catch((error) => {
console.info("[lbs_js] promise then error." + JSON.stringify(error)); console.info("[lbs_js] promise then error." + JSON.stringify(error));
expect().assertFail(); expect().assertFail();
...@@ -47,7 +46,7 @@ async function changedLocationMode(){ ...@@ -47,7 +46,7 @@ async function changedLocationMode(){
} }
}); });
await geolocation.isLocationEnabled().then(async(result) => { await geolocation.isLocationEnabled().then(async(result) => {
console.info('[lbs_js] getLocationSwitchState result: ' + JSON.stringify(result)); console.info('[lbs_js]check LocationSwitchState result: ' + JSON.stringify(result));
}); });
} }
......
...@@ -30,7 +30,6 @@ async function changedLocationMode(){ ...@@ -30,7 +30,6 @@ async function changedLocationMode(){
await geolocation.requestEnableLocation().then(async(result) => { await geolocation.requestEnableLocation().then(async(result) => {
await sleep(3000); await sleep(3000);
console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result));
expect(result).assertTrue();
}).catch((error) => { }).catch((error) => {
console.info("[lbs_js] promise then error." + JSON.stringify(error)); console.info("[lbs_js] promise then error." + JSON.stringify(error));
expect().assertFail(); expect().assertFail();
...@@ -38,7 +37,7 @@ async function changedLocationMode(){ ...@@ -38,7 +37,7 @@ async function changedLocationMode(){
} }
}); });
await geolocation.isLocationEnabled().then(async(result) => { await geolocation.isLocationEnabled().then(async(result) => {
console.info('[lbs_js] getLocationSwitchState result: ' + JSON.stringify(result)); console.info('[lbs_js] check LocationSwitchState result: ' + JSON.stringify(result));
}); });
} }
......
...@@ -38,9 +38,8 @@ async function changedLocationMode(){ ...@@ -38,9 +38,8 @@ async function changedLocationMode(){
console.info('[lbs_js] getLocationSwitchState result: ' + JSON.stringify(result)); console.info('[lbs_js] getLocationSwitchState result: ' + JSON.stringify(result));
if(!result){ if(!result){
await geolocation.requestEnableLocation().then(async(result) => { await geolocation.requestEnableLocation().then(async(result) => {
// await sleep(3000); await sleep(3000);
console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result));
expect(result).assertTrue();
}).catch((error) => { }).catch((error) => {
console.info("[lbs_js] promise then error." + JSON.stringify(error)); console.info("[lbs_js] promise then error." + JSON.stringify(error));
expect().assertFail(); expect().assertFail();
...@@ -48,7 +47,7 @@ async function changedLocationMode(){ ...@@ -48,7 +47,7 @@ async function changedLocationMode(){
} }
}); });
await geolocation.isLocationEnabled().then(async(result) => { await geolocation.isLocationEnabled().then(async(result) => {
console.info('[lbs_js] getLocationSwitchState result: ' + JSON.stringify(result)); console.info('[lbs_js] check LocationSwitchState result: ' + JSON.stringify(result));
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册