Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
201ddbe1
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看板
提交
201ddbe1
编写于
4月 28, 2023
作者:
Z
zhangyushuai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add inputmethodWindManage testcases 002
Signed-off-by:
N
zhangyushuai
<
zhangyushuai1@huawei.com
>
上级
4fdca903
变更
23
显示空白变更内容
内联
并排
Showing
23 changed file
with
2870 addition
and
1 deletion
+2870
-1
inputmethod/BUILD.gn
inputmethod/BUILD.gn
+1
-0
inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json
...tMethodEngine/AppScope/resources/base/element/string.json
+1
-1
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
...entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
+190
-0
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
...ngine/entry/src/main/ets/test/inputMethodAbility.test.ets
+310
-0
inputmethod/InputMethodWindManage/AppScope/app.json
inputmethod/InputMethodWindManage/AppScope/app.json
+21
-0
inputmethod/InputMethodWindManage/AppScope/resources/base/element/string.json
...hodWindManage/AppScope/resources/base/element/string.json
+8
-0
inputmethod/InputMethodWindManage/AppScope/resources/base/media/app_icon.png
...thodWindManage/AppScope/resources/base/media/app_icon.png
+0
-0
inputmethod/InputMethodWindManage/BUILD.gn
inputmethod/InputMethodWindManage/BUILD.gn
+43
-0
inputmethod/InputMethodWindManage/Test.json
inputmethod/InputMethodWindManage/Test.json
+29
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/Application/AbilityStage.ts
...WindManage/entry/src/main/ets/Application/AbilityStage.ts
+23
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/InputMethodWindService.ts
.../main/ets/InputMethodWindManage/InputMethodWindService.ts
+31
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/KeyboardController.ts
.../src/main/ets/InputMethodWindManage/KeyboardController.ts
+836
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/MainAbility/MainAbility.ts
...dWindManage/entry/src/main/ets/MainAbility/MainAbility.ts
+51
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ge/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/index/index.ets
...MethodWindManage/entry/src/main/ets/pages/index/index.ets
+67
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/second/second.ets
...thodWindManage/entry/src/main/ets/pages/second/second.ets
+43
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/test/InputMethodWindManage.test.ets
...ge/entry/src/main/ets/test/InputMethodWindManage.test.ets
+1023
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/test/List.test.ets
...putMethodWindManage/entry/src/main/ets/test/List.test.ets
+19
-0
inputmethod/InputMethodWindManage/entry/src/main/module.json
inputmethod/InputMethodWindManage/entry/src/main/module.json
+54
-0
inputmethod/InputMethodWindManage/entry/src/main/resources/base/element/string.json
...dManage/entry/src/main/resources/base/element/string.json
+36
-0
inputmethod/InputMethodWindManage/entry/src/main/resources/base/media/icon.png
...odWindManage/entry/src/main/resources/base/media/icon.png
+0
-0
inputmethod/InputMethodWindManage/entry/src/main/resources/base/profile/main_pages.json
...age/entry/src/main/resources/base/profile/main_pages.json
+6
-0
inputmethod/InputMethodWindManage/signature/ActsInputMethodWindManageTest.p7b
...hodWindManage/signature/ActsInputMethodWindManageTest.p7b
+0
-0
未找到文件。
inputmethod/BUILD.gn
浏览文件 @
201ddbe1
...
...
@@ -19,5 +19,6 @@ group("inputmethod") {
"InputMethodEngine:ActsInputMethodEngineTest",
"InputMethodTest_Stage:ActsImeAbilityTest",
"InputMethodTest_ets:ActsInputMethodEtsTest",
"InputMethodWindManage:ActsInputMethodWindManageTest",
]
}
inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json
浏览文件 @
201ddbe1
...
...
@@ -2,7 +2,7 @@
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"
ohosProjec
t"
"value"
:
"
ActsInputMethodEngineTes
t"
}
]
}
\ No newline at end of file
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
浏览文件 @
201ddbe1
...
...
@@ -196,6 +196,22 @@ export class KeyboardDelegate {
console
.
debug
(
TAG
+
'
====>inputMethodAbility_test_0106 event:
'
+
data
.
event
);
that
.
inputMethodAbility_test_106
();
break
;
case
110
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByRange_0110 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_onSelectByRange_0110
();
break
;
case
120
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByMovement_0120 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_onSelectByMovement_0120
();
break
;
case
130
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByRange_0130 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_offSelectByRange_0130
();
break
;
case
140
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_offSelectByMovement_0140
();
break
;
}
}
...
...
@@ -1299,4 +1315,178 @@ export class KeyboardDelegate {
}
});
}
private
Sub_Misc_inputMethod_onSelectByRange_0110
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByRange_0110 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByRange_0110 success inputStart
'
);
let
commonEventPublishData
;
let
range
=
{
start
:
0
,
end
:
10
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByRange_0110 selectByRange success
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
await
InputClient
.
selectByRange
(
range
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByRange_0110 selectByRange catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByRange_0110 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_onSelectByMovement_0120
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByMovement_0120 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByMovement_0120 success inputStart
'
);
let
commonEventPublishData
;
let
movement
=
{
direction
:
inputMethodEngine
.
CURSOR_DOWN
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement success
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
await
InputClient
.
selectByMovement
(
movement
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByMovement_0120 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_offSelectByRange_0130
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByRange_0130 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByRange_0130 success inputStart
'
);
let
commonEventPublishData
;
let
timeCount
=
0
;
let
range
=
{
start
:
0
,
end
:
10
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange in
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
let
t1
=
setInterval
(
async
()
=>
{;
await
InputClient
.
selectByRange
(
range
);
timeCount
+=
1
;
console
.
info
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 this.softKeyboardPanel.hide setInterval timeCount:
'
+
timeCount
);
if
(
timeCount
===
2
){
clearInterval
(
t1
);
}
},
100
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByRange_0130 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_offSelectByMovement_0140
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByMovement_0140 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByMovement_0140 success inputStart
'
);
let
commonEventPublishData
;
let
timeCount
=
0
;
let
movement
=
{
direction
:
inputMethodEngine
.
CURSOR_DOWN
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement in
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
let
t1
=
setInterval
(
async
()
=>
{;
await
InputClient
.
selectByMovement
(
movement
);
timeCount
+=
1
;
console
.
info
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 this.softKeyboardPanel.hide setInterval timeCount:
'
+
timeCount
);
if
(
timeCount
===
2
){
clearInterval
(
t1
);
}
},
100
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByMovement_0140 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
}
\ No newline at end of file
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
浏览文件 @
201ddbe1
...
...
@@ -30,9 +30,18 @@ export default function inputMethodAbility() {
extra
:
{}
}
var
inputServerCopy
=
{
packageName
:
''
,
methodId
:
''
,
name
:
''
,
id
:
''
,
extra
:
{}
}
let
display_info
;
let
getFocusCmd
=
''
;
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
inputMethodController
=
inputMethod
.
getController
();
async
function
runCmd
(
cmd
){
console
.
debug
(
'====>runCmd info:'
+
cmd
);
await
abilityDelegator
.
executeShellCommand
(
cmd
);
...
...
@@ -67,6 +76,12 @@ export default function inputMethodAbility() {
}
catch
(
err
){
console
.
debug
(
"====>beforeAll inputMethodStageJSUnit switchCurrentInputMethodSubtype failed"
);
}
let
inputCurrent
=
inputMethod
.
getCurrentInputMethod
();
inputServerCopy
.
packageName
=
inputCurrent
.
packageName
;
inputServerCopy
.
methodId
=
inputCurrent
.
methodId
;
inputServerCopy
.
name
=
inputCurrent
.
packageName
;
inputServerCopy
.
id
=
inputCurrent
.
methodId
;
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0010 restore to: "
+
JSON
.
stringify
(
inputServerCopy
));
})
afterAll
(
async
(
done
)
=>
{
...
...
@@ -2208,5 +2223,300 @@ export default function inputMethodAbility() {
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_onSelectByRange_0110'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_onSelectByRange_0110"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 subscriber finish"
)
})
inputMethodController
.
on
(
"selectByRange"
,
async
(
range
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByRange_0110 onSelectByRange start'
);
inputMethodController
.
off
(
"selectByRange"
);
try
{
expect
(
range
.
start
)
.
assertEqual
(
0
);
expect
(
range
.
end
)
.
assertEqual
(
10
);
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByRange_0110 Succeed onSelectByRange: '
+
JSON
.
stringify
(
range
));
done
();
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByRange_0110 selectByRange success'
);
done
();
}
});
var
commonEventPublishData
=
{
code
:
110
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_onSelectByMovement_0120'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_onSelectByMovement_0120"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 subscriber finish"
)
})
inputMethodController
.
on
(
"selectByMovement"
,
async
(
movement
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement start'
);
inputMethodController
.
off
(
"selectByMovement"
);
try
{
expect
(
movement
.
direction
)
.
assertEqual
(
2
);
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByMovement_0120 Succeed onSelectByMovement: '
+
JSON
.
stringify
(
movement
));
done
();
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement catch err: '
+
JSON
.
stringify
(
err
));
done
();
}
});
var
commonEventPublishData
=
{
code
:
120
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_offSelectByRange_0130'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_offSelectByRange_0130"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 subscriber finish"
)
})
let
count
=
0
;
inputMethodController
.
on
(
"selectByRange"
,
async
(
movement
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange start'
);
inputMethodController
.
off
(
"selectByRange"
);
count
+=
1
;
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 Succeed offSelectByRange: '
+
JSON
.
stringify
(
movement
));
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 count: '
+
count
);
});
let
t
=
setTimeout
(()
=>
{
try
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 setTimeout count: '
+
count
);
expect
(
count
)
.
assertEqual
(
1
);
clearTimeout
(
t
);
done
();
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 Succeed offSelectByRange '
);
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange err: '
+
JSON
.
stringify
(
err
));
done
();
}
},
500
);
var
commonEventPublishData
=
{
code
:
130
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_offSelectByMovement_0140'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_offSelectByMovement_0140"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 subscriber finish"
)
})
let
count
=
0
;
inputMethodController
.
on
(
"selectByMovement"
,
async
(
movement
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement start'
);
inputMethodController
.
off
(
"selectByMovement"
);
count
+=
1
;
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 Succeed offSelectByMovement: '
+
JSON
.
stringify
(
movement
));
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 count: '
+
count
);
});
let
t
=
setTimeout
(()
=>
{
try
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 setTimeout count: '
+
count
);
expect
(
count
)
.
assertEqual
(
1
);
clearTimeout
(
t
);
done
();
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 Succeed offSelectByMovement '
);
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement err: '
+
JSON
.
stringify
(
err
));
done
();
}
},
500
);
var
commonEventPublishData
=
{
code
:
140
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_onImeChange_0150'
,
0
,
async
function
(
done
)
{
let
inputMethodSetting
=
inputMethod
.
getSetting
();
inputMethodSetting
.
on
(
"imeChange"
,
(
inputMethodProperty
,
inputMethodSubtype
)
=>
{
inputMethodSetting
.
off
(
"imeChange"
);
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 inputMethodProperty:"
+
JSON
.
stringify
(
inputMethodProperty
));
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 inputMethodSubtype:"
+
JSON
.
stringify
(
inputMethodSubtype
));
expect
(
typeof
(
inputMethodProperty
)
!==
null
)
.
assertTrue
();
expect
(
typeof
(
inputMethodSubtype
)
!==
null
)
.
assertTrue
();
done
();
})
try
{
await
inputMethod
.
switchInputMethod
(
inputServer
);
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 switchInputMethod success"
+
JSON
.
stringify
(
inputServer
));
await
inputMethod
.
switchInputMethod
(
inputServerCopy
);
}
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
{
await
inputMethod
.
switchInputMethod
(
inputServer
);
console
.
info
(
'====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod'
);
let
t
=
setTimeout
(
async
()
=>
{
clearTimeout
(
t
);
await
inputMethod
.
switchInputMethod
(
inputServerCopy
);
},
100
);
}
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
();
},
500
);
});
});
};
inputmethod/InputMethodWindManage/AppScope/app.json
0 → 100644
浏览文件 @
201ddbe1
{
"app"
:{
"bundleName"
:
"com.acts.inputmethodwidmanage.test"
,
"vendor"
:
"hw"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
inputmethod/InputMethodWindManage/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
201ddbe1
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ActsInputMethodWindManageTest"
}
]
}
\ No newline at end of file
inputmethod/InputMethodWindManage/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
201ddbe1
6.6 KB
inputmethod/InputMethodWindManage/BUILD.gn
0 → 100644
浏览文件 @
201ddbe1
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsInputMethodWindManageTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":IMExtAbility_ets_assets",
":IMExtAbility_resources",
]
ets2abc = true
certificate_profile = "signature/ActsInputMethodWindManageTest.p7b"
hap_name = "ActsInputMethodWindManageTest"
subsystem_name = "inputmethod"
part_name = "imf"
}
ohos_app_scope("IMExtAbility_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("IMExtAbility_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("IMExtAbility_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":IMExtAbility_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
inputmethod/InputMethodWindManage/Test.json
0 → 100644
浏览文件 @
201ddbe1
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"com.acts.inputmethodwidmanage.test"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
15000
},
"kits"
:
[
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
,
"uinput -T -m 300 720 300 360 200"
,
"uinput -T -m 650 2760 650 1380 200"
]
},
{
"test-file-name"
:
[
"ActsInputMethodWindManageTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
inputmethod/InputMethodWindManage/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
;
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
);
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/InputMethodWindService.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
InputMethodExtensionAbility
from
'
@ohos.InputMethodExtensionAbility
'
;
import
{
KeyboardController
}
from
'
./KeyboardController
'
;
export
default
class
inputMethodWindService
extends
InputMethodExtensionAbility
{
private
keyboardController
:
KeyboardController
;
onCreate
(
want
)
{
console
.
log
(
"
====>onCreate inputMethodWindService
"
);
this
.
keyboardController
=
new
KeyboardController
(
this
.
context
);
this
.
keyboardController
.
onCreate
();
// 初始化窗口
}
onDestroy
()
{
console
.
log
(
"
onDestroy inputMethodEngine**
"
);
this
.
context
.
destroy
();
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/KeyboardController.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
inputmethodengine
from
'
@ohos.inputMethodEngine
'
;
import
display
from
'
@ohos.display
'
;
import
windowManager
from
'
@ohos.window
'
;
import
commoneventmanager
from
'
@ohos.commonEventManager
'
;
import
prompt
from
'
@ohos.prompt
'
;
let
inputMethodAbility
=
inputmethodengine
.
getInputMethodAbility
();
const
TAG
=
"
keyboardController
"
;
const
SOFT_KEYBOARD
=
0
;
const
STATUS_BAR
=
1
;
const
FLG_FIXED
=
0
;
const
FLG_FLOATING
=
1
;
let
panelInfo
=
{
type
:
SOFT_KEYBOARD
,
flag
:
FLG_FLOATING
};
export
class
KeyboardController
{
mContext
;
storage
:
LocalStorage
;
WINDOW_TYPE_INPUT_METHOD_FLOAT
=
2105
;
windowName
=
'
inputApp
'
;
private
softKeyboardPanel
:
any
=
null
;
private
windowHeight
:
number
=
0
;
private
windowWidth
:
number
=
0
;
private
nonBarPosition
:
number
=
0
;
constructor
(
context
)
{
this
.
storage
=
new
LocalStorage
();
this
.
storage
.
setOrCreate
(
'
storageSimplePorp
'
,
121
);
this
.
mContext
=
context
;
let
display_info
=
display
.
getDefaultDisplaySync
();
this
.
windowWidth
=
display_info
.
width
*
0.3
;
this
.
windowHeight
=
display_info
.
height
*
0.35
;
}
public
onCreate
():
void
{
this
.
initWindow
();
let
that
=
this
;
inputMethodAbility
.
on
(
"
inputStop
"
,
()
=>
{
this
.
mContext
.
destroy
((
err
,
data
)
=>
{
console
.
info
(
TAG
+
'
====>inputMethodEngine destorey err:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
TAG
+
'
====>inputMethodEngine destorey data:
'
+
JSON
.
stringify
(
data
));
});
});
inputMethodAbility
.
createPanel
(
this
.
mContext
,
panelInfo
,
(
err
,
panel
)
=>
{
if
(
err
!==
undefined
)
{
console
.
info
(
'
Failed to create panel, err:
'
+
JSON
.
stringify
(
err
));
return
;
}
this
.
softKeyboardPanel
=
panel
;
console
.
info
(
'
Succeed in creating panel.
'
+
JSON
.
stringify
(
panel
));
});
function
subscriberCallback
(
err
,
data
)
{
console
.
debug
(
TAG
+
'
====>receive event err:
'
+
JSON
.
stringify
(
err
));
console
.
debug
(
TAG
+
'
====>receive event data
'
+
JSON
.
stringify
(
data
));
switch
(
data
.
code
)
{
case
10
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_createPanelCallback_0010
();
break
;
case
20
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_createPanelPromise_0020
();
break
;
case
30
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030
();
break
;
case
40
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040
();
break
;
case
50
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_setUiContentCallback_0050
();
break
;
case
60
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_setUiContentPromise_0060
();
break
;
case
80
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_setUiContentPromise_0080
();
break
;
case
90
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_resizeCallback_0090
();
break
;
case
100
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_resizePromise_0100 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_resizePromise_0100
();
break
;
case
90
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_resizeCallback_0090
();
break
;
case
100
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_resizePromise_0100 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_resizePromise_0100
();
break
;
case
110
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_moveToCallback_0110
();
break
;
case
120
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_moveToPromise_0120
();
break
;
case
130
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_showCallback_0130 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_showCallback_0130
();
break
;
case
140
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_showPromise_0140 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_showPromise_0140
();
break
;
case
150
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_hideCallback_0150 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_hideCallback_0150
();
break
;
case
160
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_hidePromise_0160 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_hidePromise_0160
();
break
;
case
170
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_onShow_0170 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_onShow_0170
();
break
;
case
180
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_onHide_0180 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_onHide_0180
();
break
;
case
210
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_Panel_changeFlag_0210 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_Panel_changeFlag_0210
();
break
;
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"
test
"
]
};
var
subscriber
commoneventmanager
.
createSubscriber
(
commonEventSubscribeInfo
).
then
(
function
(
data
)
{
subscriber
=
data
;
commoneventmanager
.
subscribe
(
subscriber
,
subscriberCallback
)
console
.
debug
(
TAG
+
'
====>scene subscribe finish====
'
);
})
}
public
onDestroy
():
void
{
console
.
log
(
'
imsakitjsapp onDestroy
'
);
globalThis
.
textInputClient
.
getTextIndexAtCursor
().
then
((
index
)
=>
{
console
.
log
(
'
imsakitjsapp getTextIndexAtCursor: index =
'
+
index
);
prompt
.
showToast
({
message
:
'
getTextIndexAtCursor success
'
+
index
,
duration
:
200
,
bottom
:
500
})
var
win
=
windowManager
.
findWindow
(
this
.
windowName
)
win
.
destroyWindow
()
this
.
mContext
.
terminateSelf
();
return
true
;
}).
catch
((
err
)
=>
{
prompt
.
showToast
({
message
:
'
getTextIndexAtCursor failed
'
,
duration
:
200
,
bottom
:
500
})
})
}
private
initWindow
():
void
{
display
.
getDefaultDisplay
().
then
(
dis
=>
{
var
dWidth
=
dis
.
width
;
var
dHeight
=
dis
.
height
;
var
keyHeightRate
=
0.47
;
var
keyHeight
=
dHeight
*
keyHeightRate
;
this
.
windowWidth
=
dWidth
;
this
.
windowHeight
=
keyHeight
;
this
.
nonBarPosition
=
dHeight
-
keyHeight
var
config
=
{
name
:
this
.
windowName
,
windowType
:
this
.
WINDOW_TYPE_INPUT_METHOD_FLOAT
,
ctx
:
this
.
mContext
};
windowManager
.
createWindow
(
config
).
then
((
win
)
=>
{
win
.
resize
(
dWidth
,
keyHeight
).
then
(()
=>
{
win
.
moveWindowTo
(
0
,
this
.
nonBarPosition
).
then
(()
=>
{
win
.
setUIContent
(
'
pages/service/index
'
).
then
(()
=>
{
});
});
});
});
});
}
private
publishCallback
(
err
):
void
{
if
(
err
)
{
console
.
error
(
TAG
+
'
====>publish failed:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
TAG
+
'
====>publish
'
);
}
}
private
Sub_Misc_inputMethod_Panel_createPanelCallback_0010
():
void
{
let
commonEventPublishData
;
let
panelInfo1
=
{
type
:
STATUS_BAR
,
flag
:
FLG_FLOATING
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 success
'
);
try
{
inputMethodAbility
.
createPanel
(
this
.
mContext
,
panelInfo1
,
async
(
err
,
panel
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 createPanel
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 createPanel error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_createPanelCallback_0010
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 Succeed in creating panel.
'
+
JSON
.
stringify
(
panel
));
}
await
inputMethodAbility
.
destroyPanel
(
panel
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_createPanelCallback_0010
"
,
commonEventPublishData
,
this
.
publishCallback
);
})
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelCallback_0010 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_createPanelCallback_0010
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_createPanelPromise_0020
():
void
{
let
commonEventPublishData
;
let
panelInfo1
=
{
type
:
STATUS_BAR
,
flag
:
FLG_FLOATING
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 success
'
);
try
{
inputMethodAbility
.
createPanel
(
this
.
mContext
,
panelInfo1
).
then
(
async
(
panel
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 Succeed in creating panel.
'
+
JSON
.
stringify
(
panel
));
await
inputMethodAbility
.
destroyPanel
(
panel
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_createPanelPromise_0020
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 createPanel error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_createPanelPromise_0020
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_createPanelPromise_0020 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_createPanelPromise_0020
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
async
Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030
():
Promise
<
void
>
{
let
commonEventPublishData
;
let
panelInfo1
=
{
type
:
STATUS_BAR
,
flag
:
FLG_FIXED
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 success
'
);
try
{
let
panel
=
await
inputMethodAbility
.
createPanel
(
this
.
mContext
,
panelInfo1
);
inputMethodAbility
.
destroyPanel
(
panel
,
async
(
err
,
panel
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 destroyPanel
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 destroyPanel error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 Succeed in destroying panel.
'
+
JSON
.
stringify
(
panel
));
}
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030
"
,
commonEventPublishData
,
this
.
publishCallback
);
})
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
async
Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040
():
Promise
<
void
>
{
let
commonEventPublishData
;
let
panelInfo1
=
{
type
:
STATUS_BAR
,
flag
:
FLG_FIXED
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 success
'
);
try
{
let
panel
=
await
inputMethodAbility
.
createPanel
(
this
.
mContext
,
panelInfo1
);
inputMethodAbility
.
destroyPanel
(
panel
).
then
(
async
()
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 Succeed in destroyPanel panel.
'
+
JSON
.
stringify
(
panel
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 destroyPanel error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_setUiContentCallback_0050
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
setUiContent
(
"
pages/Index
"
,
async
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 setUiContent
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 setUiContent error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentCallback_0050
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 Succeed setUiContent:
'
+
JSON
.
stringify
(
data
));
}
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentCallback_0050
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentCallback_0050
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentCallback_0050
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_setUiContentPromise_0060
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
setUiContent
(
"
pages/Index
"
).
then
(
async
(
data
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 Succeed in setUiContent.
'
+
JSON
.
stringify
(
data
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0060
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 setUiContent error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0060
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0060
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0060
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_setUiContentPromise_0080
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
setUiContent
(
"
pages/Index
"
,
this
.
storage
).
then
(
async
(
data
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 Succeed in setUiContent:
'
+
JSON
.
stringify
(
data
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0080
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 setUiContent error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0080
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0080
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_setUiContentPromise_0080
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_resizeCallback_0090
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
resize
(
this
.
windowWidth
,
this
.
windowHeight
,
async
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 resize
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 resize error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizeCallback_0090
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 Succeeded in changing the panel size:
'
+
JSON
.
stringify
(
data
));
}
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizeCallback_0090
"
,
commonEventPublishData
,
this
.
publishCallback
);
})
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizeCallback_0090
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizeCallback_0090 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizeCallback_0090
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_resizePromise_0100
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
resize
(
this
.
windowWidth
,
this
.
windowHeight
).
then
(
async
(
data
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_resizePromise_0100 Succeed in changing the panel size:
'
+
JSON
.
stringify
(
data
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizePromise_0100
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 resize error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizePromise_0100
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizePromise_0100
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_resizePromise_0100 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_resizePromise_0100
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_moveToCallback_0110
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
moveTo
(
100
,
100
,
async
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 moveTo
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 moveTo error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToCallback_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 Succeed in moving the panel:
'
+
JSON
.
stringify
(
data
));
}
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToCallback_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToCallback_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToCallback_0110 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToCallback_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_moveToPromise_0120
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
moveTo
(
100
,
100
).
then
(
async
(
data
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 Succeed in moving the panel:
'
+
JSON
.
stringify
(
data
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToPromise_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 moveTo error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToPromise_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToPromise_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_moveToPromise_0120 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_moveToPromise_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_showCallback_0130
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
show
(
async
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 show
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 show error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showCallback_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_showCallback_0130 Succeed in showing the panel:
'
+
JSON
.
stringify
(
data
));
}
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showCallback_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
})
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showCallback_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showCallback_0130 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showCallback_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_showPromise_0140
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
show
().
then
(
async
(
data
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_showPromise_0140 Succeed in showing the panel:
'
+
JSON
.
stringify
(
data
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showPromise_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 show error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showPromise_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showPromise_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_showPromise_0140 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_showPromise_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_hideCallback_0150
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
hide
(
async
(
err
,
data
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 hide
'
);
if
(
err
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 hide error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hideCallback_0150
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_hideCallback_0150 Succeed in hiding the panel:
'
+
JSON
.
stringify
(
data
));
}
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hideCallback_0150
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hideCallback_0150
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hideCallback_0150 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hideCallback_0150
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_hidePromise_0160
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
hide
().
then
(
async
(
data
)
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_hidePromise_0160 Succeed in hiding the panel:
'
+
JSON
.
stringify
(
data
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hidePromise_0160
"
,
commonEventPublishData
,
this
.
publishCallback
);
}).
catch
(
async
(
err
)
=>
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 hide error:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hidePromise_0160
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hidePromise_0160
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_hidePromise_0160 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_hidePromise_0160
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
async
Sub_Misc_inputMethod_Panel_onShow_0170
():
Promise
<
void
>
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onShow_0170 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
on
(
"
show
"
,
async
()
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
this
.
softKeyboardPanel
.
off
(
"
show
"
);
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onShow_0170 onShow error:
'
);
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_onShow_0170 Succeed onShow:
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_onShow_0170
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
await
this
.
softKeyboardPanel
.
show
();
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onShow_0170 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_onShow_0170
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onShow_0170 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_onShow_0170
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
async
Sub_Misc_inputMethod_Panel_onHide_0180
():
Promise
<
void
>
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onHide_0180 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
this
.
softKeyboardPanel
.
on
(
"
hide
"
,
async
()
=>
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onHide_0180 onHide
'
);
this
.
softKeyboardPanel
.
off
(
"
hide
"
);
console
.
info
(
'
====>Sub_Misc_inputMethod_Panel_onHide_0180 Succeed onHide:
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_onHide_0180
"
,
commonEventPublishData
,
this
.
publishCallback
);
});
await
this
.
softKeyboardPanel
.
hide
();
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onHide_0180 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_onHide_0180
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_onHide_0180 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_onHide_0180
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_Panel_changeFlag_0210
():
void
{
let
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 success
'
);
try
{
if
(
this
.
softKeyboardPanel
!==
null
){
try
{
this
.
softKeyboardPanel
.
changeFlag
(
1
);
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_changeFlag_0210
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
catch
(
err
){
console
.
error
(
"
====>SUB_REQUEST_UPLOAD_API_CALLBACK_0001 throw_error:
"
+
err
);
}
}
else
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 this.softKeyboardPanel is null
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_changeFlag_0210
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_Panel_changeFlag_0210 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_Panel_changeFlag_0210
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
info
(
"
ImExtAbility onCreate
"
);
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
info
(
"
ImExtAbility onDestroy
"
);
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
info
(
"
ImExtAbility onWindowStageCreate
"
);
globalThis
.
abilityContext
=
this
.
context
;
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
);
console
.
info
(
"
ImExtAbility onWindowStageCreate finish
"
);
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
info
(
"
ImExtAbility onWindowStageDestroy
"
);
}
onForeground
()
{
// Ability has brought to foreground
console
.
info
(
"
ImExtAbility onForeground
"
);
}
onBackground
()
{
// Ability has back to background
console
.
info
(
"
ImExtAbility onBackground
"
);
}
};
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
;
var
abilityDelegatorArguments
=
undefined
;
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
]);
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
;
}
}
return
targetParams
.
trim
();
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
));
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
);
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
;
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
);
var
cmd
=
'
aa start -d 0 -a com.acts.inputmethodwidmanage.test.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
);
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
];
if
(
debug
===
'
true
'
)
{
cmd
+=
'
-D
'
;
}
console
.
info
(
'
cmd :
'
+
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
});
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
);
}
};
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/index/index.ets
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
@State inputValue: string = 'inputMethodEngine1inputMethodEngine2inputMethodEngine3inputMethodEngine' +
'inputMethodEngine4inputMethodEngine5inputMethodEngine6inputMethodEngine7inputMethodEngine8inputMethodEn' +
'gine9inputMethodEngine10inputMethodEngine11inputMethodEngine12inputMethodEngine13inputMethodEngine14inputMet' +
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20inputMethodEngine21';
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
.defaultFocus(true)
TextArea({ text: this.inputValue })
.onChange((value: string) => {
this.inputValue = value;
})
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
}
.width('100%')
}
.height('100%')
}
aboutToAppear(){
let abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
let abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/second/second.ets
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/test/InputMethodWindManage.test.ets
0 → 100644
浏览文件 @
201ddbe1
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"@ohos/hypium"
import
inputMethod
from
'@ohos.inputMethod'
;
import
inputMethodEngine
from
'@ohos.inputMethodEngine'
;
import
subtype
from
'@ohos.InputMethodSubtype'
;
import
commonEventManager
from
'@ohos.commonEventManager'
;
import
AbilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
import
display
from
'@ohos.display'
;
export
default
function
inputMethodWindManageAbility
()
{
describe
(
'inputMethodWindManageTest'
,
function
()
{
var
inputServer
=
{
packageName
:
''
,
methodId
:
''
,
name
:
''
,
id
:
''
,
extra
:
{}
}
let
display_info
;
let
getFocusCmd
=
''
;
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
async
function
runCmd
(
cmd
){
console
.
debug
(
'====>runCmd info:'
+
cmd
);
await
abilityDelegator
.
executeShellCommand
(
cmd
);
}
beforeAll
(
async
(
done
)
=>
{
display_info
=
display
.
getDefaultDisplaySync
()
getFocusCmd
=
`uinput -T -c ${display_info.width*0.5} ${display_info.height*0.5}`
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
;
console
.
info
(
"====>beforeAll inputMethodStageJSUnit start"
);
let
inputDemoService
:
subtype
=
{
id
:
'inputMethodWindService'
,
label
:
''
,
name
:
'com.acts.inputmethodwidmanage.test'
,
mode
:
'lower'
,
locale
:
''
,
language
:
''
,
icon
:
''
,
iconId
:
0
,
extra
:
{},
}
try
{
await
inputMethod
.
switchCurrentInputMethodSubtype
(
inputDemoService
);
setTimeout
(()
=>
{
console
.
debug
(
"====>beforeAll inputMethodStageJSUnit switchCurrentInputMethodSubtype success: "
+
JSON
.
stringify
(
inputDemoService
));
done
();
},
2000
)
}
catch
(
err
){
console
.
debug
(
"====>beforeAll inputMethodStageJSUnit switchCurrentInputMethodSubtype failed"
);
}
})
afterAll
(
async
(
done
)
=>
{
try
{
await
inputMethod
.
switchInputMethod
(
inputServer
);
setTimeout
(()
=>
{
console
.
info
(
"====>afterAll: inputMethodEngineJSUnit switchInputMethod success: "
+
JSON
.
stringify
(
inputServer
));
done
();
},
2000
)
}
catch
(
err
)
{
console
.
info
(
"====>afterAll: inputMethodEngineJSUnit fail"
+
JSON
.
stringify
(
err
));
}
})
it
(
'Sub_Misc_inputMethod_Panel_createPanelCallback_0010'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_createPanelCallback_0010"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelCallback_0010 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
10
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_createPanelPromise_0020'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_createPanelPromise_0020"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_createPanelPromise_0020 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
20
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelCallback_0030 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
30
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_destroyPanelPromise_0040 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
40
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_setUiContentCallback_0050'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_setUiContentCallback_0050"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentCallback_0050 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
50
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_setUiContentPromise_0060'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_setUiContentPromise_0060"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0060 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
60
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_setUiContentPromise_0080'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_setUiContentPromise_0080"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_setUiContentPromise_0080 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
80
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_resizeCallback_0090'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_resizeCallback_0090"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizeCallback_0090 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
90
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_resizePromise_0100'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_resizePromise_0100"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_resizePromise_0100 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
100
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_moveToCallback_0110'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_moveToCallback_0110"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToCallback_0110 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
110
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_moveToPromise_0120'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_moveToPromise_0120"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_moveToPromise_0120 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
120
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_showCallback_0130'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_showCallback_0130"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showCallback_0130 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
130
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_hideCallback_0150'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_hideCallback_0150"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hideCallback_0150 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
150
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_showPromise_0140'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_showPromise_0140"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_showPromise_0140 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
140
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_hidePromise_0160'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_hidePromise_0160"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_hidePromise_0160 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
160
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_onShow_0170'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_onShow_0170"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onShow_0170 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
170
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_onHide_0180'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_onHide_0180"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_onHide_0180 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
180
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_Panel_changeFlag_0210'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 unSubscriberCallback start"
);
if
(
err
)
{
console
.
error
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 unSubscriberCallback failed: "
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 unSubscriberCallback finsh"
);
}
}
function
subscriberCallback
(
err
,
data
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 subscriberCallback data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
let
t
=
setTimeout
(()
=>
{
try
{
expect
(
data
.
data
)
.
assertEqual
(
"SUCCESS"
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 end<===="
);
clearTimeout
(
t
);
done
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 end<===="
+
JSON
.
stringify
(
err
));
clearTimeout
(
t
)
done
();
}
},
500
)
}
async
function
publishCallback
(
err
)
{
if
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 end<===="
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 success ===="
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_Panel_changeFlag_0210"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
(
function
(
data
)
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 subscribe data: "
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_Panel_changeFlag_0210 subscribe finish===="
);
})
var
commonEventPublishData
=
{
code
:
210
}
commonEventManager
.
publish
(
"test"
,
commonEventPublishData
,
publishCallback
);
});
});
};
inputmethod/InputMethodWindManage/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import InputMethodWindManage from './InputMethodWindManage.test'
export default function testsuite() {
InputMethodWindManage();
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/module.json
0 → 100644
浏览文件 @
201ddbe1
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"com.acts.inputmethodwidmanage.test.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"description"
:
"inputPanelTest"
,
"icon"
:
"$media:icon"
,
"name"
:
"inputMethodWindService"
,
"srcEntrance"
:
"./ets/InputMethodWindManage/InputMethodWindService.ts"
,
"type"
:
"inputMethod"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.CONNECT_IME_ABILITY"
}
]
}
}
inputmethod/InputMethodWindManage/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
201ddbe1
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsInputMethodWindManageTest"
},
{
"name"
:
"ime_description"
,
"value"
:
"input method extension ability."
},
{
"name"
:
"ime_label"
,
"value"
:
"inputMethod extension ability services."
},
{
"name"
:
"ime_label_1"
,
"value"
:
"inputMethod extension ability services_1."
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
inputmethod/InputMethodWindManage/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
201ddbe1
6.6 KB
inputmethod/InputMethodWindManage/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
201ddbe1
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
inputmethod/InputMethodWindManage/signature/ActsInputMethodWindManageTest.p7b
0 → 100644
浏览文件 @
201ddbe1
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录