Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4cd3a673
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4cd3a673
编写于
7月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4545 【location】fail脚本修改
Merge pull request !4545 from 权力/cherry-pick-1658720383
上级
c4afbf18
4240d712
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
136 addition
and
143 deletion
+136
-143
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
...on_standard/src/main/js/default/test/GeocoderTest.test.js
+18
-12
location/geolocation_standard/src/main/js/default/test/LocationTest.test.js
...on_standard/src/main/js/default/test/LocationTest.test.js
+118
-131
未找到文件。
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
浏览文件 @
4cd3a673
...
@@ -322,26 +322,32 @@ describe('geolocationTest_geo1', function () {
...
@@ -322,26 +322,32 @@ describe('geolocationTest_geo1', function () {
geolocation
.
getAddressesFromLocationName
(
geocodeRequest
,
(
err
,
data
)
=>
{
geolocation
.
getAddressesFromLocationName
(
geocodeRequest
,
(
err
,
data
)
=>
{
if
(
err
){
if
(
err
){
switch
(
err
){
switch
(
err
){
case
100
:
console
.
info
(
"
NOT_SUPPORTED
"
+
JSON
.
stringify
(
err
));
break
;
case
101
:
case
101
:
console
.
info
(
"
INPUT_PARAMS_ERROR
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
INPUT_PARAMS_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
case
102
:
case
102
:
console
.
info
(
"
REVERSE_GEOCODE_ERROR
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
REVERSE_GEOCODE_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
case
103
:
case
103
:
console
.
info
(
"
GEOCODE_ERROR
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
GEOCODE_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
case
104
:
case
104
:
console
.
info
(
"
LOCATOR_ERROR
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
LOCATOR_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
case
105
:
case
105
:
console
.
info
(
"
LOCATION_SWITCH_ERROR
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
LOCATION_SWITCH_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
case
106
:
case
106
:
console
.
info
(
"
LAST_KNOWN_LOCATION_ERROR
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
LAST_KNOWN_LOCATION_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
case
107
:
case
107
:
console
.
info
(
"
LOCATION_REQUEST_TIMEOUT_ERROR:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
LOCATION_REQUEST_TIMEOUT_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
case
108
:
console
.
info
(
"
QUERY_COUNTRY_CODE_ERROR
"
+
JSON
.
stringify
(
err
));
break
;
break
;
default
:
default
:
console
.
info
(
'
[lbs_js] getAddressesFromLocationName callback err is :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
[lbs_js] getAddressesFromLocationName callback err is :
'
+
JSON
.
stringify
(
err
));
...
@@ -369,7 +375,7 @@ describe('geolocationTest_geo1', function () {
...
@@ -369,7 +375,7 @@ describe('geolocationTest_geo1', function () {
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
result
))
!=
null
);
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
result
))
!=
null
);
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
info
(
"
[lbs_js] getAddressesFromLocationName09 promise then error.
"
+
JSON
.
stringify
(
error
));
console
.
info
(
"
[lbs_js] getAddressesFromLocationName09 promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
).
assertFail
(
);
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
))
!=
null
);
});
});
done
();
done
();
})
})
...
@@ -1488,7 +1494,7 @@ describe('geolocationTest_geo1', function () {
...
@@ -1488,7 +1494,7 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
'
[lbs_js] getLastLocation callback err is :
'
+
JSON
.
stringify
(
err
)
);
console
.
info
(
'
[lbs_js] getLastLocation callback err is :
'
+
JSON
.
stringify
(
err
)
);
}
else
{
}
else
{
console
.
info
(
'
[lbs_js] getLastLocation callback result:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
[lbs_js] getLastLocation callback result:
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertTrue
(
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
data
)
!=
null
);
}
}
done
()
done
()
})
})
...
@@ -1507,7 +1513,7 @@ describe('geolocationTest_geo1', function () {
...
@@ -1507,7 +1513,7 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
'
[lbs_js] getLastLocation promise result:
'
+
JSON
.
stringify
(
result
));
console
.
info
(
'
[lbs_js] getLastLocation promise result:
'
+
JSON
.
stringify
(
result
));
expect
(
result
).
assertTrue
();
expect
(
result
).
assertTrue
();
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
info
(
'
[lbs_js] getLastLocation promise
then err:
'
+
JSON
.
stringify
(
result
));
console
.
info
(
'
[lbs_js] getLastLocation promise
result:
'
+
JSON
.
stringify
(
error
));
console
.
info
(
'
[lbs_js] not support now
'
);
console
.
info
(
'
[lbs_js] not support now
'
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
});
});
...
@@ -1653,8 +1659,8 @@ describe('geolocationTest_geo1', function () {
...
@@ -1653,8 +1659,8 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
'
sendCommand promise result:
'
+
result
);
console
.
info
(
'
sendCommand promise result:
'
+
result
);
done
();
done
();
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
info
(
'
sendcommand promise err:
'
+
err
);
console
.
info
(
'
sendcommand promise err:
'
+
err
or
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
err
)
!=
null
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
err
or
)
!=
null
);
done
();
done
();
})
})
})
})
...
...
location/geolocation_standard/src/main/js/default/test/LocationTest.test.js
浏览文件 @
4cd3a673
...
@@ -38,7 +38,7 @@ async function changedLocationMode(){
...
@@ -38,7 +38,7 @@ 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
();
expect
(
result
).
assertTrue
();
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
...
@@ -55,7 +55,7 @@ async function changedLocationMode(){
...
@@ -55,7 +55,7 @@ async function changedLocationMode(){
async
function
applyPermission
()
{
async
function
applyPermission
()
{
let
osAccountManager
=
osaccount
.
getAccountManager
();
let
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
=== getAccountManager finish
"
);
console
.
debug
(
"
=== getAccountManager finish
"
);
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
info
(
"
LocalId is :
"
+
localId
);
console
.
info
(
"
LocalId is :
"
+
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.location.geolocation.function
'
,
0
,
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.location.geolocation.function
'
,
0
,
localId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
...
@@ -88,15 +88,15 @@ describe('geolocationTest_geo3', function () {
...
@@ -88,15 +88,15 @@ describe('geolocationTest_geo3', function () {
console
.
log
(
'
#start AccessTokenTests#
'
);
console
.
log
(
'
#start AccessTokenTests#
'
);
beforeAll
(
async
function
(
done
)
{
beforeAll
(
async
function
(
done
)
{
await
applyPermission
();
await
applyPermission
();
setTimeout
(
function
()
{
setTimeout
(
function
()
{
this
.
locationChange
=
(
err
,
location
)
=>
{
this
.
locationChange
=
(
err
,
location
)
=>
{
console
.
log
(
'
locationChange:
'
+
err
+
"
data:
"
+
JSON
.
stringify
(
location
));
console
.
log
(
'
locationChange:
'
+
err
+
"
data:
"
+
JSON
.
stringify
(
location
));
};
};
this
.
locationServiceState
=
(
err
,
state
)
=>
{
this
.
locationServiceState
=
(
err
,
state
)
=>
{
console
.
log
(
'
locationServiceState:
'
+
err
+
"
data:
"
+
state
);
console
.
log
(
'
locationServiceState:
'
+
err
+
"
data:
"
+
state
);
};
};
done
();
done
();
},
3000
);
},
3000
);
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
})
})
...
@@ -449,7 +449,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -449,7 +449,7 @@ describe('geolocationTest_geo3', function () {
let
locationChange
=
(
location
)
=>
{
let
locationChange
=
(
location
)
=>
{
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
};
};
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
async
(
locationChange
)
=>
{
async
(
locationChange
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
...
@@ -723,25 +723,11 @@ describe('geolocationTest_geo3', function () {
...
@@ -723,25 +723,11 @@ describe('geolocationTest_geo3', function () {
*/
*/
it
(
'
SUB_HSS_LocationSystem_Gnss_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_HSS_LocationSystem_Gnss_0001
'
,
0
,
async
function
(
done
)
{
await
changedLocationMode
();
await
changedLocationMode
();
try
{
var
gnssStatusCb
=
(
satelliteStatusInfo
)
=>
{
geolocation
.
on
(
'
gnssStatusChange
'
,
function
(
data
)
{
console
.
log
(
'
gnssStatusChange:
'
+
satelliteStatusInfo
);
console
.
info
(
'
[lbs_js] gnssStatusChangestart
'
+
JSON
.
stringify
(
data
)
);
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
data
))
!=
null
);
console
.
info
(
'
[lbs_js] SatelliteStatusInfo satellitesNumber:
'
+
data
[
0
].
satellitesNumber
+
'
satelliteIds
'
+
data
[
0
].
satelliteIds
+
'
carrierToNoiseDensitys
'
+
data
[
0
].
carrierToNoiseDensitys
+
'
altitudes
'
+
data
[
0
].
altitudes
+
'
azimuths:
'
+
data
[
0
].
azimuths
+
'
carrierFrequencies:
'
+
data
[
0
].
carrierFrequencies
);
});
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
try
{
geolocation
.
off
(
'
gnssStatusChange
'
,
function
(
data
)
{
console
.
info
(
"
[lbs_js] gnssStatusChange off data:
"
+
JSON
.
stringify
(
data
));
});
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
}
geolocation
.
on
(
'
gnssStatusChange
'
,
gnssStatusCb
);
geolocation
.
off
(
'
gnssStatusChange
'
,
gnssStatusCb
);
done
();
done
();
})
})
...
@@ -755,20 +741,11 @@ describe('geolocationTest_geo3', function () {
...
@@ -755,20 +741,11 @@ describe('geolocationTest_geo3', function () {
*/
*/
it
(
'
SUB_HSS_LocationSystem_Gnss_0002
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_HSS_LocationSystem_Gnss_0002
'
,
0
,
async
function
(
done
)
{
await
changedLocationMode
();
await
changedLocationMode
();
try
{
var
nmeaCb
=
(
str
)
=>
{
geolocation
.
on
(
'
nmeaMessageChange
'
,
function
(
data
)
{
console
.
log
(
'
nmeaMessageChange:
'
+
str
);
console
.
info
(
'
[lbs_js] nmeaMessageChange
'
+
JSON
.
stringify
(
data
)
);
});
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
try
{
geolocation
.
off
(
'
nmeaMessageChange
'
,
function
(
data
)
{
console
.
info
(
"
[lbs_js] nmeaMessageChange off data:
"
+
JSON
.
stringify
(
data
));
});
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
}
geolocation
.
on
(
'
nmeaMessageChange
'
,
nmeaCb
);
geolocation
.
off
(
'
nmeaMessageChange
'
,
nmeaCb
);
done
();
done
();
})
})
...
@@ -784,26 +761,28 @@ describe('geolocationTest_geo3', function () {
...
@@ -784,26 +761,28 @@ describe('geolocationTest_geo3', function () {
await
changedLocationMode
();
await
changedLocationMode
();
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofenceRequest
=
{
"
priority
"
:
0x200
,
"
scenario
"
:
0x301
,
"
geofence
"
:
geofence
};
let
geofenceRequest
=
{
"
priority
"
:
0x200
,
"
scenario
"
:
0x301
,
"
geofence
"
:
geofence
};
let
want
=
(
wantAgent
)
=>
{
setTimeout
(
async
()
=>
{
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
let
want
=
(
wantAgent
)
=>
{
};
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
};
(
want
)
=>
{
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
done
();
expect
(
true
).
assertEqual
(
want
!=
null
);
});
done
();
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
});
(
want
)
=>
{
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
console
.
info
(
"
offfenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
off fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
});
expect
(
true
).
assertEqual
(
want
!=
null
);
});
},
1000
);
done
();
done
();
})
})
...
@@ -819,25 +798,28 @@ describe('geolocationTest_geo3', function () {
...
@@ -819,25 +798,28 @@ describe('geolocationTest_geo3', function () {
await
changedLocationMode
();
await
changedLocationMode
();
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofenceRequest
=
{
"
priority
"
:
0x200
,
"
scenario
"
:
0x304
,
"
geofence
"
:
geofence
};
let
geofenceRequest
=
{
"
priority
"
:
0x200
,
"
scenario
"
:
0x304
,
"
geofence
"
:
geofence
};
let
want
=
(
wantAgent
)
=>
{
setTimeout
(
async
()
=>
{
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
let
want
=
(
wantAgent
)
=>
{
};
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
};
(
want
)
=>
{
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
});
expect
(
true
).
assertEqual
(
want
!=
null
);
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
done
();
(
want
)
=>
{
});
if
(
err
){
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
(
want
)
=>
{
}
if
(
err
){
console
.
info
(
"
off fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
expect
(
true
).
assertEqual
(
want
!=
null
);
}
});
console
.
info
(
"
off fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
expect
(
true
).
assertEqual
(
want
!=
null
);
});
},
1000
);
done
();
done
();
})
})
...
@@ -853,26 +835,28 @@ describe('geolocationTest_geo3', function () {
...
@@ -853,26 +835,28 @@ describe('geolocationTest_geo3', function () {
await
changedLocationMode
();
await
changedLocationMode
();
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofenceRequest
=
{
"
priority
"
:
0x203
,
"
scenario
"
:
0x300
,
"
geofence
"
:
geofence
};
let
geofenceRequest
=
{
"
priority
"
:
0x203
,
"
scenario
"
:
0x300
,
"
geofence
"
:
geofence
};
let
want
=
(
wantAgent
)
=>
{
setTimeout
(
async
()
=>
{
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
let
want
=
(
wantAgent
)
=>
{
};
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
};
(
want
)
=>
{
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
done
();
expect
(
true
).
assertEqual
(
want
!=
null
);
});
done
();
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
});
(
want
)
=>
{
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
console
.
info
(
"
offfenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
off fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
});
expect
(
true
).
assertEqual
(
want
!=
null
);
});
},
1000
);
done
();
done
();
})
})
...
@@ -886,28 +870,30 @@ describe('geolocationTest_geo3', function () {
...
@@ -886,28 +870,30 @@ describe('geolocationTest_geo3', function () {
*/
*/
it
(
'
SUB_HSS_LocationSystem_GeoFence_0005
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_HSS_LocationSystem_GeoFence_0005
'
,
0
,
async
function
(
done
)
{
await
changedLocationMode
();
await
changedLocationMode
();
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
5000
};
let
geofence
=
{
"
latitude
"
:
31.12
,
"
longitude
"
:
121.11
,
"
radius
"
:
1
,
"
expiration
"
:
""
};
let
geofenceRequest
=
{
"
priority
"
:
0x203
,
"
scenario
"
:
0x300
,
"
geofence
"
:
geofence
};
let
geofenceRequest
=
{
"
priority
"
:
0x203
,
"
scenario
"
:
0x301
,
"
geofence
"
:
geofence
};
let
want
=
(
wantAgent
)
=>
{
setTimeout
(
async
()
=>
{
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
let
want
=
(
wantAgent
)
=>
{
};
console
.
log
(
'
wantAgent:
'
+
JSON
.
stringify
(
wantAgent
));
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
};
(
want
)
=>
{
geolocation
.
on
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange on callback err:
"
+
err
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
done
();
expect
(
true
).
assertEqual
(
want
!=
null
);
});
done
();
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
});
(
want
)
=>
{
geolocation
.
off
(
'
fenceStatusChange
'
,
geofenceRequest
,
if
(
err
){
(
want
)
=>
{
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
if
(
err
){
}
return
console
.
info
(
"
fenceStatusChange callback err:
"
+
err
);
console
.
info
(
"
offfenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
}
expect
(
true
).
assertEqual
(
want
!=
null
);
console
.
info
(
"
off fenceStatusChange callback, result:
"
+
JSON
.
stringify
(
want
));
});
expect
(
true
).
assertEqual
(
want
!=
null
);
});
},
1000
);
done
();
done
();
})
})
...
@@ -922,7 +908,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -922,7 +908,7 @@ describe('geolocationTest_geo3', function () {
it
(
'
SUB_HSS_LocationSystem_Batching_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_HSS_LocationSystem_Batching_0001
'
,
0
,
async
function
(
done
)
{
await
changedLocationMode
();
await
changedLocationMode
();
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
false
};
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
false
};
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
(
result
)
=>
{
(
result
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
...
@@ -935,7 +921,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -935,7 +921,7 @@ describe('geolocationTest_geo3', function () {
let
locationChange
=
(
location
)
=>
{
let
locationChange
=
(
location
)
=>
{
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
};
};
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
(
locationChange
)
=>
{
(
locationChange
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
...
@@ -944,7 +930,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -944,7 +930,7 @@ describe('geolocationTest_geo3', function () {
expect
(
true
).
assertEqual
(
locationChange
!=
null
);
expect
(
true
).
assertEqual
(
locationChange
!=
null
);
});
});
let
request1
=
{
"
reportingPeriodSec
"
:
10
,
"
wakeUpCacheQueueFull
"
:
false
};
let
request1
=
{
"
reportingPeriodSec
"
:
10
,
"
wakeUpCacheQueueFull
"
:
false
};
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request1
,
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request1
,
(
result
)
=>
{
(
result
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
...
@@ -974,7 +960,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -974,7 +960,7 @@ describe('geolocationTest_geo3', function () {
done
()
done
()
});
});
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
false
};
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
false
};
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
result
=>
{
result
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
...
@@ -988,7 +974,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -988,7 +974,7 @@ describe('geolocationTest_geo3', function () {
let
locationChange
=
(
location
)
=>
{
let
locationChange
=
(
location
)
=>
{
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
};
};
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
(
locationChange
)
=>
{
(
locationChange
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
...
@@ -997,7 +983,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -997,7 +983,7 @@ describe('geolocationTest_geo3', function () {
expect
(
true
).
assertEqual
(
locationChange
!=
null
);
expect
(
true
).
assertEqual
(
locationChange
!=
null
);
done
()
done
()
});
});
geolocation
.
off
(
'
cachedGnssLocationsReporting
'
,
request
,
geolocation
.
off
(
'
cachedGnssLocationsReporting
'
,
request
,
(
result
)
=>
{
(
result
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
cachedGnssLocationsReporting callback err:
"
+
err
);
return
console
.
info
(
"
cachedGnssLocationsReporting callback err:
"
+
err
);
...
@@ -1019,7 +1005,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -1019,7 +1005,7 @@ describe('geolocationTest_geo3', function () {
it
(
'
SUB_HSS_LocationSystem_Batching_0003
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_HSS_LocationSystem_Batching_0003
'
,
0
,
async
function
(
done
)
{
await
changedLocationMode
();
await
changedLocationMode
();
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
true
};
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
true
};
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
(
result
)
=>
{
(
result
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
...
@@ -1033,7 +1019,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -1033,7 +1019,7 @@ describe('geolocationTest_geo3', function () {
let
locationChange
=
(
location
)
=>
{
let
locationChange
=
(
location
)
=>
{
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
console
.
log
(
'
locationChanger:
'
+
JSON
.
stringify
(
location
));
};
};
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
geolocation
.
on
(
'
locationChange
'
,
requestInfo
,
(
locationChange
)
=>
{
(
locationChange
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
return
console
.
info
(
"
onLocationChange callback err:
"
+
err
);
...
@@ -1067,7 +1053,7 @@ describe('geolocationTest_geo3', function () {
...
@@ -1067,7 +1053,7 @@ describe('geolocationTest_geo3', function () {
it
(
'
SUB_HSS_LocationSystem_Batching_0004
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_HSS_LocationSystem_Batching_0004
'
,
0
,
async
function
(
done
)
{
await
changedLocationMode
();
await
changedLocationMode
();
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
true
};
let
request
=
{
"
reportingPeriodSec
"
:
5
,
"
wakeUpCacheQueueFull
"
:
true
};
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
geolocation
.
on
(
'
cachedGnssLocationsReporting
'
,
request
,
(
result
)
=>
{
(
result
)
=>
{
if
(
err
){
if
(
err
){
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
return
console
.
info
(
"
oncachedGnssLocationsReporting callback err:
"
+
err
);
...
@@ -1201,3 +1187,4 @@ describe('geolocationTest_geo3', function () {
...
@@ -1201,3 +1187,4 @@ describe('geolocationTest_geo3', function () {
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录