Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f088d91b
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看板
提交
f088d91b
编写于
9月 02, 2022
作者:
Z
zwx1016320
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add API of request and input
Signed-off-by:
N
zwx1016320
<
zhangyushuai1@huawei-partners.com
>
上级
b086ff93
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
121 addition
and
14 deletion
+121
-14
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets
...t_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets
+33
-7
request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets
...stTest_ets/entry/src/main/ets/test/requestUpload.test.ets
+88
-7
未找到文件。
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets
浏览文件 @
f088d91b
...
...
@@ -573,7 +573,7 @@ export default function inputMethodEngineJSUnit() {
it('inputMethodEngine_test_044', 0, async function (done) {
let keyType = inputMethodEngine.WINDOW_TYPE_INPUT_METHOD_FLOAT;
console.error("inputMethodEngine_test_044 result:" + keyType);
expect(keyType ==
null
).assertTrue();
expect(keyType ==
2105
).assertTrue();
done();
});
...
...
@@ -581,8 +581,8 @@ export default function inputMethodEngineJSUnit() {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.moveCursor(
1
, (value) => {
console.info("inputMethodEngine_test_045
getBackward
:" + value);
textInputClient.moveCursor(
inputMethodEngine.CURSOR_UP
, (value) => {
console.info("inputMethodEngine_test_045
moveCursor
:" + value);
expect(value == null).assertEqual(true);
});
}
...
...
@@ -593,12 +593,38 @@ export default function inputMethodEngineJSUnit() {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
let promise = textInputClient.moveCursor(1);
promise.then(res => {
console.info("inputMethodEngine_test_046 getBackward promise result-----" + JSON.stringify(res));
textInputClient.moveCursor(inputMethodEngine.CURSOR_DOWN, (value) => {
console.info("inputMethodEngine_test_046 moveCursor:" + value);
expect(value == null).assertEqual(true);
});
}
done();
})
it('inputMethodEngine_test_047', 0, async function (done) {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.moveCursor(inputMethodEngine.CURSOR_LEFT).then(res => {
console.info("inputMethodEngine_test_047 moveCursor promise result-----" + JSON.stringify(res));
expect(res == null).assertEqual(true);
}).catch(err => {
console.info("inputMethodEngine_test_047 moveCursor promise error----" + JSON.stringify(err));
expect().assertFail();
});
}
done();
})
it('inputMethodEngine_test_048', 0, async function (done) {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.moveCursor(inputMethodEngine.CURSOR_RIGHT).then(res => {
console.info("inputMethodEngine_test_048 moveCursor promise result-----" + JSON.stringify(res));
expect(res == null).assertEqual(true);
}).catch(err => {
console.info("inputMethodEngine_test_04
6 getBackward
promise error----" + JSON.stringify(err));
console.info("inputMethodEngine_test_04
8 moveCursor
promise error----" + JSON.stringify(err));
expect().assertFail();
});
}
...
...
request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets
浏览文件 @
f088d91b
...
...
@@ -255,13 +255,13 @@ export default function requestUploadJSUnit() {
done();
});
/
*
* @tc.number : SUB_REQUEST_UPLOAD_API_PROMISE_0001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
/*
*
* @tc.number : SUB_REQUEST_UPLOAD_API_PROMISE_0001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_REQUEST_UPLOAD_API_PROMISE_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0001 is starting-----------------------");
...
...
@@ -296,5 +296,86 @@ export default function requestUploadJSUnit() {
done();
});
/**
* @tc.number : SUB_REQUEST_UPLOAD_API_PROMISE_0002
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Called when the current upload session complete or fail.
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_REQUEST_UPLOAD_API_PROMISE_0002', 0, async function (done) {
console.info("-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0002 is starting-----------------------");
try {
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 UploadConfig = " + JSON.stringify(uploadConfig));
request.upload(uploadConfig).then((data) => {
uploadTask = data;
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 uploadTask = " + uploadTask);
expect(true).assertEqual((uploadTask != undefined) || (uploadTask != "") || (uploadTask != {}));
uploadTask.on('complete', (TaskState) => {
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 TaskState.path = " + TaskState.path);
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 TaskState.responseCode" + TaskState.responseCode);
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 TaskState.TaskState.message" + TaskState.message);
expect(typeof(TaskState.path) == "string").assertEqual(true);
expect(typeof(TaskState.responseCode) == "number").assertEqual(true);
expect(typeof(TaskState.message) == "string").assertEqual(true);
});
uploadTask.on('fail', (TaskState) => {
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 TaskState.path = " + TaskState.path);
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 TaskState.responseCode" + TaskState.responseCode);
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0002 TaskState.TaskState.message" + TaskState.message);
expect(typeof(TaskState.path) == "string").assertEqual(true);
expect(typeof(TaskState.responseCode) == "number").assertEqual(true);
expect(typeof(TaskState.message) == "string").assertEqual(true);
expect(true).assertEqual(true);
});
});
} catch (e) {
console.error("SUB_REQUEST_UPLOAD_API_PROMISE_0001 error: " + JSON.stringify(e));
expect(true).assertFail(true);
}
sleep(Date.now(), 20000);
console.info("-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0001 end-----------------------");
done();
});
/**
* @tc.number : SUB_REQUEST_UPLOAD_API_PROMISE_0003
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Called when the current upload session complete or fail.
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_REQUEST_UPLOAD_API_PROMISE_0003', 0, async function (done) {
console.info("-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0003 is starting-----------------------");
try {
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0003 UploadConfig = " + JSON.stringify(uploadConfig));
request.upload(uploadConfig).then((data) => {
uploadTask = data;
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0003 uploadTask = " + uploadTask);
expect(true).assertEqual((uploadTask != undefined) || (uploadTask != "") || (uploadTask != {}));
uploadTask.off('complete', () => {
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0003 TaskState success");
expect(true).assertEqual(true);
});
uploadTask.off('fail', () => {
console.info("SUB_REQUEST_UPLOAD_API_PROMISE_0003 TaskState success");
expect(true).assertEqual(true);
});
});
} catch (e) {
console.error("SUB_REQUEST_UPLOAD_API_PROMISE_0003 error: " + JSON.stringify(e));
expect(true).assertFail(true);
}
sleep(Date.now(), 20000);
console.info("-----------------------SUB_REQUEST_UPLOAD_API_PROMISE_0003 end-----------------------");
done();
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录