Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
225ddfc6
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看板
未验证
提交
225ddfc6
编写于
8月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5101 【杂散】【输入法框架】【主题】新增API接口和属性,以及接口修改后的用例适配,挑单合入到monthly
Merge pull request !5101 from 张育帅/cherry-pick-1661218733
上级
0dcf7a2b
b6cba04a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
170 addition
and
20 deletion
+170
-20
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
...hodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
+123
-18
theme/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets
...e/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets
+47
-2
未找到文件。
inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets
浏览文件 @
225ddfc6
...
...
@@ -23,7 +23,7 @@ export default function inputMethodJSUnit() {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod((arr) => {
console.info("
inputmethoh_test_001
listInputMethod result---" + JSON.stringify(arr));
console.info("
appInfoTest_input_2
listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue();
});
done();
...
...
@@ -32,17 +32,19 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
let promise = inputMethodSetting.listInputMethod();
console.info("inputmethoh_test_002 listInputMethod result---" + JSON.stringify(promise));
if (promise.length > 0){
let obj = promise[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue();
}else{
console.info("inputmethoh_test_002 listInputMethod is null");
except().assertFail()
}
inputMethodSetting.listInputMethod().then(inputMethodProperty => {
if (inputMethodProperty.length > 0){
let obj = inputMethodProperty[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue();
}else{
console.info("inputmethoh_test_002 listInputMethod is null");
expect().assertFail()
}
}).catch(err => {
console.info("inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
});
done();
});
...
...
@@ -58,9 +60,13 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
let promise = inputMethodSetting.displayOptionalInputMethod();
console.info("inputmethoh_test_004 displayOptionalInputMethod result---" + JSON.stringify(promise));
expect(promise).assertEqual(undefined)
inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is called");
expect(true).assertTrue()
}).catch(err => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
expect().assertFail()
});
done();
});
...
...
@@ -76,9 +82,13 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
let promise = inputMethodCtrl.stopInput();
console.info("inputmethoh_test_006 inputMethodCtrl stopInput result---" + JSON.stringify(promise));
expect(promise).assertEqual(true)
inputMethodCtrl.stopInput().then(data => {
console.info("inputmethoh_test_006 stopInput result----" + data);
expect(data == true).assertTrue()
}).catch(err => {
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertFail()
});
done();
});
...
...
@@ -96,6 +106,29 @@ export default function inputMethodJSUnit() {
done();
});
/*
* @tc.number inputmethod_test_switchInputMethod_001
* @tc.name Test Indicates the input method which will replace the current one.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_switchInputMethod_001', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_001 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
}
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue();
}).catch( err=> {
console.info("inputmethod_test_switchInputMethod_001 err:" + err)
})
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_switchInputMethod_002
* @tc.name Test Indicates the input method which will replace the current one.
...
...
@@ -119,5 +152,77 @@ export default function inputMethodJSUnit() {
console.info("************* inputmethod_test_switchInputMethod_002 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will show softboard with calback.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_showSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((data)=>{
if(data == undefined){
console.info("showSoftKeyboard callbace success" );
}else{
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err))
}
});
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will show softboard with Promise.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then((data) =>{
console.info("showSoftKeyboard promise success" );
}).catch((err) => {
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err))
})
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will hide softboard with calback.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_hideSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard((data)=>{
if(data == undefined){
console.info("hideSoftKeyboard callbace success" );
}else{
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err))
}
});
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will hide softboard with Promise.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then((data) =>{
console.info("hideSoftKeyboard promise success" );
}).catch((err) => {
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
})
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
});
})
}
theme/wallpaper_ets/entry/src/main/ets/test/wallpaperTest.ets
浏览文件 @
225ddfc6
...
...
@@ -73,15 +73,20 @@ export default function wallpaperJSUnit() {
* @tc.level 0
*/
it('testGetColorsCallbackSystem101', 0, async function (done) {
await wallpaper.getColors(WALLPAPER_SYSTEM, function (err, data) {
let RgbaColor = {
red:data[0][0],
green:data[0][1],
blue:data[0][2],
alpha:data[0][3]
}
console.info('wallpaperXTS ===> testGetColorsCallbackSystem err : ' + JSON.stringify(err));
console.info('wallpaperXTS ===> testGetColorsCallbackSystem data : ' + JSON.stringify(data));
console.info('wallpaperXTS ===> testGetColorsCallbackSystem data : ' + data[0][0]);
console.info('wallpaperXTS ===> testGetColorsCallbackSystem data : ' + data[0][1]);
console.info('wallpaperXTS ===> testGetColorsCallbackSystem data : ' + data[0][2]);
console.info('wallpaperXTS ===> testGetColorsCallbackSystem data : ' + data[0][3]);
if (err) {
expect(null).assertFail();
}
...
...
@@ -610,5 +615,45 @@ export default function wallpaperJSUnit() {
})
done();
})
/*
* @tc.number testGetFileCallback101
* @tc.name Obtains a file of the wallpaper of the specified type.
* @tc.desc Function test
* @tc.level 0
*/
it('testGetFileCallback101', 0, async function (done) {
wallpaper.getFile(WALLPAPER_SYSTEM, (error, data) => {
if (error) {
console.error("callback failed to getFile because: " + JSON.stringify(error));
expect().assertFail()
}else{
expect(typeof data == "number").assertTrue();
expect(!isNaN(data)).assertTrue();
console.info("callback success to getFile: " + JSON.stringify(data));
done()
}
});
done();
})
/*
* @tc.number testGetFilePromise101
* @tc.name Obtains a file of the wallpaper of the specified type.
* @tc.desc Function test
* @tc.level 0
*/
it('testGetFilePromise101', 0, async function (done) {
wallpaper.getFile(WALLPAPER_SYSTEM).then((data) => {
expect(typeof data == "number").assertTrue();
expect(!isNaN(data)).assertTrue();
console.info("promise success to getFile: " + JSON.stringify(data));
done()
}).catch((error) => {
console.error("promise failed to getFile because: " + JSON.stringify(error));
expect().assertFail()
});
done();
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录