Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
097f5c1b
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看板
提交
097f5c1b
编写于
4月 17, 2023
作者:
Z
zhangyushuai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add setCallingWindow test 002
Signed-off-by:
N
zhangyushuai
<
zhangyushuai1@huawei.com
>
上级
5a2d74b1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
86 addition
and
1 deletion
+86
-1
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
...entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
+24
-1
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
...ngine/entry/src/main/ets/test/inputMethodAbility.test.ets
+62
-0
未找到文件。
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
浏览文件 @
097f5c1b
...
...
@@ -168,6 +168,10 @@ export class KeyboardDelegate {
console
.
debug
(
TAG
+
'
====>inputMethodAbility_test_073 event:
'
+
data
.
event
);
that
.
inputMethodAbility_test_073
();
break
;
case
74
:
console
.
debug
(
TAG
+
'
====>inputMethodAbility_test_074 event:
'
+
data
.
event
);
that
.
inputMethodAbility_test_074
();
break
;
case
101
:
console
.
debug
(
TAG
+
'
====>inputMethodAbility_test_0101 event:
'
+
data
.
event
);
that
.
inputMethodAbility_test_101
();
...
...
@@ -968,7 +972,7 @@ export class KeyboardDelegate {
});
let
t
=
setTimeout
(()
=>
{
if
(
count
===
3
){
if
(
count
===
2
){
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
...
...
@@ -1067,6 +1071,25 @@ export class KeyboardDelegate {
},
500
);
}
private
inputMethodAbility_test_074
():
void
{
let
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive inputMethodAbility_test_074 success
'
);
inputMethodAbility
.
on
(
'
setCallingWindow
'
,
(
wid
)
=>
{
console
.
info
(
TAG
+
"
====>inputKeyboardDelegate.on('setCallingWindow')
"
+
wid
);
inputMethodAbility
.
off
(
'
setCallingWindow
'
,
()
=>
{
console
.
log
(
'
inputMethodAbility off setCallingWindow
'
);
});
if
(
typeof
(
wid
)
===
"
number
"
){
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
}
commoneventmanager
.
publish
(
"
inputMethodAbility_test_074
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
private
inputMethodAbility_test_101
():
void
{
console
.
debug
(
TAG
+
'
====>receive inputMethodAbility_test_101 data
'
);
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
...
...
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
浏览文件 @
097f5c1b
...
...
@@ -1817,6 +1817,68 @@ export default function inputMethodAbility() {
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'inputMethodAbility_test_074'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>inputMethodAbility_test_074 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>inputMethodAbility_test_074 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>inputMethodAbility_test_074 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>inputMethodAbility_test_074 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>inputMethodAbility_test_074 end"
);
clearTimeout
(
t
);
done
();
}
catch
(
err
){
console
.
info
(
"====>inputMethodAbility_test_074 err:"
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
);
done
();
}
},
500
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>inputMethodAbility_test_074 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>inputMethodAbility_test_074 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
let
count
=
0
;
let
t
=
setInterval
(()
=>
{
count
+=
1
;
runCmd
(
getFocusCmd
);
if
(
count
===
2
){
clearInterval
(
t
);
}
},
500
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"inputMethodAbility_test_074"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>inputMethodAbility_test_074 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>inputMethodAbility_test_074 subscriber finish"
);
})
var
commonEventPublishData
=
{
code
:
74
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'inputMethodAbility_test_101'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>inputMethodAbility_test_101 unSubscriberCallback start"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录