Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ab4ab3f1
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看板
提交
ab4ab3f1
编写于
3月 16, 2022
作者:
W
weier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Signed-off-by: weier <duanlinrang@huawei.com>
Changes to be committed:
上级
d9581f4e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
11 deletion
+12
-11
miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js
...s/RequestTest_js/entry/src/main/js/Test/Publicfunction.js
+2
-2
miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js
...js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js
+10
-9
未找到文件。
miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js
浏览文件 @
ab4ab3f1
...
...
@@ -40,10 +40,10 @@ function getUploadConfig(fileurl){
}
let
FileArray
=
new
Array
();
FileArray
[
0
]
=
File
;
let
Header_
Http
=
{
headers
:
'
http
'
}
let
header
Http
=
{
headers
:
'
http
'
}
let
UploadConfig
=
{
url
:
'
http://192.168.112.124/upload_test/
'
,
// Resource address.
header
:
Header_
Http
,
// Adds an HTTP or HTTPS header to be included with the upload request.
header
:
header
Http
,
// Adds an HTTP or HTTPS header to be included with the upload request.
method
:
'
POST
'
,
// Request method: POST, PUT. The default POST.
files
:
FileArray
,
// A list of files to be uploaded. Please use multipart/form-data to submit.
data
:
RequestData
// The requested form data.
...
...
miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js
浏览文件 @
ab4ab3f1
...
...
@@ -17,9 +17,9 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
import
request
from
'
@ohos.request
'
;
import
*
as
pubfun
from
'
./Publicfunction.js
'
var
Type_
Progress
=
'
progress
'
;
var
Type_
HeaderReceive
=
'
headerReceive
'
;
var
Type_
Fail
=
'
fail
'
;
var
type
Progress
=
'
progress
'
;
var
type
HeaderReceive
=
'
headerReceive
'
;
var
type
Fail
=
'
fail
'
;
let
uploadTask
;
let
file7url
=
'
internal://cache/test.txt
'
;
...
...
@@ -40,6 +40,7 @@ describe('UploadTest', function () {
console
.
info
(
'
afterAll: Test suite-level cleanup condition,
'
+
'
which is executed after the test suite is executed
'
);
})
/*
* @tc.number : InitUploadtaskCallback001
* @tc.name : Use getEntries get the value by mixing the string key
...
...
@@ -81,7 +82,7 @@ describe('UploadTest', function () {
*/
it
(
'
SwitchOnProgressCallback001
'
,
0
,
async
function
(
done
)
{
try
{
pubfun
.
publiconprogress
(
uploadTask
,
Type_
Progress
);
pubfun
.
publiconprogress
(
uploadTask
,
type
Progress
);
expect
(
true
).
assertEqual
(
0
==
0
);
done
();
}
catch
(
err
)
{
...
...
@@ -101,10 +102,10 @@ describe('UploadTest', function () {
*/
it
(
'
SwitchOffProgressCallback001
'
,
0
,
async
function
(
done
)
{
try
{
pubfun
.
publiconprogress
(
uploadTask
,
Type_
Progress
);
pubfun
.
publiconprogress
(
uploadTask
,
type
Progress
);
expect
(
true
).
assertEqual
(
0
==
0
);
await
pubfun
.
publicoffprogress
(
uploadTask
,
Type_
Progress
).
then
((
data
)
=>
{
await
pubfun
.
publicoffprogress
(
uploadTask
,
type
Progress
).
then
((
data
)
=>
{
console
.
log
(
"
SwitchOffProgressCallback001 data
"
+
JSON
.
stringify
(
data
));
expect
(
7
).
assertEqual
(
data
.
totalSize
);
done
();
...
...
@@ -130,7 +131,7 @@ describe('UploadTest', function () {
*/
it
(
'
SwitchOnFailCallback001
'
,
0
,
async
function
(
done
)
{
try
{
await
pubfun
.
publicon
(
uploadTask
,
Type_
Fail
).
then
((
data
)
=>
{
await
pubfun
.
publicon
(
uploadTask
,
type
Fail
).
then
((
data
)
=>
{
console
.
log
(
"
SwitchOnFailCallback001 data
"
+
data
);
expect
(
5
).
assertEqual
(
data
);
done
();
...
...
@@ -156,8 +157,8 @@ describe('UploadTest', function () {
*/
it
(
'
SwitchOffFailCallback001
'
,
0
,
async
function
(
done
)
{
try
{
await
pubfun
.
publicon
(
uploadTask
,
Type_
Fail
)
await
pubfun
.
publicoff
(
uploadTask
,
Type_
Fail
).
then
((
data
)
=>
{
await
pubfun
.
publicon
(
uploadTask
,
type
Fail
)
await
pubfun
.
publicoff
(
uploadTask
,
type
Fail
).
then
((
data
)
=>
{
console
.
log
(
"
SwitchOffFailCallback001 data
"
+
data
);
expect
(
5
).
assertEqual
(
data
);
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录