Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
71834f96
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看板
提交
71834f96
编写于
11月 29, 2022
作者:
Q
quanli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
quanli
<
quanli1@huawei.com
>
上级
1e02ff3e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
132 addition
and
76 deletion
+132
-76
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
...on_standard/src/main/js/default/test/GeocoderTest.test.js
+105
-62
location/geolocation_standard/src/main/js/default/test/LocationTest.test.js
...on_standard/src/main/js/default/test/LocationTest.test.js
+27
-14
未找到文件。
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
浏览文件 @
71834f96
...
...
@@ -231,15 +231,22 @@ describe('geolocationTest_geo1', function () {
*/
it
(
'
SUB_HSS_LocationSystem_Geo_0600
'
,
0
,
async
function
(
done
)
{
let
reverseGeocodeRequest1
=
{
"
latitude
"
:
90
,
"
longitude
"
:
121.62771
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest1
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0601 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
data
))
!=
null
);
}).
catch
(
error
=>
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation0601 promise then error.
"
+
JSON
.
stringify
(
error
));
console
.
info
(
'
[lbs_js] not support now
'
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
console
.
info
(
'
[lbs_js] not support now
'
);
});
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
let
reverseGeocodeRequest2
=
{
"
latitude
"
:
90.1
,
"
longitude
"
:
121.62771
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest2
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation promise:
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
length
).
assertEqual
(
0
);
...
...
@@ -247,7 +254,13 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
"
[lbs_js] getAddressesFromLocation0602 promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
))
!=
null
);
});
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
let
reverseGeocodeRequest3
=
{
"
latitude
"
:
-
90
,
"
longitude
"
:
121.62771
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest3
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0603 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
data
))
!=
null
);
...
...
@@ -256,7 +269,12 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
'
[lbs_js] not support now
'
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
});
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
let
reverseGeocodeRequest4
=
{
"
latitude
"
:
-
90.1
,
"
longitude
"
:
121.62771
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest4
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0604 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
length
).
assertEqual
(
0
);
...
...
@@ -264,7 +282,11 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
"
[lbs_js] getAddressesFromLocation0604 promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
))
!=
null
);
});
done
()
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
done
();
})
/**
...
...
@@ -277,6 +299,7 @@ describe('geolocationTest_geo1', function () {
*/
it
(
'
SUB_HSS_LocationSystem_Geo_0700
'
,
0
,
async
function
(
done
)
{
let
reverseGeocodeRequest
=
{
"
latitude
"
:
31.265496
,
"
longitude
"
:
180
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0701 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
data
))
!=
null
);
...
...
@@ -285,7 +308,12 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
'
[lbs_js] not support now
'
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
});
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
let
reverseGeocodeRequest1
=
{
"
latitude
"
:
31.265496
,
"
longitude
"
:
-
180.1
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest1
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0702 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
length
).
assertEqual
(
0
);
...
...
@@ -293,7 +321,12 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
"
[lbs_js] getAddressesFromLocation0702 promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
))
!=
null
);
});
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
let
reverseGeocodeRequest2
=
{
"
latitude
"
:
31.265496
,
"
longitude
"
:
180
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest2
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0703 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
data
))
!=
null
);
...
...
@@ -302,7 +335,12 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
'
[lbs_js] not support now
'
);
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
});
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
let
reverseGeocodeRequest3
=
{
"
latitude
"
:
31.265496
,
"
longitude
"
:
180.1
,
"
maxItems
"
:
1
};
try
{
await
geolocation
.
getAddressesFromLocation
(
reverseGeocodeRequest3
).
then
((
data
)
=>
{
console
.
info
(
'
[lbs_js] getAddressesFromLocation0704 promise:
'
+
JSON
.
stringify
(
data
));
expect
(
data
.
length
).
assertEqual
(
0
);
...
...
@@ -310,7 +348,11 @@ describe('geolocationTest_geo1', function () {
console
.
info
(
"
[lbs_js] getAddressesFromLocation0704 promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
))
!=
null
);
});
done
()
}
catch
(
error
)
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation message.
"
+
JSON
.
stringify
(
error
.
message
));
expect
(
true
).
assertEqual
((
JSON
.
stringify
(
error
.
message
))
!=
null
);
}
done
();
})
/**
...
...
@@ -949,3 +991,4 @@ describe('geolocationTest_geo1', function () {
})
})
location/geolocation_standard/src/main/js/default/test/LocationTest.test.js
浏览文件 @
71834f96
...
...
@@ -508,6 +508,7 @@ describe('geolocationTest_geo3', function () {
*/
it
(
'
SUB_HSS_SendCommand_0100
'
,
0
,
async
function
(
done
)
{
let
requestInfo
=
{
'
scenairo
'
:
0x301
,
'
command
'
:
"
command_1
"
};
try
{
await
geolocation
.
sendCommand
(
requestInfo
,
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
info
(
'
sendcommand callback err:
'
+
JSON
.
stringify
(
err
));
...
...
@@ -516,6 +517,11 @@ describe('geolocationTest_geo3', function () {
}
console
.
info
(
'
sendcommand callback result:
'
+
JSON
.
stringify
(
result
));
});
}
catch
(
error
)
{
console
.
info
(
'
sendcommand callback err:
'
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
}
done
();
})
/**
...
...
@@ -528,6 +534,7 @@ describe('geolocationTest_geo3', function () {
*/
it
(
'
SUB_HSS_SendCommand_0200
'
,
0
,
async
function
(
done
)
{
let
requestInfo
=
{
'
scenairo
'
:
0x301
,
'
command
'
:
"
command_1
"
};
try
{
geolocation
.
sendCommand
(
requestInfo
).
then
((
result
)
=>
{
console
.
info
(
'
sendCommand promise result:
'
+
result
);
done
();
...
...
@@ -536,6 +543,11 @@ describe('geolocationTest_geo3', function () {
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
done
();
})
}
catch
(
error
)
{
console
.
info
(
'
sendcommand promise err:
'
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertEqual
(
JSON
.
stringify
(
error
)
!=
null
);
}
done
();
})
/**
...
...
@@ -1249,3 +1261,4 @@ describe('geolocationTest_geo3', function () {
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录