diff --git a/communication/wifi_hotspot/src/main/js/default/pages/index/index.js b/communication/wifi_hotspot/src/main/js/default/pages/index/index.js index 696aad4cf934ca8ca2e2b636169bb736427a4ea0..bcb53537faffb05eae8061fa98d11a77bb2337f6 100644 --- a/communication/wifi_hotspot/src/main/js/default/pages/index/index.js +++ b/communication/wifi_hotspot/src/main/js/default/pages/index/index.js @@ -20,7 +20,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' export default { data: { title: '', - myTimeout: 15000 + myTimeout: 25000 }, onInit() { this.title = this.$t('strings.world'); diff --git a/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js b/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js index 6445a90a1736f1cf4a6d5ca1ceb649378110631c..57aaca4083fbabb670d9b77a4408887b4d16e9f7 100644 --- a/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js +++ b/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js @@ -530,6 +530,7 @@ describe('ACTS_WifiTest', function() { let isSuccess1 = wifi.setHotspotConfig(HotspotConfigWO); console.log("[wifi_test] set a psk preSharedKey hotspot config result1: " + isSuccess1); expect(isSuccess1).assertTrue(); + await sleep(5000); let config = wifi.getHotspotConfig(); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); expect(config.ssid).assertEqual('WIFITEST'); diff --git a/communication/wifi_p2p/src/main/js/default/pages/index/index.js b/communication/wifi_p2p/src/main/js/default/pages/index/index.js index a756c422e6c842edbb3d5a877a8ad90cd3fd29b1..a1554d1736cb2844d614564a545b4ade775c5b52 100644 --- a/communication/wifi_p2p/src/main/js/default/pages/index/index.js +++ b/communication/wifi_p2p/src/main/js/default/pages/index/index.js @@ -20,7 +20,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' export default { data: { title: '', - myTimeout: 15000 + myTimeout: 25000 }, onInit() { this.title = this.$t('strings.world'); diff --git a/communication/wifi_standard/src/main/js/default/pages/index/index.js b/communication/wifi_standard/src/main/js/default/pages/index/index.js index 6e05db1fe0023ba6cd04a32307429c903b5b4d11..b74a408c5acb9f6b2f93337c6d32f069d10c740b 100755 --- a/communication/wifi_standard/src/main/js/default/pages/index/index.js +++ b/communication/wifi_standard/src/main/js/default/pages/index/index.js @@ -18,7 +18,7 @@ import {Core, ExpectExtend} from 'deccjsunit/index' export default { data: { title: '', - myTimeout: 15000 + myTimeout: 25000 }, onInit() { this.title = this.$t('strings.world'); 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 e07c970043a234536137b975b9e812bef1d16a87..4e84e0deb33fb2fce6ecdd8f54b28331b3f4724f 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 @@ -14,12 +14,12 @@ */ import geolocation from '@ohos.geolocation'; - +import wantAgent from '@ohos.wantAgent'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' let LocationRequestScenario = {UNSET : 0x300 ,NAVIGATION : 0x301 , TRAJECTORY_TRACKING : 0x302 ,CAR_HAILING : 0x303, -DAILY_LIFE_SERIVICE : 0x304 ,NO_POWER : 0x305} +DAILY_LIFE_SERVICE : 0x304 ,NO_POWER : 0x305} let LocationRequestPriority = {UNSET : 0x200 ,ACCURACY : 0x201 ,LOW_POWER : 0x202 ,FIRST_FIX :0x203} let LocationPrivacyType = { @@ -896,6 +896,50 @@ describe('geolocationTest', function () { }) + /** + * @tc.number SUB_LOCATION_geocode_DEVICE_JS_LOCATION_CHANGE_ON_0001 + * @tc.name testlocationChangeOn promise + * @tc.desc Test fenceStatusChange api . + * @tc.size MEDIUM + * @tc.type Function + * @tc.level Level 2 + */ + it('geolocation_fenceStatusChange_On_test_001', 0, async function (done) { + geolocation.enableLocation((err, data) => { + if (err) { + console.info('[lbs_js] enableLocation callback err is : ' + err ); + }else { + console.info("[lbs_js] enableLocation callback data: " + data); + expect(data).assertTrue(); + } + done() + }); + let geofence = {"latitude":31.12,"longitude":121.11, "radius":1,"expiration":""}; + let geofenceRequest = { "priority":0x203, "scenario":0x300,"geofence":geofence}; + let want = (wantAgent)=>{ + console.log('wantAgent:'+ JSON.stringify(wantAgent)); + }; + await geolocation.on('fenceStatusChange',geofenceRequest, + want => { + if(err){ + return console.info("fenceStatusChange callback err: " + err); + } + console.info("offfenceStatusChange callback: " + JSON.stringify(want)); + expect(true).assertEqual(want !=null); + done(); + }); + await geolocation.off('fenceStatusChange',geofenceRequest, + want => { + if(err){ + return console.info("fenceStatusChange callback err: " + err); + } + console.info("offfenceStatusChange callback: " + JSON.stringify(want)); + expect(true).assertEqual(want !=null); + done(); + }); + + }) + /** * @tc.number SUB_LOCATION_geocode_DEVICE_JS_LOCATION_CHANGE_ON_0002 * @tc.name testlocationChangeOn promise