Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9ec40333
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看板
未验证
提交
9ec40333
编写于
8月 11, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 11, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9686 request2接口变更为requestInStream
Merge pull request !9686 from 高曦/master
上级
da449947
d1a66ce4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
93 addition
and
93 deletion
+93
-93
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/HttpRequest2JsunitTest.test.js
...se/jshttp/src/main/js/test/HttpRequest2JsunitTest.test.js
+93
-93
未找到文件。
telephony/telephonyjstest/netmanager_base/jshttp/src/main/js/test/HttpRequest2JsunitTest.test.js
浏览文件 @
9ec40333
...
@@ -35,32 +35,32 @@ function dataEnd_on_callback() {
...
@@ -35,32 +35,32 @@ function dataEnd_on_callback() {
console
.
log
(
"
dataEnd_on_callback callback function
"
);
console
.
log
(
"
dataEnd_on_callback callback function
"
);
}
}
function
dataProgress_on_callback
(
data
)
{
function
data
Receive
Progress_on_callback
(
data
)
{
console
.
log
(
"
dataProgress_on_callback receive datProgress:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
data
Receive
Progress_on_callback receive datProgress:
"
+
JSON
.
stringify
(
data
));
}
}
export
default
function
Http
Request2
JsunitTest
()
{
export
default
function
Http
requestInStream
JsunitTest
()
{
describe
(
"
Http
Request2
JsunitTest
"
,
function
()
{
describe
(
"
Http
requestInStream
JsunitTest
"
,
function
()
{
/**
/**
* @tc.number Telephony_http_HttpRequest_request
2
_0100
* @tc.number Telephony_http_HttpRequest_request
InStream
_0100
* @tc.name httprequest
2::request2
* @tc.name httprequest
InStream::requestInStream
* @tc.desc Test request
2
(url: string, callback: AsyncCallback<void>): void.
* @tc.desc Test request
InStream
(url: string, callback: AsyncCallback<void>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_Async_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_Async_0100
"
,
0
,
async
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_Async_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_Async_0100
"
;
let
Address_Img
=
"
https://img1.baidu.com/it/u=3010094603,1247181326&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500
"
;
let
Address_Img
=
"
https://img1.baidu.com/it/u=3010094603,1247181326&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500
"
;
let
httpRequest
=
http
.
createHttp
();
let
httpRequest
=
http
.
createHttp
();
try
{
try
{
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
on
(
"
data
Progress
"
,
data
Progress_on_callback
);
httpRequest
.
on
(
"
data
ReceiveProgress
"
,
dataReceive
Progress_on_callback
);
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
request
2
(
Address_Img
,
httpRequestOptions
,
(
err
,
data
)
=>
{
httpRequest
.
request
InStream
(
Address_Img
,
httpRequestOptions
,
(
err
,
data
)
=>
{
console
.
info
(
CaseName
+
"
responseCode data :
"
+
data
);
console
.
info
(
CaseName
+
"
responseCode data :
"
+
data
);
console
.
log
(
CaseName
+
"
NETSTACK request
2
OK!
"
);
console
.
log
(
CaseName
+
"
NETSTACK request
InStream
OK!
"
);
httpRequest
.
off
(
"
dataReceive
"
);
httpRequest
.
off
(
"
dataReceive
"
);
console
.
log
(
"
NETSTACK off dataReceive success!
"
);
console
.
log
(
"
NETSTACK off dataReceive success!
"
);
httpRequest
.
off
(
"
dataProgress
"
);
httpRequest
.
off
(
"
data
Receive
Progress
"
);
console
.
log
(
"
NETSTACK off dataProgress success!
"
);
console
.
log
(
"
NETSTACK off data
Receive
Progress success!
"
);
httpRequest
.
off
(
"
dataEnd
"
);
httpRequest
.
off
(
"
dataEnd
"
);
console
.
log
(
"
NETSTACK off dataEnd success!
"
);
console
.
log
(
"
NETSTACK off dataEnd success!
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
...
@@ -68,7 +68,7 @@ export default function HttpRequest2JsunitTest() {
...
@@ -68,7 +68,7 @@ export default function HttpRequest2JsunitTest() {
done
();
done
();
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
CaseName
+
"
request
2
catch : error =
"
+
JSON
.
stringify
(
error
));
console
.
log
(
CaseName
+
"
request
InStream
catch : error =
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertFalse
();
expect
(
error
).
assertFalse
();
done
();
done
();
}
}
...
@@ -76,35 +76,35 @@ export default function HttpRequest2JsunitTest() {
...
@@ -76,35 +76,35 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number Telephony_http_HttpRequest_request
2
_0200
* @tc.number Telephony_http_HttpRequest_request
InStream
_0200
* @tc.name httprequest
2::request2
* @tc.name httprequest
InStream::requestInStream
* @tc.desc Test request
2
(url: string, options: HttpRequestOptions, callback: AsyncCallback<void>): void.
* @tc.desc Test request
InStream
(url: string, options: HttpRequestOptions, callback: AsyncCallback<void>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_Async_0200
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_Async_0200
"
,
0
,
async
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_Async_0200
"
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_Async_0200
"
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
request
2
(
Address_Baidu
,
(
err
,
data
)
=>
{
httpRequest
.
request
InStream
(
Address_Baidu
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
CaseName
+
"
request
2
ERROR
"
+
JSON
.
stringify
(
err
));
console
.
log
(
CaseName
+
"
request
InStream
ERROR
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
done
();
done
();
}
}
httpRequest
.
destroy
();
httpRequest
.
destroy
();
console
.
log
(
CaseName
+
"
request
2
Finish responseCode
"
+
data
);
console
.
log
(
CaseName
+
"
request
InStream
Finish responseCode
"
+
data
);
done
();
done
();
});
});
});
});
/**
/**
* @tc.number Telephony_http_HttpRequest_request
2
_0100
* @tc.number Telephony_http_HttpRequest_request
InStream
_0100
* @tc.name httprequest
2::request2
* @tc.name httprequest
InStream::requestInStream
* @tc.desc Test request
2
(url: string, options: HttpRequestOptions): Promise<void>.
* @tc.desc Test request
InStream
(url: string, options: HttpRequestOptions): Promise<void>.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_Promise_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_Promise_0100
"
,
0
,
async
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_Promise_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_Promise_0100
"
;
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
request
2
(
Address_Baidu
,
httpRequestOptions
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
,
httpRequestOptions
).
then
(
function
(
data
)
{
console
.
log
(
CaseName
+
"
request
2
Finish responseCode
"
+
data
);
console
.
log
(
CaseName
+
"
request
InStream
Finish responseCode
"
+
data
);
httpRequest
.
destroy
();
httpRequest
.
destroy
();
done
();
done
();
}).
catch
(
function
(
err
)
{
}).
catch
(
function
(
err
)
{
...
@@ -115,15 +115,15 @@ export default function HttpRequest2JsunitTest() {
...
@@ -115,15 +115,15 @@ export default function HttpRequest2JsunitTest() {
});
});
/**
/**
* @tc.number Telephony_http_HttpRequest_request
2
_0100
* @tc.number Telephony_http_HttpRequest_request
InStream
_0100
* @tc.name httprequest
2::request2
* @tc.name httprequest
InStream::requestInStream
* @tc.desc Test request
2
(url: string): Promise<void>.
* @tc.desc Test request
InStream
(url: string): Promise<void>.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_Promise_0200
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_Promise_0200
"
,
0
,
async
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_Promise_0200
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_Promise_0200
"
;
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
console
.
log
(
CaseName
+
"
request
2
Finish responseCode
"
+
data
);
console
.
log
(
CaseName
+
"
request
InStream
Finish responseCode
"
+
data
);
httpRequest
.
destroy
();
httpRequest
.
destroy
();
done
();
done
();
}).
catch
(
function
(
err
)
{
}).
catch
(
function
(
err
)
{
...
@@ -135,16 +135,16 @@ export default function HttpRequest2JsunitTest() {
...
@@ -135,16 +135,16 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2
_on_dataReceive_0100
* @tc.number SUB_Telephony_NetStack_Http
requestInStream
_on_dataReceive_0100
* @tc.name httprequest
2
::on_dataReceive
* @tc.name httprequest
InStream
::on_dataReceive
* @tc.desc Test on(type: "dataReceive", callback: Callback<ArrayBuffer>): void.
* @tc.desc Test on(type: "dataReceive", callback: Callback<ArrayBuffer>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_on_dataReceive_0100
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_on_dataReceive_0100
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_on_dataReceive_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_on_dataReceive_0100
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
console
.
log
(
CaseName
+
"
on dataReceive Finish
"
);
console
.
log
(
CaseName
+
"
on dataReceive Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
httpRequest
.
destroy
();
httpRequest
.
destroy
();
...
@@ -163,16 +163,16 @@ export default function HttpRequest2JsunitTest() {
...
@@ -163,16 +163,16 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2
_off_dataReceive_0100
* @tc.number SUB_Telephony_NetStack_Http
requestInStream
_off_dataReceive_0100
* @tc.name httprequest
2
::off_dataReceive
* @tc.name httprequest
InStream
::off_dataReceive
* @tc.desc Test off(type: "dataReceive", callback: Callback<ArrayBuffer>): void.
* @tc.desc Test off(type: "dataReceive", callback: Callback<ArrayBuffer>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_off_dataReceive_0100
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataReceive_0100
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_off_dataReceive_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataReceive_0100
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
off
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
off
(
"
dataReceive
"
,
dataReceive_on_callback
);
console
.
log
(
CaseName
+
"
off dataReceive Finish
"
);
console
.
log
(
CaseName
+
"
off dataReceive Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
...
@@ -192,16 +192,16 @@ export default function HttpRequest2JsunitTest() {
...
@@ -192,16 +192,16 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2
_off_dataReceive_0200
* @tc.number SUB_Telephony_NetStack_Http
requestInStream
_off_dataReceive_0200
* @tc.name httprequest
2
::off_dataReceive
* @tc.name httprequest
InStream
::off_dataReceive
* @tc.desc Test off(type: "dataReceive"): void.
* @tc.desc Test off(type: "dataReceive"): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_off_dataReceive_0200
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataReceive_0200
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_off_dataReceive_0200
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataReceive_0200
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
on
(
"
dataReceive
"
,
dataReceive_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
off
(
"
dataReceive
"
);
httpRequest
.
off
(
"
dataReceive
"
);
console
.
log
(
CaseName
+
"
off dataReceive Finish
"
);
console
.
log
(
CaseName
+
"
off dataReceive Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
...
@@ -220,17 +220,17 @@ export default function HttpRequest2JsunitTest() {
...
@@ -220,17 +220,17 @@ export default function HttpRequest2JsunitTest() {
});
});
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2_on_data
Progress_0100
* @tc.number SUB_Telephony_NetStack_Http
requestInStream_on_dataReceive
Progress_0100
* @tc.name httprequest
2::on_data
Progress
* @tc.name httprequest
InStream::on_dataReceive
Progress
* @tc.desc Test on(type: "dataProgress", callback: Callback<{ receiveSize: number, totalSize: number }>): void.
* @tc.desc Test on(type: "data
Receive
Progress", callback: Callback<{ receiveSize: number, totalSize: number }>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2_on_data
Progress_0100
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream_on_dataReceive
Progress_0100
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2_on_data
Progress_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream_on_dataReceive
Progress_0100
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
data
Progress
"
,
data
Progress_on_callback
);
httpRequest
.
on
(
"
data
ReceiveProgress
"
,
dataReceive
Progress_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
console
.
log
(
CaseName
+
"
on dataProgress Finish
"
);
console
.
log
(
CaseName
+
"
on data
Receive
Progress Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
httpRequest
.
destroy
();
httpRequest
.
destroy
();
done
();
done
();
...
@@ -247,18 +247,18 @@ export default function HttpRequest2JsunitTest() {
...
@@ -247,18 +247,18 @@ export default function HttpRequest2JsunitTest() {
});
});
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2_off_data
Progress_0100
* @tc.number SUB_Telephony_NetStack_Http
requestInStream_off_dataReceive
Progress_0100
* @tc.name httprequest
2::off_data
Progress
* @tc.name httprequest
InStream::off_dataReceive
Progress
* @tc.desc Test off(type: "dataProgress", callback: Callback<{ receiveSize: number, totalSize: number }>): void.
* @tc.desc Test off(type: "data
Receive
Progress", callback: Callback<{ receiveSize: number, totalSize: number }>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2_off_data
Progress_0100
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream_off_dataReceive
Progress_0100
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2_off_data
Progress_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream_off_dataReceive
Progress_0100
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
data
Progress
"
,
data
Progress_on_callback
);
httpRequest
.
on
(
"
data
ReceiveProgress
"
,
dataReceive
Progress_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
off
(
"
data
Progress
"
,
data
Progress_on_callback
);
httpRequest
.
off
(
"
data
ReceiveProgress
"
,
dataReceive
Progress_on_callback
);
console
.
log
(
CaseName
+
"
off dataProgress Finish
"
);
console
.
log
(
CaseName
+
"
off data
Receive
Progress Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
httpRequest
.
destroy
();
httpRequest
.
destroy
();
done
();
done
();
...
@@ -276,18 +276,18 @@ export default function HttpRequest2JsunitTest() {
...
@@ -276,18 +276,18 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2_off_data
Progress_0200
* @tc.number SUB_Telephony_NetStack_Http
requestInStream_off_dataReceive
Progress_0200
* @tc.name httprequest
2::off_data
Progress
* @tc.name httprequest
InStream::off_dataReceive
Progress
* @tc.desc Test off(type: "dataProgress"): void.
* @tc.desc Test off(type: "data
Receive
Progress"): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2_off_data
Progress_0200
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream_off_dataReceive
Progress_0200
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2_off_data
Progress_0200
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream_off_dataReceive
Progress_0200
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
data
Progress
"
,
data
Progress_on_callback
);
httpRequest
.
on
(
"
data
ReceiveProgress
"
,
dataReceive
Progress_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
off
(
"
dataProgress
"
);
httpRequest
.
off
(
"
data
Receive
Progress
"
);
console
.
log
(
CaseName
+
"
off dataProgress Finish
"
);
console
.
log
(
CaseName
+
"
off data
Receive
Progress Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
httpRequest
.
destroy
();
httpRequest
.
destroy
();
done
();
done
();
...
@@ -305,16 +305,16 @@ export default function HttpRequest2JsunitTest() {
...
@@ -305,16 +305,16 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2
_on_dataEnd_0100
* @tc.number SUB_Telephony_NetStack_Http
requestInStream
_on_dataEnd_0100
* @tc.name httprequest
2
::on_dataEnd
* @tc.name httprequest
InStream
::on_dataEnd
* @tc.desc Test on(type: "dataEnd", callback: Callback<void>): void.
* @tc.desc Test on(type: "dataEnd", callback: Callback<void>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_on_dataEnd_0100
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_on_dataEnd_0100
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_on_dataEnd_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_on_dataEnd_0100
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
console
.
log
(
CaseName
+
"
on dataEnd Finish
"
);
console
.
log
(
CaseName
+
"
on dataEnd Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
httpRequest
.
destroy
();
httpRequest
.
destroy
();
...
@@ -333,16 +333,16 @@ export default function HttpRequest2JsunitTest() {
...
@@ -333,16 +333,16 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2
_off_dataEnd_0100
* @tc.number SUB_Telephony_NetStack_Http
requestInStream
_off_dataEnd_0100
* @tc.name httprequest
2
::off_dataEnd
* @tc.name httprequest
InStream
::off_dataEnd
* @tc.desc Test off(type: "dataEnd", callback?: Callback<void>): void.
* @tc.desc Test off(type: "dataEnd", callback?: Callback<void>): void.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_off_dataEnd_0100
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataEnd_0100
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_off_dataEnd_0100
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataEnd_0100
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
off
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
off
(
"
dataEnd
"
,
dataEnd_on_callback
);
console
.
log
(
CaseName
+
"
off dataEnd Finish
"
);
console
.
log
(
CaseName
+
"
off dataEnd Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
...
@@ -362,16 +362,16 @@ export default function HttpRequest2JsunitTest() {
...
@@ -362,16 +362,16 @@ export default function HttpRequest2JsunitTest() {
/**
/**
* @tc.number SUB_Telephony_NetStack_Http
Request2
_off_dataEnd_0200
* @tc.number SUB_Telephony_NetStack_Http
requestInStream
_off_dataEnd_0200
* @tc.name httprequest
2
::off_dataEnd
* @tc.name httprequest
InStream
::off_dataEnd
* @tc.desc Test off(type: "dataEnd"): void;.
* @tc.desc Test off(type: "dataEnd"): void;.
*/
*/
it
(
"
SUB_Telephony_NetStack_Http
Request2
_off_dataEnd_0200
"
,
0
,
function
(
done
)
{
it
(
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataEnd_0200
"
,
0
,
function
(
done
)
{
let
CaseName
=
"
SUB_Telephony_NetStack_Http
Request2
_off_dataEnd_0200
"
;
let
CaseName
=
"
SUB_Telephony_NetStack_Http
requestInStream
_off_dataEnd_0200
"
;
try
{
try
{
var
httpRequest
=
http
.
createHttp
();
var
httpRequest
=
http
.
createHttp
();
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
on
(
"
dataEnd
"
,
dataEnd_on_callback
);
httpRequest
.
request
2
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
request
InStream
(
Address_Baidu
).
then
(
function
(
data
)
{
httpRequest
.
off
(
"
dataEnd
"
);
httpRequest
.
off
(
"
dataEnd
"
);
console
.
log
(
CaseName
+
"
off dataEnd Finish
"
);
console
.
log
(
CaseName
+
"
off dataEnd Finish
"
);
expect
(
data
==
200
).
assertTrue
();
expect
(
data
==
200
).
assertTrue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录