Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
66932dce
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看板
未验证
提交
66932dce
编写于
11月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6220 【杂散】【输入法】新增输入法和上传下载属性接口
Merge pull request !6220 from 张育帅/master
上级
f2f2da48
e8b5c687
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
224 addition
and
30 deletion
+224
-30
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets
..._Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets
+187
-30
request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets
...stTest_ets/entry/src/main/ets/test/requestUpload.test.ets
+37
-0
未找到文件。
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets
浏览文件 @
66932dce
...
...
@@ -40,7 +40,7 @@ export default function inputMethodStageJSUnit() {
}catch(error){
console.info("inputMethod_test_getController_001 getController error" + JSON.stringify(error));
expect().assertFail();
}
}
;
console.info("-----------------inputMethod_test_getController_001 end---------------------");
done();
...
...
@@ -82,7 +82,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listInputMethodSubtype_001 listInputMethodSubtype catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_listInputMethodSubtype_001 end---------------------");
});
...
...
@@ -103,7 +103,7 @@ export default function inputMethodStageJSUnit() {
icon: "",
iconId: 124,
extra:{}
}
}
;
try{
let inputMethodSetting = inputMethod.getSetting();
...
...
@@ -113,7 +113,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listInputMethodSubtype_002 failed" + JSON.stringify(err));
expect().assertFail();
done()
}
}
;
console.info("inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype:" + JSON.stringify(data));
if(data.length >= 1){
let inputMethodSubtype = data[0]
...
...
@@ -125,13 +125,13 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype length less 1");
expect().assertFail();
done();
}
}
;
});
}catch(error){
console.info("inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_listInputMethodSubtype_002 end---------------------");
});
...
...
@@ -170,7 +170,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listInputMethodSubtype_003 listInputMethodSubtype catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_listInputMethodSubtype_003 end---------------------");
});
...
...
@@ -191,7 +191,7 @@ export default function inputMethodStageJSUnit() {
icon: "",
iconId: 124,
extra:{}
}
}
;
try{
let inputMethodSetting = inputMethod.getSetting();
...
...
@@ -212,7 +212,7 @@ export default function inputMethodStageJSUnit() {
}).catch(err => {
console.info("inputMethod_test_listInputMethodSubtype_004 failed" + JSON.stringify(err));
expect().assertFail();
done()
done()
;
});
}catch(error){
console.info("inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype catch error" + JSON.stringify(error));
...
...
@@ -238,7 +238,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listCurrentInputMethodSubtype_001 failed" + JSON.stringify(err));
expect().assertFail();
done();
}
}
;
console.info("inputMethod_test_listCurrentInputMethodSubtype_001 listCurrentInputMethodSubtype: " + JSON.stringify(data));
expect(true).assertTrue();
done();
...
...
@@ -247,7 +247,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listCurrentInputMethodSubtype_001 listCurrentInputMethodSubtype catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_listCurrentInputMethodSubtype_001 end---------------------");
});
...
...
@@ -275,7 +275,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_listCurrentInputMethodSubtype_002 listCurrentInputMethodSubtype catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_listCurrentInputMethodSubtype_002 end---------------------");
});
...
...
@@ -319,7 +319,7 @@ export default function inputMethodStageJSUnit() {
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
}
;
let inputMethodSubProperty : subtype = {
id: "com.example.kikakeyboard",
label: "ServiceExtAbility",
...
...
@@ -330,7 +330,7 @@ export default function inputMethodStageJSUnit() {
icon: "",
iconId: 0,
extra: {}
}
}
;
try {
inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, inputMethodSubProperty, (err,data) => {
if (err) {
...
...
@@ -346,7 +346,7 @@ export default function inputMethodStageJSUnit() {
console.error('inputMethod_test_switchCurrentInputMethodAndSubtype_001 catch error: ' + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_001 Test end*************");
});
...
...
@@ -364,7 +364,7 @@ export default function inputMethodStageJSUnit() {
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
}
;
let inputMethodSubProperty : subtype = {
id: "com.example.kikakeyboard",
label: "ServiceExtAbility",
...
...
@@ -375,7 +375,7 @@ export default function inputMethodStageJSUnit() {
icon: "",
iconId: 0,
extra: {}
}
}
;
try {
inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, inputMethodSubProperty).then((data) => {
console.info("inputMethod_test_switchCurrentInputMethodAndSubtype_002 data: " + JSON.stringify(data));
...
...
@@ -390,7 +390,7 @@ export default function inputMethodStageJSUnit() {
console.error('inputMethod_test_switchCurrentInputMethodAndSubtype_002 catch error: ' + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_002 Test end*************");
});
...
...
@@ -412,14 +412,14 @@ export default function inputMethodStageJSUnit() {
icon: "",
iconId: 0,
extra: {}
}
}
;
try {
inputMethod.switchCurrentInputMethodSubtype(inputMethodSubProperty, (err,data) => {
if (err) {
console.error('inputMethod_test_switchCurrentInputMethodSubtype_001 err: ' + JSON.stringify(err));
expect().assertFail();
done();
}
}
;
console.info("inputMethod_test_switchCurrentInputMethodSubtype_001 data: " + JSON.stringify(data));
expect(data != null).assertTrue();
done();
...
...
@@ -428,7 +428,7 @@ export default function inputMethodStageJSUnit() {
console.error('inputMethod_test_switchCurrentInputMethodSubtype_001 catch error: ' + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("************* inputMethod_test_switchCurrentInputMethodSubtype_001 Test end*************");
});
...
...
@@ -450,7 +450,7 @@ export default function inputMethodStageJSUnit() {
icon: "",
iconId: 0,
extra: {}
}
}
;
try {
inputMethod.switchCurrentInputMethodSubtype(inputMethodSubProperty).then((data) => {
console.info("inputMethod_test_switchCurrentInputMethodSubtype_002 data: " + JSON.stringify(data));
...
...
@@ -465,7 +465,7 @@ export default function inputMethodStageJSUnit() {
console.error('inputMethod_test_switchCurrentInputMethodSubtype_002 catch error: ' + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("************* inputMethod_test_switchCurrentInputMethodSubtype_002 Test end*************");
done();
});
...
...
@@ -486,16 +486,18 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods faild: " + JSON.stringify(err));
expect().assertFail();
done();
}
}
;
console.info("inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods success data is : " + data);
expect(true).assertTrue();
done();
setTimeout(() => {
done();
}, 1000);
});
}catch(error){
console.info("inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods catch error: " + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_showOptionalInputMethods_001 end---------------------");
});
...
...
@@ -523,7 +525,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods catch error: " + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_showOptionalInputMethods_002 end---------------------");
});
...
...
@@ -551,7 +553,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_stopInputSession_002 catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_stopInputSession_002 end---------------------");
});
...
...
@@ -571,7 +573,7 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_stopInputSession_001 faild: " + JSON.stringify(err));
expect().assertFail();
done();
}
}
;
console.info("inputMethod_test_stopInputSession_001 stopInputSession data: " + data);
expect(data == true).assertTrue();
done();
...
...
@@ -580,9 +582,164 @@ export default function inputMethodStageJSUnit() {
console.info("inputMethod_test_stopInputSession_001 catch error" + JSON.stringify(error));
expect().assertFail();
done();
}
}
;
console.info("-----------------inputMethod_test_stopInputSession_001 end---------------------");
});
/*
* @tc.number inputMethod_test_EXCEPTION_PERMISSION_001
* @tc.name Errorcode 201. The permissions check fails.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_PERMISSION_001', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_PERMISSION;
console.info("inputMethod_test_EXCEPTION_PERMISSION_001 result:" + keyType);
expect(keyType).assertEqual(201);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_PARAMCHECK_002
* @tc.name Errorcode 401. The parameters check fails.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_PARAMCHECK_002', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_PARAMCHECK;
console.info("inputMethod_test_EXCEPTION_PARAMCHECK_002 result:" + keyType);
expect(keyType).assertEqual(401);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_UNSUPPORTED_003
* @tc.name Errorcode 801. Call unsupported api.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_UNSUPPORTED_003', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_UNSUPPORTED;
console.info("inputMethod_test_EXCEPTION_UNSUPPORTED_003 result:" + keyType);
expect(keyType).assertEqual(801);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_PACKAGEMANAGER_004
* @tc.name Errorcode 12800001. Package manager error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_PACKAGEMANAGER_004', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_PACKAGEMANAGER;
console.info("inputMethod_test_EXCEPTION_PACKAGEMANAGER_004 result:" + keyType);
expect(keyType).assertEqual(12800001);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_IMENGINE_005
* @tc.name Errorcode 12800002. Input method engine error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_IMENGINE_005', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_IMENGINE;
console.info("inputMethod_test_EXCEPTION_IMENGINE_005 result:" + keyType);
expect(keyType).assertEqual(12800002);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_IMCLIENT_006
* @tc.name Errorcode 12800003. Input method client error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_IMCLIENT_006', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_IMCLIENT;
console.info("inputMethod_test_EXCEPTION_IMCLIENT_006 result:" + keyType);
expect(keyType).assertEqual(12800003);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_KEYEVENT_007
* @tc.name Errorcode 12800004. Key event processing error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_KEYEVENT_007', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_KEYEVENT;
console.info("inputMethod_test_EXCEPTION_KEYEVENT_007 result:" + keyType);
expect(keyType).assertEqual(12800004);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_CONFPERSIST_008
* @tc.name Errorcode 12800005. Configuration persisting error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_CONFPERSIST_008', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_CONFPERSIST;
console.info("inputMethod_test_EXCEPTION_CONFPERSIST_008 result:" + keyType);
expect(keyType).assertEqual(12800005);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_CONTROLLER_009
* @tc.name Errorcode 12800006. Input method controller error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_CONTROLLER_009', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_CONTROLLER;
console.info("inputMethod_test_EXCEPTION_CONTROLLER_009 result:" + keyType);
expect(keyType).assertEqual(12800006);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_SETTINGS_010
* @tc.name Errorcode 12800007. Input method settings extension error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_SETTINGS_010', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_SETTINGS;
console.info("inputMethod_test_EXCEPTION_SETTINGS_010 result:" + keyType);
expect(keyType).assertEqual(12800007);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_IMMS_011
* @tc.name Errorcode 12800008. Input method manager service error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_IMMS_011', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_IMMS;
console.info("inputMethod_test_EXCEPTION_IMMS_011 result:" + keyType);
expect(keyType).assertEqual(12800008);
done();
});
/*
* @tc.number inputMethod_test_EXCEPTION_OTHERS_012
* @tc.name Errorcode 12899999. Others error.
* @tc.desc Function test
* @tc.level 2
*/
it('inputMethod_test_EXCEPTION_OTHERS_012', 0, async function (done) {
let keyType = inputMethod.EXCEPTION_OTHERS;
console.info("inputMethod_test_EXCEPTION_OTHERS_012 result:" + keyType);
expect(keyType).assertEqual(12899999);
done();
});
});
};
request/RequestTest_ets/entry/src/main/ets/test/requestUpload.test.ets
浏览文件 @
66932dce
...
...
@@ -213,6 +213,43 @@ export default function requestUploadJSUnit() {
console.info("-----------------------SUB_REQUEST_UPLOAD_API_0005 end-----------------------");
done();
});
/**
* @tc.number SUB_REQUEST_UPLOAD_API_0006
* @tc.name Test requestUploadTest type = TIMER_TYPE_REALTIME
* @tc.desc Test requestUploadTest API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_REQUEST_UPLOAD_API_0006', 0, async function (done) {
console.info("-----------------------SUB_REQUEST_UPLOAD_API_0006 is starting-----------------------");
try {
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_PERMISSION:" + request.EXCEPTION_PERMISSION);
expect(request.EXCEPTION_PERMISSION).assertEqual(201);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_PARAMCHECK:" + request.EXCEPTION_PARAMCHECK);
expect(request.EXCEPTION_PARAMCHECK).assertEqual(401);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_UNSUPPORTED:" + request.EXCEPTION_UNSUPPORTED);
expect(request.EXCEPTION_UNSUPPORTED).assertEqual(801);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_FILEIO:" + request.EXCEPTION_FILEIO);
expect(request.EXCEPTION_FILEIO).assertEqual(13400001);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_FILEPATH:" + request.EXCEPTION_FILEPATH);
expect(request.EXCEPTION_FILEPATH).assertEqual(13400002);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_SERVICE:" + request.EXCEPTION_SERVICE);
expect(request.EXCEPTION_SERVICE).assertEqual(13400003);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.EXCEPTION_OTHERS:" + request.EXCEPTION_OTHERS);
expect(request.EXCEPTION_OTHERS).assertEqual(13499999);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.ERROR_OFFLINE:" + request.ERROR_OFFLINE);
expect(request.ERROR_OFFLINE).assertEqual(9);
console.info("SUB_REQUEST_UPLOAD_API_0006 request.ERROR_UNSUPPORTED_NETWORK_TYPE:" + request.ERROR_UNSUPPORTED_NETWORK_TYPE);
expect(request.ERROR_UNSUPPORTED_NETWORK_TYPE).assertEqual(10);
} catch (err) {
expect(true).assertEqual(true);
console.error("SUB_REQUEST_UPLOAD_API_0006 error: " + err);
}
console.info("-----------------------SUB_REQUEST_UPLOAD_API_0006 end-----------------------");
done();
});
/**
* @tc.number SUB_REQUEST_UPLOAD_API_CALLBACK_0001
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录