Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8aea518b
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看板
提交
8aea518b
编写于
6月 06, 2023
作者:
Z
zhangyushuai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
覆盖input属性和接口 001
Signed-off-by:
N
zhangyushuai
<
zhangyushuai1@huawei.com
>
上级
979060cf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
3 deletion
+89
-3
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts
...ntry/src/main/ets/InputMethodEngine/KeyboardController.ts
+5
-3
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
...ngine/entry/src/main/ets/test/inputMethodAbility.test.ets
+1
-0
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets
..._Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets
+83
-0
未找到文件。
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodEngine/KeyboardController.ts
浏览文件 @
8aea518b
...
@@ -305,7 +305,7 @@ export class KeyboardController {
...
@@ -305,7 +305,7 @@ export class KeyboardController {
}
else
{
}
else
{
let
editorAttribyte
=
await
InputClient
.
getEditorAttribute
();
let
editorAttribyte
=
await
InputClient
.
getEditorAttribute
();
console
.
debug
(
TAG
+
'
====>inputMethodEngine_test_029 editorAttribyte:
'
+
JSON
.
stringify
(
editorAttribyte
));
console
.
debug
(
TAG
+
'
====>inputMethodEngine_test_029 editorAttribyte:
'
+
JSON
.
stringify
(
editorAttribyte
));
let
value
=
await
InputClient
.
sendKeyFunction
(
editorAttribyte
.
enterKeyType
);
let
value
=
await
InputClient
.
sendKeyFunction
(
editorAttribyte
.
inputPattern
);
console
.
debug
(
TAG
+
'
====>inputMethodEngine_test_029 sendKeyFunction:
'
+
JSON
.
stringify
(
value
));
console
.
debug
(
TAG
+
'
====>inputMethodEngine_test_029 sendKeyFunction:
'
+
JSON
.
stringify
(
value
));
if
(
value
){
if
(
value
){
commonEventPublishData
=
{
commonEventPublishData
=
{
...
@@ -867,7 +867,8 @@ export class KeyboardController {
...
@@ -867,7 +867,8 @@ export class KeyboardController {
inputKeyboardDelegate
.
on
(
'
keyDown
'
,
(
keyEvent
)
=>
{
inputKeyboardDelegate
.
on
(
'
keyDown
'
,
(
keyEvent
)
=>
{
inputKeyboardDelegate
.
off
(
'
keyDown
'
);
inputKeyboardDelegate
.
off
(
'
keyDown
'
);
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.on('keyDown') count:
"
+
count
);
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.on('keyDown') count:
"
+
count
);
if
(
keyEvent
.
keyCode
===
2000
){
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.keyEvent.keyAction
"
+
keyEvent
.
keyAction
);
if
(
keyEvent
.
keyCode
===
2000
&&
keyEvent
.
keyAction
===
2
){
count
+=
1
;
count
+=
1
;
}
}
return
true
;
return
true
;
...
@@ -875,7 +876,8 @@ export class KeyboardController {
...
@@ -875,7 +876,8 @@ export class KeyboardController {
inputKeyboardDelegate
.
on
(
'
keyUp
'
,
(
keyEvent
)
=>
{
inputKeyboardDelegate
.
on
(
'
keyUp
'
,
(
keyEvent
)
=>
{
inputKeyboardDelegate
.
off
(
'
keyUp
'
);
inputKeyboardDelegate
.
off
(
'
keyUp
'
);
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.on('keyUp') count:
"
+
count
);
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.on('keyUp') count:
"
+
count
);
if
(
keyEvent
.
keyCode
===
2000
){
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.keyEvent.keyAction
"
+
keyEvent
.
keyAction
);
if
(
keyEvent
.
keyCode
===
2000
&&
keyEvent
.
keyAction
===
3
){
count
+=
1
;
count
+=
1
;
}
}
return
true
;
return
true
;
...
...
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
浏览文件 @
8aea518b
...
@@ -1878,5 +1878,6 @@ export default function inputMethodAbility() {
...
@@ -1878,5 +1878,6 @@ export default function inputMethodAbility() {
}
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
});
});
});
};
};
inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets
浏览文件 @
8aea518b
...
@@ -19,6 +19,31 @@ import subtype from '@ohos.InputMethodSubtype';
...
@@ -19,6 +19,31 @@ import subtype from '@ohos.InputMethodSubtype';
export default function inputMethodStageJSUnit() {
export default function inputMethodStageJSUnit() {
describe('inputMethodTest', function () {
describe('inputMethodTest', function () {
console.info("====>************* settings Test start*************");
console.info("====>************* settings Test start*************");
var inputServer = {
packageName: '',
methodId: '',
name:'',
id:'',
extra:{}
}
var inputServerCopy = {
packageName : "com.acts.imeability.test",
methodId : "com.acts.imeability.test.ImExtAbility",
name:"com.acts.imeability.test",
id:"com.acts.imeability.test.ImExtAbility",
extra:{}
}
beforeAll(async (done)=>{
let inputM = inputMethod.getCurrentInputMethod()
console.info("====>beforeAll: switchInputMethod to: " + JSON.stringify(inputM));
inputServer.packageName = inputM.packageName;
inputServer.methodId = inputM.methodId;
inputServer.name = inputM.packageName;
inputServer.id = inputM.methodId;
})
/*
/*
* @tc.number inputMethod_test_getController_001
* @tc.number inputMethod_test_getController_001
* @tc.name get inputMethod controller
* @tc.name get inputMethod controller
...
@@ -608,5 +633,63 @@ export default function inputMethodStageJSUnit() {
...
@@ -608,5 +633,63 @@ export default function inputMethodStageJSUnit() {
})
})
});
});
it('Sub_Misc_inputMethod_onImeChange_0150', 0, async function (done) {
let inputMethodSetting = inputMethod.getSetting();
inputMethodSetting.on("imeChange", async (inputMethodProperty, inputMethodSubtype) => {
inputMethodSetting.off("imeChange");
let t = setTimeout(async () => {
clearTimeout(t);
await inputMethod.switchInputMethod(inputServer);
console.info("====>Sub_Misc_inputMethod_onImeChange_0150 inputMethodProperty:" + JSON.stringify(inputServerCopy));
console.info("====>Sub_Misc_inputMethod_onImeChange_0150 inputMethodSubtype:" + JSON.stringify(inputMethodSubtype));
expect(typeof(inputMethodProperty) !== null).assertTrue();
expect(typeof(inputMethodSubtype) !== null).assertTrue();
done();
},200);
})
try {
await inputMethod.switchInputMethod(inputServerCopy);
console.info("====>Sub_Misc_inputMethod_onImeChange_0150 switchInputMethod success" + JSON.stringify(inputServer));
} catch (err) {
console.info("====>Sub_Misc_inputMethod_onImeChange_0150 switchInputMethod fail" + JSON.stringify(err));
}
});
it('Sub_Misc_inputMethod_offImeChange_0160', 0, async function (done) {
let count = 0;
let inputMethodSetting = inputMethod.getSetting();
inputMethodSetting.on("imeChange", (inputMethodProperty, inputMethodSubtype) => {
inputMethodSetting.off("imeChange");
count += 1;
console.info("====>Sub_Misc_inputMethod_offImeChange_0160 count:" + count);
})
try {
console.info('====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod 001');
let t = setTimeout(async () => {
clearTimeout(t);
await inputMethod.switchInputMethod(inputServerCopy);
},200);
console.info('====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod 002');
let t1 = setTimeout(async () => {
clearTimeout(t1);
await inputMethod.switchInputMethod(inputServer);
},200);
} catch (err) {
console.info("====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod fail" + JSON.stringify(err));
}
let t = setTimeout(() => {
clearTimeout(t);
try {
console.info('====>Sub_Misc_inputMethod_offImeChange_0160 setTimeout count: ' + count);
expect(count === 1).assertTrue();
} catch (err) {
console.info("====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod fail" + JSON.stringify(err));
}
done();
},1000);
});
});
});
};
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录