diff --git a/location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js b/location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js index bd00cc7b9b5111d59219a68171a9f2660e75e1a0..38e62ca5e6258c83a75186d458284a3804e58862 100644 --- a/location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js +++ b/location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js @@ -39,7 +39,6 @@ async function changedLocationMode(){ await geolocation.requestEnableLocation().then(async(result) => { await sleep(3000); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); - expect(result).assertTrue(); }).catch((error) => { console.info("[lbs_js] promise then error." + JSON.stringify(error)); expect().assertFail(); diff --git a/location/geolocation_standard/src/main/js/default/test/Geolocation.test.js b/location/geolocation_standard/src/main/js/default/test/Geolocation.test.js index cfd29cc9c209e24122ea4249161e3d25f7b98203..24dd912c7ab4a7078581efba78a0e5f60eac99b5 100644 --- a/location/geolocation_standard/src/main/js/default/test/Geolocation.test.js +++ b/location/geolocation_standard/src/main/js/default/test/Geolocation.test.js @@ -30,7 +30,6 @@ async function changedLocationMode(){ await geolocation.requestEnableLocation().then(async(result) => { await sleep(3000); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); - expect(result).assertTrue(); }).catch((error) => { console.info("[lbs_js] promise then error." + JSON.stringify(error)); expect().assertFail(); diff --git a/location/geolocation_standard/src/main/js/default/test/LocationMock.test.js b/location/geolocation_standard/src/main/js/default/test/LocationMock.test.js index d2d0c5de6d5f5fc9de1ac68958721a7bca185353..3f78c62cc9efe02333cdede116668247ce3af5b4 100644 --- a/location/geolocation_standard/src/main/js/default/test/LocationMock.test.js +++ b/location/geolocation_standard/src/main/js/default/test/LocationMock.test.js @@ -31,7 +31,6 @@ async function changedLocationMode(){ await geolocation.requestEnableLocation().then(async(result) => { await sleep(3000); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); - expect(result).assertTrue(); }).catch((error) => { console.info("[lbs_js] promise then error." + JSON.stringify(error)); expect().assertFail(); @@ -71,6 +70,13 @@ async function applyPermission() { } } +let CountryCodeType = { + COUNTRY_CODE_FROM_LOCALE : 1, + COUNTRY_CODE_FROM_SIM:2, + COUNTRY_CODE_FROM_LOCATION:3, + COUNTRY_CODE_FROM_NETWORK:4, + } + describe('geolocationTest_4', function () { beforeAll(async function (done) { console.info('beforeAll case'); @@ -151,6 +157,10 @@ describe('geolocationTest_4', function () { console.info("[lbs_js] getCountryCode promise result: " + JSON.stringify(result)); console.info("[lbs_js] country :" + JSON.stringify(result).country); console.info("[lbs_js] type: " + JSON.stringify(result).type); + expect(true).assertTrue(JSON.stringify(result)==CountryCodeType.COUNTRY_CODE_FROM_LOCALE); + expect(true).assertTrue(JSON.stringify(result)!=CountryCodeType.COUNTRY_CODE_FROM_SIM); + expect(true).assertTrue(JSON.stringify(result)!=CountryCodeType.COUNTRY_CODE_FROM_LOCATION); + expect(true).assertTrue(JSON.stringify(result)!=CountryCodeType.COUNTRY_CODE_FROM_NETWORK); expect(true).assertTrue(JSON.stringify(result)!=null); }).catch((error) => { console.info("[lbs_js] getCountryCode promise then error." + JSON.stringify(error)); @@ -358,3 +368,4 @@ describe('geolocationTest_4', function () { + diff --git a/location/geolocation_standard/src/main/js/default/test/LocationTest.test.js b/location/geolocation_standard/src/main/js/default/test/LocationTest.test.js index a3b33ca35fc4c4f5efb8ca1582cbae0d65d78e5f..94aa34e2eb8798d886e91b74cdf283a78429dbee 100644 --- a/location/geolocation_standard/src/main/js/default/test/LocationTest.test.js +++ b/location/geolocation_standard/src/main/js/default/test/LocationTest.test.js @@ -38,9 +38,8 @@ async function changedLocationMode(){ console.info('[lbs_js] getLocationSwitchState result: ' + JSON.stringify(result)); if(!result){ await geolocation.requestEnableLocation().then(async(result) => { -// await sleep(3000); + await sleep(3000); console.info('[lbs_js] test requestEnableLocation promise result: ' + JSON.stringify(result)); - expect(result).assertTrue(); }).catch((error) => { console.info("[lbs_js] promise then error." + JSON.stringify(error)); expect().assertFail(); @@ -1188,3 +1187,4 @@ describe('geolocationTest_geo3', function () { +