Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8842f4e9
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看板
提交
8842f4e9
编写于
5月 29, 2023
作者:
Z
zhangfuzhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加用例兼容性
Signed-off-by:
N
zhangfuzhi
<
zhangfuzhi1@huawei.com
>
上级
5dbe22af
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
21 addition
and
21 deletion
+21
-21
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/HttpCacheTest.test.js
...anager_base/jshttp/src/main/js/test/HttpCacheTest.test.js
+2
-2
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/NetworkManagerHttp.test.js
...r_base/jshttp/src/main/js/test/NetworkManagerHttp.test.js
+7
-7
telephony/telephonyjstest/netmanager_base/system_fetch/src/main/js/test/Http.fetch.test.js
...ger_base/system_fetch/src/main/js/test/Http.fetch.test.js
+11
-11
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
...ket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
+1
-1
未找到文件。
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/HttpCacheTest.test.js
浏览文件 @
8842f4e9
...
...
@@ -36,7 +36,7 @@ export default function HttpCacheTest() {
usingCache
:
true
}).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
done
();
return
;
});
...
...
@@ -62,7 +62,7 @@ export default function HttpCacheTest() {
}).
then
(
function
(
data
)
{
http
.
destroy
();
console
.
info
(
CaseName
+
JSON
.
stringify
(
data
));
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
net_http
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
done
();
return
;
});
...
...
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/NetworkManagerHttp.test.js
浏览文件 @
8842f4e9
...
...
@@ -30,7 +30,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
let
http
=
netHttp
.
createHttp
();
http
.
request
(
"
https://httpbin.org/anything
"
).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
done
();
});
});
...
...
@@ -45,7 +45,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
let
http
=
netHttp
.
createHttp
();
http
.
request
(
"
https://httpbin.org/user-agent
"
).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
if
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
)
{
console
.
info
(
JSON
.
stringify
(
data
));
expect
(
data
.
result
.
toString
().
search
(
"
user-agent
"
)
!=
-
1
).
assertTrue
();
...
...
@@ -65,7 +65,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
let
http
=
netHttp
.
createHttp
();
http
.
request
(
"
https://httpbin.org/headers
"
).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
console
.
info
(
"
NETSTACK ####
"
+
JSON
.
stringify
(
data
.
result
));
if
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
)
{
expect
(
data
.
result
.
toString
().
search
(
"
Content-Type
"
)
!=
-
1
).
assertTrue
();
...
...
@@ -88,7 +88,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
extraData
:
"
MineMine
"
}).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
if
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
)
{
expect
(
data
.
result
.
toString
().
search
(
"
MineMine
"
)
!=
-
1
).
assertTrue
()
}
...
...
@@ -109,7 +109,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
extraData
:
"
MineMine
"
}).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
if
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
)
{
expect
(
data
.
result
.
toString
().
search
(
"
MineMine
"
)
!=
-
1
).
assertTrue
()
}
...
...
@@ -127,7 +127,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
let
http
=
netHttp
.
createHttp
();
http
.
request
(
"
https://httpbin.org/cookies/set/name/value
"
).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
if
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
)
{
expect
(
data
.
cookies
!==
""
).
assertTrue
();
}
...
...
@@ -150,7 +150,7 @@ export default function Telephony_NETSTACK_HTTPTest() {
}
}).
then
(
function
(
data
)
{
http
.
destroy
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
===
504
).
assertTrue
();
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
||
data
.
responseCode
>
500
).
assertTrue
();
if
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
)
{
expect
(
data
.
result
.
toString
().
search
(
"
key1
"
)
!=
-
1
).
assertTrue
()
expect
(
data
.
result
.
toString
().
search
(
"
val1
"
)
!=
-
1
).
assertTrue
()
...
...
telephony/telephonyjstest/netmanager_base/system_fetch/src/main/js/test/Http.fetch.test.js
浏览文件 @
8842f4e9
...
...
@@ -30,7 +30,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
url
:
"
https://httpbin.org/anything
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack fetch success
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
done
();
},
fail
:
function
(){
...
...
@@ -54,7 +54,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
url
:
"
https://httpbin.org/user-agent
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack fetch success
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
JSON
.
parse
(
data
.
data
.
toString
())[
"
user-agent
"
]
==
"
libcurl-agent/1.0
"
).
assertTrue
();
}
...
...
@@ -82,7 +82,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
responseType
:
"
json
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack fetch success
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
data
.
data
[
"
user-agent
"
]
==
"
libcurl-agent/1.0
"
).
assertTrue
();
}
...
...
@@ -109,7 +109,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
url
:
"
https://httpbin.org/headers
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack Fetch Success
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
JSON
.
parse
(
data
.
data
.
toString
())[
"
headers
"
][
"
Content-Type
"
]
===
"
application/json
"
).
assertTrue
();
}
...
...
@@ -137,7 +137,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
responseType
:
"
json
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack Fetch Success
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
data
.
data
[
"
headers
"
][
"
Content-Type
"
]
===
"
application/json
"
).
assertTrue
();
}
...
...
@@ -166,7 +166,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
data
:
"
MineMine
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
JSON
.
parse
(
data
.
data
.
toString
())[
"
data
"
]
===
"
MineMine
"
).
assertTrue
();
}
...
...
@@ -196,7 +196,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
responseType
:
"
json
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
data
.
data
[
"
data
"
]
===
"
MineMine
"
).
assertTrue
();
}
...
...
@@ -225,7 +225,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
data
:
"
MineMine
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
JSON
.
parse
(
data
.
data
.
toString
())[
"
data
"
]
===
"
MineMine
"
).
assertTrue
();
}
...
...
@@ -256,7 +256,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
success
:
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
));
if
(
data
.
code
===
200
)
{
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
expect
(
data
.
data
[
"
data
"
]
===
"
MineMine
"
).
assertTrue
();
}
done
();
...
...
@@ -286,7 +286,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
},
success
:
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
JSON
.
parse
(
data
.
data
.
toString
())[
"
key1
"
]
===
"
val1
"
).
assertTrue
();
expect
(
JSON
.
parse
(
data
.
data
.
toString
())[
"
key2
"
]
===
"
val2
"
).
assertTrue
();
...
...
@@ -321,7 +321,7 @@ export default function Telephony_NetStack_HttpFetchTest() {
responseType
:
"
json
"
,
success
:
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
code
===
200
||
data
.
code
===
504
).
assertTrue
();
expect
(
data
.
code
===
200
||
data
.
code
>
500
).
assertTrue
();
if
(
data
.
code
===
200
)
{
expect
(
data
.
data
[
"
key1
"
]
===
"
val1
"
).
assertTrue
();
expect
(
data
.
data
[
"
key2
"
]
===
"
val2
"
).
assertTrue
();
...
...
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
浏览文件 @
8842f4e9
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, it, expect, beforeAll, afterAll } from '@ohos/hypium';
import socket from
"@ohos.net.socket"
;
import socket from
'@ohos.net.socket'
;
let sendData = "hello!";
let instance = undefined;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录