Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
08717544
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看板
未验证
提交
08717544
编写于
9月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5458 【杂散】【输入法框架】补充分布式输入框架API接口
Merge pull request !5458 from 张育帅/master
上级
d93b8ba6
fa218f01
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
71 addition
and
4 deletion
+71
-4
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
...hodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
+71
-4
未找到文件。
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
浏览文件 @
08717544
...
@@ -84,10 +84,10 @@ export default function inputMethodJSUnit() {
...
@@ -84,10 +84,10 @@ export default function inputMethodJSUnit() {
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput().then(data => {
inputMethodCtrl.stopInput().then(data => {
console.info("inputmethoh_test_006 stopInput result----" + data);
console.info("inputmethoh_test_006 stopInput result----" + data);
expect(data == true).assertTrue()
expect(data == true).assertTrue()
;
}).catch(err => {
}).catch(err => {
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertFail()
expect().assertFail()
;
});
});
done();
done();
});
});
...
@@ -118,12 +118,12 @@ export default function inputMethodJSUnit() {
...
@@ -118,12 +118,12 @@ export default function inputMethodJSUnit() {
packageName:"com.example.kikakeyboard",
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
methodId:"ServiceExtAbility"
}
}
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue();
expect(data == true).assertTrue();
}).catch( err=> {
}).catch( err=> {
console.info("inputmethod_test_switchInputMethod_001 err:" + err)
console.info("inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail();
})
})
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
done();
...
@@ -144,7 +144,7 @@ export default function inputMethodJSUnit() {
...
@@ -144,7 +144,7 @@ export default function inputMethodJSUnit() {
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
if(err){
if(err){
console.info("inputmethod_test_switchInputMethod_002 error:" + err);
console.info("inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail()
expect().assertFail()
;
}
}
console.info("inputmethod_test_switchInputMethod_002 data:" + data)
console.info("inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue();
expect(data == true).assertTrue();
...
@@ -164,8 +164,10 @@ export default function inputMethodJSUnit() {
...
@@ -164,8 +164,10 @@ export default function inputMethodJSUnit() {
inputMethodCtrl.showSoftKeyboard((data)=>{
inputMethodCtrl.showSoftKeyboard((data)=>{
if(data == undefined){
if(data == undefined){
console.info("showSoftKeyboard callbace success" );
console.info("showSoftKeyboard callbace success" );
expect(true).assertTrue();
}else{
}else{
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err))
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err))
expect().assertFail();
}
}
});
});
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************");
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************");
...
@@ -182,8 +184,10 @@ export default function inputMethodJSUnit() {
...
@@ -182,8 +184,10 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController()
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then((data) =>{
inputMethodCtrl.showSoftKeyboard().then((data) =>{
console.info("showSoftKeyboard promise success" );
console.info("showSoftKeyboard promise success" );
expect(true).assertTrue();
}).catch((err) => {
}).catch((err) => {
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err))
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail();
})
})
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
done();
...
@@ -200,8 +204,10 @@ export default function inputMethodJSUnit() {
...
@@ -200,8 +204,10 @@ export default function inputMethodJSUnit() {
inputMethodCtrl.hideSoftKeyboard((data)=>{
inputMethodCtrl.hideSoftKeyboard((data)=>{
if(data == undefined){
if(data == undefined){
console.info("hideSoftKeyboard callbace success" );
console.info("hideSoftKeyboard callbace success" );
expect(true).assertTrue();
}else{
}else{
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err))
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err))
expect().assertFail();
}
}
});
});
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
...
@@ -218,11 +224,72 @@ export default function inputMethodJSUnit() {
...
@@ -218,11 +224,72 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController()
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then((data) =>{
inputMethodCtrl.hideSoftKeyboard().then((data) =>{
console.info("hideSoftKeyboard promise success" );
console.info("hideSoftKeyboard promise success" );
expect(true).assertTrue();
}).catch((err) => {
}).catch((err) => {
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail();
})
})
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
done();
});
});
/*
* @tc.number inputmethod_test_getCurrentInputMethod_001
* @tc.name return The InputMethodProperty object of the current input method.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_getCurrentInputMethod_001', 0, async function (done) {
let currentIme = inputMethod.getCurrentInputMethod();
console.info("inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme));
console.info(currentIme.packageName);
console.info(currentIme.methodId);
expect(currentIme.packageName != null).assertTrue();
expect(currentIme.methodId != null).assertTrue();
console.info("************* inputmethod_test_getCurrentInputMethod_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_listInputMethod_001
* @tc.name param enable :
* if true, collect enabled input methods.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_listInputMethod_001', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_listInputMethod_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod(true, (err, arr) => {
if (err) {
console.error("inputmethod_test_listInputMethod_001 failed because: " + JSON.stringify(err));
expect().assertFail();
};
console.info("inputmethod_test_listInputMethod_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
});
/*
* @tc.number inputmethod_test_listInputMethod_002
* @tc.name param enable :
* if false, collect disabled input methods.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_listInputMethod_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_listInputMethod_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod(false, (err, arr) => {
if (err) {
console.error("inputmethod_test_listInputMethod_002 failed because: " + JSON.stringify(err));
expect().assertFail();
};
console.info("inputmethod_test_listInputMethod_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
});
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录