Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
479640ff
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看板
未验证
提交
479640ff
编写于
9月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5374 多模子系统新增api覆盖属性pointer接口用例
Merge pull request !5374 from 岳鑫瑶/master
上级
56c164e7
f8b3967b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
139 addition
and
22 deletion
+139
-22
multimodalinput/input_js_standard/src/main/js/default/test/Pointer.test.js
...nput_js_standard/src/main/js/default/test/Pointer.test.js
+139
-22
未找到文件。
multimodalinput/input_js_standard/src/main/js/default/test/Pointer.test.js
浏览文件 @
479640ff
...
...
@@ -31,20 +31,20 @@ describe('MultimodalInput_Pointer_test', function () {
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 enter`
);
var
callback
=
function
(
err
,
data
)
{
if
(
err
)
{
this
.
log
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
this
.
log
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 success`
);
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 success`
);
expect
(
true
).
assertTure
();
}
};
pointer
.
setPointerVisible
(
false
,
callback
);
pointer
.
isPointerVisible
().
then
(
data
=>
{
this
.
log
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
==
false
).
assertTrue
();
},
data
=>
{
this
.
log
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 failed, err=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 failed, err=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
false
).
assertTrue
();
});
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 exit`
);
...
...
@@ -53,19 +53,19 @@ describe('MultimodalInput_Pointer_test', function () {
it
(
'
MultimodalInput_Pointer_test::PointerVisibleTest_002
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 enter`
);
pointer
.
setPointerVisible
(
true
).
then
(
data
=>
{
this
.
log
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
},
data
=>
{
this
.
log
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
false
).
assertTure
();
});
var
callback
=
function
(
err
,
data
)
{
if
(
err
)
{
this
.
log
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
this
.
log
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
==
true
).
assertTrue
();
}
};
...
...
@@ -77,19 +77,19 @@ describe('MultimodalInput_Pointer_test', function () {
console
.
info
(
`SetPointerStyle_001 enter`
);
window
.
getTopWindow
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`SetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`SetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowClass
=
data
;
windowClass
.
getProperties
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`SetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`SetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowId
=
data
.
id
;
pointer
.
setPointerStyle
(
windowId
,
4
).
then
(()
=>
{
expect
(
true
).
assertTrue
();
this
.
log
(
`SetPointerStyle_001 success`
);
console
.
info
(
`SetPointerStyle_001 success`
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertTure
();
console
.
info
(
"
promise::catch
"
,
err
);
...
...
@@ -103,21 +103,21 @@ describe('MultimodalInput_Pointer_test', function () {
window
.
getTopWindow
((
err
,
data
)
=>
{
var
windowClass
=
data
;
if
(
err
)
{
this
.
log
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
windowClass
.
getProperties
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowId
=
data
.
id
;
pointer
.
setPointerStyle
(
windowId
,
4
,
(
err
)
=>
{
if
(
err
)
{
this
.
log
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
this
.
log
(
`SetPointerStyle_002 success`
);
console
.
info
(
`SetPointerStyle_002 success`
);
expect
(
true
).
assertTrue
();
}
});
...
...
@@ -129,18 +129,18 @@ describe('MultimodalInput_Pointer_test', function () {
console
.
info
(
`GetPointerStyle_001 enter`
);
window
.
getTopWindow
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`GetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`GetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowClass
=
data
;
windowClass
.
getProperties
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`GetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`GetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowId
=
data
.
id
;
pointer
.
getPointerStyle
(
windowId
).
then
((
data
)
=>
{
this
.
log
(
`GetPointerStyle_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`GetPointerStyle_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
).
assertTrue
(
'
Number
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
"
promise::catch
"
,
err
);
...
...
@@ -154,26 +154,143 @@ describe('MultimodalInput_Pointer_test', function () {
console
.
info
(
`GetPointerStyle_002 enter`
);
window
.
getTopWindow
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowClass
=
data
;
windowClass
.
getProperties
((
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
var
windowId
=
data
.
id
;
pointer
.
getPointerStyle
(
windowId
,
(
err
,
data
)
=>
{
if
(
err
)
{
this
.
log
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
this
.
log
(
`GetPointerStyle_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`GetPointerStyle_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
).
assertTrue
(
'
Number
'
);
}
});
})
})
})
it
(
'
MultimodalInput_Pointer_test::Pointer_PointerStyle_test
'
,
0
,
function
()
{
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_PointerStyle_test =
'
+
pointer
.
PointerStyle
.
DEFAULT
);
expect
(
pointer
.
PointerStyle
.
DEFAULT
==
0
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_EAST_test =
'
+
pointer
.
PointerStyle
.
EAST
);
expect
(
pointer
.
PointerStyle
.
EAST
==
1
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_WEST_test =
'
+
pointer
.
PointerStyle
.
WEST
);
expect
(
pointer
.
PointerStyle
.
WEST
==
2
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_SOUTH_test =
'
+
pointer
.
PointerStyle
.
SOUTH
);
expect
(
pointer
.
PointerStyle
.
SOUTH
==
3
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_NORTH_test =
'
+
pointer
.
PointerStyle
.
NORTH
);
expect
(
pointer
.
PointerStyle
.
NORTH
==
4
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_WEST_EAST_test =
'
+
pointer
.
PointerStyle
.
WEST_EAST
);
expect
(
pointer
.
PointerStyle
.
WEST_EAST
==
5
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_NORTH_SOUTH_test =
'
+
pointer
.
PointerStyle
.
NORTH_SOUTH
);
expect
(
pointer
.
PointerStyle
.
NORTH_SOUTH
==
6
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_NORTH_EAST_test =
'
+
pointer
.
PointerStyle
.
NORTH_EAST
);
expect
(
pointer
.
PointerStyle
.
NORTH_EAST
==
7
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_NORTH_WEST_test =
'
+
pointer
.
PointerStyle
.
NORTH_WEST
);
expect
(
pointer
.
PointerStyle
.
NORTH_WEST
==
8
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_SOUTH_EAST_test =
'
+
pointer
.
PointerStyle
.
SOUTH_EAST
);
expect
(
pointer
.
PointerStyle
.
SOUTH_EAST
==
9
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_SOUTH_WEST_test =
'
+
pointer
.
PointerStyle
.
SOUTH_WEST
);
expect
(
pointer
.
PointerStyle
.
SOUTH_WEST
==
10
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_NORTH_EAST_SOUTH_WEST_test =
'
+
pointer
.
PointerStyle
.
NORTH_EAST_SOUTH_WEST
);
expect
(
pointer
.
PointerStyle
.
NORTH_EAST_SOUTH_WEST
==
11
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_NORTH_WEST_SOUTH_EAST_test =
'
+
pointer
.
PointerStyle
.
NORTH_WEST_SOUTH_EAST
);
expect
(
pointer
.
PointerStyle
.
NORTH_WEST_SOUTH_EAST
==
12
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_CROSS_test =
'
+
pointer
.
PointerStyle
.
CROSS
);
expect
(
pointer
.
PointerStyle
.
CROSS
==
13
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_CURSOR_COPY_test =
'
+
pointer
.
PointerStyle
.
CURSOR_COPY
);
expect
(
pointer
.
PointerStyle
.
CURSOR_COPY
==
14
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_CURSOR_FORBID_test =
'
+
pointer
.
PointerStyle
.
CURSOR_FORBID
);
expect
(
pointer
.
PointerStyle
.
CURSOR_FORBID
==
15
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_COLOR_SUCKER_test =
'
+
pointer
.
PointerStyle
.
COLOR_SUCKER
);
expect
(
pointer
.
PointerStyle
.
COLOR_SUCKER
==
16
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_HAND_GRABBING_test =
'
+
pointer
.
PointerStyle
.
HAND_GRABBING
);
expect
(
pointer
.
PointerStyle
.
HAND_GRABBING
==
17
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_HAND_OPEN_test =
'
+
pointer
.
PointerStyle
.
HAND_OPEN
);
expect
(
pointer
.
PointerStyle
.
HAND_OPEN
==
18
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_HAND_POINTING_test =
'
+
pointer
.
PointerStyle
.
HAND_POINTING
);
expect
(
pointer
.
PointerStyle
.
HAND_POINTING
==
19
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_HELP_test =
'
+
pointer
.
PointerStyle
.
HELP
);
expect
(
pointer
.
PointerStyle
.
HELP
==
20
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_RESIZE_UP_DOWN_test =
'
+
pointer
.
PointerStyle
.
RESIZE_UP_DOWN
);
expect
(
pointer
.
PointerStyle
.
RESIZE_UP_DOWN
==
22
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_RESIZE_LEFT_RIGHT_test =
'
+
pointer
.
PointerStyle
.
RESIZE_LEFT_RIGHT
);
expect
(
pointer
.
PointerStyle
.
RESIZE_LEFT_RIGHT
==
23
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_SCREENSHOT_CHOOSE_test =
'
+
pointer
.
PointerStyle
.
SCREENSHOT_CHOOSE
);
expect
(
pointer
.
PointerStyle
.
SCREENSHOT_CHOOSE
==
24
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_SCREENSHOT_CURSOR_test =
'
+
pointer
.
PointerStyle
.
SCREENSHOT_CURSOR
);
expect
(
pointer
.
PointerStyle
.
SCREENSHOT_CURSOR
==
25
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_TEXT_CURSOR_test =
'
+
pointer
.
PointerStyle
.
TEXT_CURSOR
);
expect
(
pointer
.
PointerStyle
.
TEXT_CURSOR
==
26
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_ZOOM_IN_test =
'
+
pointer
.
PointerStyle
.
ZOOM_IN
);
expect
(
pointer
.
PointerStyle
.
ZOOM_IN
==
27
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_ZOOM_OUT_test =
'
+
pointer
.
PointerStyle
.
ZOOM_OUT
);
expect
(
pointer
.
PointerStyle
.
ZOOM_OUT
==
28
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_EAST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_EAST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_EAST
==
29
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_WEST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_WEST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_WEST
==
30
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_SOUTH_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_SOUTH
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_SOUTH
==
31
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH
==
32
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_SOUTH_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH
==
33
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_EAST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_EAST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_EAST
==
34
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_WEST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_WEST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_WEST
==
35
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_SOUTH_EAST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_SOUTH_EAST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_SOUTH_EAST
==
36
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_SOUTH_WEST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_SOUTH_WEST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_SOUTH_WEST
==
37
).
assertTrue
();
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_SOUTH_WEST_EAST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH_WEST_EAST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH_WEST_EAST
==
38
).
assertTrue
();
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录