Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1a161190
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看板
提交
1a161190
编写于
7月 15, 2023
作者:
H
hu0475
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'upload测试,x增加download场景'
Signed-off-by:
N
hu0475
<
huyanqiang5@huawei.com
>
上级
76d9c8a2
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1349 addition
and
298 deletion
+1349
-298
request/crossplatform/RequestTest_ets/AppScope/resources/base/element/string.json
...questTest_ets/AppScope/resources/base/element/string.json
+1
-1
request/crossplatform/RequestTest_ets/Test.json
request/crossplatform/RequestTest_ets/Test.json
+9
-0
request/crossplatform/RequestTest_ets/src/main/ets/test/List.test.ets
...splatform/RequestTest_ets/src/main/ets/test/List.test.ets
+6
-4
request/crossplatform/RequestTest_ets/src/main/ets/test/RequestUpload.test.ets
.../RequestTest_ets/src/main/ets/test/RequestUpload.test.ets
+541
-0
request/crossplatform/RequestTest_ets/src/main/ets/test/requestConstant.test.ets
...equestTest_ets/src/main/ets/test/requestConstant.test.ets
+36
-35
request/crossplatform/RequestTest_ets/src/main/ets/test/requestDownload.test.ets
...equestTest_ets/src/main/ets/test/requestDownload.test.ets
+756
-258
未找到文件。
request/crossplatform/RequestTest_ets/AppScope/resources/base/element/string.json
浏览文件 @
1a161190
...
...
@@ -2,7 +2,7 @@
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"
xtsDemo1
"
"value"
:
"
ActsRequestETSApiCrossplatformTest
"
}
]
}
request/crossplatform/RequestTest_ets/Test.json
浏览文件 @
1a161190
...
...
@@ -15,6 +15,15 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
,
"uinput -T -m 300 720 300 360 200"
,
"uinput -T -m 650 2760 650 1380 200"
]
}
]
}
\ No newline at end of file
request/crossplatform/RequestTest_ets/src/main/ets/test/List.test.ets
浏览文件 @
1a161190
...
...
@@ -13,10 +13,12 @@
* limitations under the License.
*/
import requestDownloadJSUnit from './requestDownload.test';
import requestConstantJSUnit from './requestConstant.test';
import crossplatformRequestDownloadTest from './requestDownload.test';
import crossplatformRequestConstantTest from './requestConstant.test';
import crossplatformRequestUploadTest from './RequestUpload.test';
export default function testsuite() {
requestDownloadJSUnit()
requestConstantJSUnit()
crossplatformRequestDownloadTest();
crossplatformRequestConstantTest();
crossplatformRequestUploadTest();
}
\ No newline at end of file
request/crossplatform/RequestTest_ets/src/main/ets/test/RequestUpload.test.ets
0 → 100644
浏览文件 @
1a161190
此差异已折叠。
点击以展开。
request/crossplatform/RequestTest_ets/src/main/ets/test/requestConstant.test.ets
浏览文件 @
1a161190
...
...
@@ -16,8 +16,8 @@
import request from "@ohos.request";
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
export default function request
Upload
JSUnit() {
describe('requestConstant
JSUni
t', function () {
export default function request
ConstantCrossplatform
JSUnit() {
describe('requestConstant
CrossplatformTes
t', function () {
console.info('====>################################request upload Test start');
/**
...
...
@@ -49,45 +49,46 @@ export default function requestUploadJSUnit() {
});
/**
* @tc.number SUB_REQUEST_CONSTANT_0001
* *@tc.name
subRequestConstant
0001
* @tc.number SUB_REQUEST_C
ROSSPLATFORM_C
ONSTANT_0001
* *@tc.name
SUB_REQUEST_CROSSPLATFORM_CONSTANT_
0001
* @tc.desc Test constants of the request module.
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_REQUEST_CONSTANT_0001', 0, async function (done) {
it('SUB_REQUEST_C
ROSSPLATFORM_C
ONSTANT_0001', 0, async function (done) {
console.info("====>-----------------------SUB_REQUEST_CONSTANT_0001 is starting-----------------------");
expect(typeof request.EXCEPTION_PERMISSION == 'number').assertTrue();
expect(typeof request.EXCEPTION_PARAMCHECK == 'number').assertTrue();
expect(typeof request.EXCEPTION_UNSUPPORTED == 'number').assertTrue();
expect(typeof request.EXCEPTION_FILEIO == 'number').assertTrue();
expect(typeof request.EXCEPTION_FILEPATH == 'number').assertTrue();
expect(typeof request.EXCEPTION_SERVICE == 'number').assertTrue();
expect(typeof request.EXCEPTION_OTHERS == 'number').assertTrue();
expect(typeof request.NETWORK_MOBILE == 'number').assertTrue();
expect(typeof request.NETWORK_WIFI == 'number').assertTrue();
expect(typeof request.ERROR_CANNOT_RESUME == 'number').assertTrue();
expect(typeof request.ERROR_DEVICE_NOT_FOUND == 'number').assertTrue();
expect(typeof request.ERROR_FILE_ALREADY_EXISTS == 'number').assertTrue();
expect(typeof request.ERROR_FILE_ERROR == 'number').assertTrue();
expect(typeof request.ERROR_HTTP_DATA_ERROR == 'number').assertTrue();
expect(typeof request.ERROR_INSUFFICIENT_SPACE == 'number').assertTrue();
expect(typeof request.ERROR_TOO_MANY_REDIRECTS == 'number').assertTrue();
expect(typeof request.ERROR_UNHANDLED_HTTP_CODE == 'number').assertTrue();
expect(typeof request.ERROR_UNKNOWN == 'number').assertTrue();
expect(typeof request.ERROR_OFFLINE == 'number').assertTrue();
expect(typeof request.ERROR_UNSUPPORTED_NETWORK_TYPE == 'number').assertTrue();
expect(typeof request.PAUSED_QUEUED_FOR_WIFI == 'number').assertTrue();
expect(typeof request.PAUSED_WAITING_FOR_NETWORK == 'number').assertTrue();
expect(typeof request.PAUSED_WAITING_TO_RETRY == 'number').assertTrue();
expect(typeof request.PAUSED_BY_USER == 'number').assertTrue();
expect(typeof request.PAUSED_UNKNOWN == 'number').assertTrue();
expect(typeof request.SESSION_SUCCESSFUL == 'number').assertTrue();
expect(typeof request.SESSION_RUNNING == 'number').assertTrue();
expect(typeof request.SESSION_PENDING == 'number').assertTrue();
expect(typeof request.SESSION_PAUSED == 'number').assertTrue();
expect(typeof request.SESSION_FAILED == 'number').assertTrue();
expect(request.EXCEPTION_PERMISSION === 201).assertTrue();
expect(request.EXCEPTION_PARAMCHECK === 401).assertTrue();
expect(request.EXCEPTION_UNSUPPORTED === 801).assertTrue();
expect(request.EXCEPTION_FILEIO === 13400001).assertTrue();
expect(request.EXCEPTION_FILEPATH === 13400002).assertTrue();
expect(request.EXCEPTION_SERVICE === 13400003).assertTrue();
expect(request.EXCEPTION_OTHERS === 13499999).assertTrue();
expect(request.NETWORK_MOBILE === 1).assertTrue();
expect(request.NETWORK_WIFI === 65536).assertTrue();
expect(request.ERROR_CANNOT_RESUME === 0).assertTrue();
expect(request.ERROR_DEVICE_NOT_FOUND === 1).assertTrue();
expect(request.ERROR_FILE_ALREADY_EXISTS === 2).assertTrue();
expect(request.ERROR_FILE_ERROR === 3).assertTrue();
expect(request.ERROR_HTTP_DATA_ERROR === 4).assertTrue();
expect(request.ERROR_INSUFFICIENT_SPACE === 5).assertTrue();
expect(request.ERROR_TOO_MANY_REDIRECTS === 6).assertTrue();
expect(request.ERROR_UNHANDLED_HTTP_CODE === 7).assertTrue();
expect(request.ERROR_UNKNOWN === 8).assertTrue();
expect(request.ERROR_OFFLINE === 9).assertTrue();
expect(request.ERROR_UNSUPPORTED_NETWORK_TYPE === 10).assertTrue();
expect(request.PAUSED_QUEUED_FOR_WIFI === 0).assertTrue();
expect(request.PAUSED_WAITING_FOR_NETWORK === 1).assertTrue();
expect(request.PAUSED_WAITING_TO_RETRY === 2).assertTrue();
expect(request.PAUSED_BY_USER === 3).assertTrue();
expect(request.PAUSED_UNKNOWN === 4).assertTrue();
expect(request.SESSION_SUCCESSFUL === 0).assertTrue();
expect(request.SESSION_RUNNING === 1).assertTrue();
expect(request.SESSION_PENDING === 2).assertTrue();
expect(request.SESSION_PAUSED === 3).assertTrue();
expect(request.SESSION_FAILED === 4).assertTrue();
done();
});
...
...
request/crossplatform/RequestTest_ets/src/main/ets/test/requestDownload.test.ets
浏览文件 @
1a161190
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录