From 24e0c2d92d266d4e891c01c661191d00e94cb261 Mon Sep 17 00:00:00 2001 From: q00313334 Date: Sun, 27 Feb 2022 02:40:56 +0800 Subject: [PATCH] fixed 5477de5 from https://gitee.com/quanli125/xts_acts/pulls/2912 3516quanli1@huawei.com Signed-off-by: q00313334 --- .../src/main/js/default/pages/index/index.js | 2 +- .../main/js/default/test/WifiSoftAP.test.js | 1 + .../src/main/js/default/pages/index/index.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../main/js/default/test/Geolocation.test.js | 48 ++++++++++++++++++- 5 files changed, 50 insertions(+), 5 deletions(-) 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 696aad4cf..bcb53537f 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 6445a90a1..57aaca408 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 a756c422e..a1554d173 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 6e05db1fe..b74a408c5 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 e07c97004..4e84e0deb 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 -- GitLab