Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2eb5d0ba
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看板
未验证
提交
2eb5d0ba
编写于
10月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5937 xts代码优化
Merge pull request !5937 from mayunteng/master
上级
90ac4540
784cb2e1
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
1771 addition
and
1680 deletion
+1771
-1680
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
...ut/input_js_standard/src/main/js/test/InputDevice.test.js
+502
-444
multimodalinput/input_js_standard/src/main/js/test/ListMultimodalinput.test.js
..._js_standard/src/main/js/test/ListMultimodalinput.test.js
+3
-5
multimodalinput/input_js_standard/src/main/js/test/MultimodalInputKey_Code.test.js
...standard/src/main/js/test/MultimodalInputKey_Code.test.js
+994
-995
multimodalinput/input_js_standard/src/main/js/test/Pointer.test.js
...linput/input_js_standard/src/main/js/test/Pointer.test.js
+272
-236
未找到文件。
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
浏览文件 @
2eb5d0ba
...
...
@@ -16,12 +16,13 @@
import
inputDevice
from
'
@ohos.multimodalInput.inputDevice
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
,
TestType
,
Size
,
Level
}
from
'
@ohos/hypium
'
export
default
function
MultimodalInput_Device_test
()
{
describe
(
'
MultimodalInput_Device_test
'
,
function
()
{
describe
(
'
MultimodalInput_Device_test
'
,
function
()
{
// 参数正确,返回一个数组
it
(
'
inputDevice::getDeviceIds_test-01
'
,
0
,
function
()
{
console
.
info
(
`inputDevice::getDeviceIds_test-01 enter`
);
inputDevice
.
getDeviceIds
((
data
,
err
)
=>
{
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
...
...
@@ -29,12 +30,17 @@ describe('MultimodalInput_Device_test', function () {
}
console
.
info
(
`inputDevice::getDeviceIds_test-01 exit`
);
})
}
catch
(
error
)
{
console
.
info
(
`inputDevice::getDeviceIds_test-01 error`
);
expect
(
false
).
assertTrue
();
}
})
// 参数正确,判断一种或多种设备
it
(
"
inputDevice::getDeviceIds_test-02
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::getDeviceIds_test-02 enter`
);
inputDevice
.
getDeviceIds
((
data
,
err
)
=>
{
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
...
...
@@ -42,6 +48,10 @@ describe('MultimodalInput_Device_test', function () {
}
console
.
info
(
`inputDevice::getDeviceIds_test-02 exit`
);
})
}
catch
(
error
)
{
console
.
info
(
`inputDevice::getDeviceIds_test-02 error`
);
expect
(
false
).
assertTrue
();
}
})
// 参数类型错误
...
...
@@ -59,7 +69,7 @@ describe('MultimodalInput_Device_test', function () {
it
(
"
inputDevice::getDeviceIds_test-04
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::getDeviceIds_test-04 enter`
);
try
{
inputDevice
.
getDeviceIds
(
-
1
,
(
data
)
=>
{
inputDevice
.
getDeviceIds
(
-
1
,
(
err
,
data
)
=>
{
console
.
info
(
data
);
});
}
catch
(
error
)
{
...
...
@@ -71,7 +81,8 @@ describe('MultimodalInput_Device_test', function () {
// 无效的设备id
it
(
"
inputDevice::getDevice_test-01
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::getDevice_test-01 enter`
);
inputDevice
.
getDevice
(
-
1
,
(
data
,
err
)
=>
{
try
{
inputDevice
.
getDevice
(
-
1
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
`inputDevice::getDevice_test-01
${
JSON
.
stringify
(
err
)}
`
);
...
...
@@ -80,18 +91,23 @@ describe('MultimodalInput_Device_test', function () {
}
console
.
info
(
`inputDevice::getDevice_test-01 exit`
);
})
}
catch
(
error
)
{
console
.
info
(
`inputDevice::getDevice_test-01 error`
);
expect
(
false
).
assertTrue
();
}
})
// 参数正常,返回值正常
it
(
"
inputDevice::getDevice_test-02
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::getDevice_test-02 enter`
);
inputDevice
.
getDeviceIds
((
data
,
err
)
=>
{
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
let
arr
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
inputDevice
.
getDevice
(
data
[
i
],
(
res
,
err
)
=>
{
inputDevice
.
getDevice
(
data
[
i
],
(
err
,
res
)
=>
{
console
.
info
(
`getDevice:data
${
JSON
.
stringify
(
data
)}
`
);
arr
=
Object
.
keys
(
res
);
expect
(
res
.
id
).
assertInstanceOf
(
'
Number
'
);
...
...
@@ -105,7 +121,7 @@ describe('MultimodalInput_Device_test', function () {
expect
(
res
.
phys
).
assertInstanceOf
(
'
String
'
);
expect
(
res
.
uniq
).
assertInstanceOf
(
'
String
'
);
expect
(
res
).
assertInstanceOf
(
'
Object
'
);
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
expect
(
res
.
axisRanges
[
j
].
source
==
'
keyboard
'
||
res
.
axisRanges
[
j
].
source
==
'
mouse
'
||
res
.
axisRanges
[
j
].
source
==
'
touchpad
'
||
res
.
axisRanges
[
j
].
source
==
'
touchscreen
'
||
res
.
axisRanges
[
j
].
source
==
'
joystick
'
||
res
.
axisRanges
[
j
].
source
==
'
trackball
'
).
assertTrue
();
...
...
@@ -126,30 +142,39 @@ describe('MultimodalInput_Device_test', function () {
}
console
.
info
(
`inputDevice::getDevice_test-02 exit`
);
});
}
catch
(
error
)
{
console
.
info
(
`inputDevice::getDevice_test-02 error`
);
expect
(
false
).
assertTrue
();
}
})
// 参数正常,返回值正常
it
(
"
inputDevice::supportKeys_test-01
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::supportKeys_test-01 enter`
);
inputDevice
.
getDeviceIds
((
data
,
err
)
=>
{
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
inputDevice
.
supportKeys
(
data
[
i
],
[
17
,
22
,
2055
],
(
res
,
err
)
=>
{
inputDevice
.
supportKeys
(
data
[
i
],
[
17
,
22
,
2055
],
(
err
,
res
)
=>
{
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
});
}
}
console
.
info
(
`inputDevice::supportKeys_test-01 exit`
);
});
}
catch
(
error
)
{
console
.
info
(
`inputDevice::supportKeys_test-01 error`
);
expect
(
false
).
assertTrue
();
}
})
// 第二个参数异常
it
(
"
inputDevice::supportKeys_test-02
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::supportKeys_test-02 enter`
);
try
{
inputDevice
.
supportKeys
(
0
,
2022
,
(
res
)
=>
{
inputDevice
.
supportKeys
(
0
,
2022
,
(
err
,
res
)
=>
{
console
.
info
(
res
);
});
}
catch
(
error
)
{
...
...
@@ -161,18 +186,23 @@ describe('MultimodalInput_Device_test', function () {
// 参数正常
it
(
"
inputDevice::getKeyboardType_test-01
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::getKeyboardType_test-01 enter`
);
inputDevice
.
getDeviceIds
((
data
,
err
)
=>
{
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
inputDevice
.
getKeyboardType
(
data
[
i
],
(
res
,
err
)
=>
{
inputDevice
.
getKeyboardType
(
data
[
i
],
(
err
,
res
)
=>
{
expect
(
res
).
assertInstanceOf
(
'
Number
'
);
});
}
}
console
.
info
(
`inputDevice::getKeyboardType_test-01 exit`
);
});
}
catch
(
error
)
{
console
.
info
(
`inputDevice::getKeyboardType_test-01 error`
);
expect
(
false
).
assertTrue
();
}
})
//参数异常
...
...
@@ -189,18 +219,26 @@ describe('MultimodalInput_Device_test', function () {
// 参数正常
it
(
"
inputDevice::getKeyboardType_test-03
"
,
0
,
function
()
{
console
.
info
(
`inputDevice::getKeyboardType_test-03 enter`
);
inputDevice
.
getDeviceIds
((
data
,
err
)
=>
{
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
inputDevice
.
getKeyboardType
(
data
[
i
]).
then
((
res
)
=>
{
expect
(
res
).
assertInstanceOf
(
'
Number
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
`inputDevice::getKeyboardType_test-03 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
}
}
console
.
info
(
`inputDevice::getKeyboardType_test-03 exit`
);
});
}
catch
(
error
)
{
console
.
info
(
`inputDevice::getKeyboardType_test-03 error`
);
expect
(
false
).
assertTrue
();
}
})
/**
...
...
@@ -274,22 +312,30 @@ describe('MultimodalInput_Device_test', function () {
*/
it
(
"
MultimodalInputDevice_getDeviceIds_Promise_test
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test enter`
);
inputDevice
.
getDeviceIds
().
then
((
data
,
err
)
=>
{
if
(
err
)
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test err`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
try
{
inputDevice
.
getDeviceIds
().
then
(
data
=>
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test data`
);
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
inputDevice
.
supportKeys
(
data
[
i
],
[
17
,
22
,
2055
]).
then
((
res
,
err
)
=>
{
inputDevice
.
supportKeys
(
data
[
i
],
[
17
,
22
,
2055
]).
then
(
res
=>
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test res`
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
}
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
done
();
});
}
catch
(
error
)
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test error`
);
expect
(
false
).
assertTrue
();
done
();
}
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test exit`
);
});
})
/**
...
...
@@ -299,17 +345,19 @@ describe('MultimodalInput_Device_test', function () {
*/
it
(
"
MultimodalInputDevice_getDevice_Promise_test
"
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_getDevice_Promise_test enter`
);
inputDevice
.
getDevice
(
-
1
).
then
((
data
,
err
)
=>
{
if
(
err
)
{
console
.
info
(
`MultimodalInputDevice_getDevice_Promise_test err`
);
expect
(
false
).
assertTrue
();
console
.
info
(
`MultimodalInputDevice_getDevice_Promise_test
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
try
{
inputDevice
.
getDevice
(
-
1
).
then
(
data
=>
{
console
.
info
(
`MultimodalInputDevice_getDevice_Promise_test data`
);
expect
(
JSON
.
stringify
(
data
)
!==
"
{}
"
).
assertTrue
();
}
console
.
info
(
`MultimodalInputDevice_getDevice_Promise_test exit`
);
}).
catch
((
err
)
=>
{
console
.
info
(
`MultimodalInputDevice_getDevice_Promise_test err`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`MultimodalInputDevice_getDeviceIds_Promise_test exit`
);
})
/**
...
...
@@ -319,11 +367,12 @@ describe('MultimodalInput_Device_test', function () {
*/
it
(
"
MultimodalInputDevice_on_test
"
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_on_test enter`
);
try
{
let
isPhysicalKeyboardExist
=
true
;
inputDevice
.
on
(
"
change
"
,
(
data
)
=>
{
console
.
info
(
"
type:
"
+
data
.
type
+
"
, deviceId:
"
+
data
.
deviceId
);
console
.
info
(
"
MultimodalInputDevice_on_test
type:
"
+
data
.
type
+
"
, deviceId:
"
+
data
.
deviceId
);
inputDevice
.
getKeyboardType
(
data
.
deviceId
,
(
err
,
ret
)
=>
{
console
.
info
(
"
The keyboard type of the device is:
"
+
ret
);
console
.
info
(
"
MultimodalInputDevice_on_test
The keyboard type of the device is:
"
+
ret
);
if
(
ret
==
inputDevice
.
KeyboardType
.
ALPHABETIC_KEYBOARD
&&
data
.
type
==
'
add
'
)
{
// 监听物理键盘已连接。
isPhysicalKeyboardExist
=
true
;
...
...
@@ -333,6 +382,10 @@ describe('MultimodalInput_Device_test', function () {
}
});
});
}
catch
(
error
)
{
console
.
info
(
`MultimodalInputDevice_on_test error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`MultimodalInputDevice_on_test exit`
);
})
...
...
@@ -345,11 +398,16 @@ describe('MultimodalInput_Device_test', function () {
console
.
info
(
`MultimodalInputDevice_off_test enter`
);
function
listener
(
data
)
{
console
.
info
(
"
type:
"
+
data
.
type
+
"
, deviceId:
"
+
data
.
deviceId
);
expect
(
data
.
type
==
'
add
'
||
data
.
type
==
'
remove
'
).
assertTrue
();
expect
(
data
.
type
==
'
add
'
||
data
.
type
==
'
remove
'
).
assertTrue
();
expect
(
data
).
assertInstanceOf
(
'
DeviceListener
'
);
}
// 单独取消listener的监听。
try
{
inputDevice
.
off
(
"
change
"
,
listener
);
}
catch
(
error
)
{
console
.
info
(
`MultimodalInputDevice_on_test error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`MultimodalInputDevice_off_test exit`
);
})
...
...
@@ -427,7 +485,7 @@ describe('MultimodalInput_Device_test', function () {
expect
(
res
.
phys
).
assertInstanceOf
(
'
String
'
);
expect
(
res
.
uniq
).
assertInstanceOf
(
'
String
'
);
expect
(
res
).
assertInstanceOf
(
'
Object
'
);
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
expect
(
res
.
axisRanges
[
j
].
source
==
'
keyboard
'
||
res
.
axisRanges
[
j
].
source
==
'
mouse
'
||
res
.
axisRanges
[
j
].
source
==
'
touchpad
'
||
res
.
axisRanges
[
j
].
source
==
'
touchscreen
'
||
res
.
axisRanges
[
j
].
source
==
'
joystick
'
||
res
.
axisRanges
[
j
].
source
==
'
trackball
'
).
assertTrue
();
...
...
@@ -483,7 +541,7 @@ describe('MultimodalInput_Device_test', function () {
expect
(
res
.
phys
).
assertInstanceOf
(
'
String
'
);
expect
(
res
.
uniq
).
assertInstanceOf
(
'
String
'
);
expect
(
res
).
assertInstanceOf
(
'
Object
'
);
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
expect
(
res
.
axisRanges
[
j
].
source
==
'
keyboard
'
||
res
.
axisRanges
[
j
].
source
==
'
mouse
'
||
res
.
axisRanges
[
j
].
source
==
'
touchpad
'
||
res
.
axisRanges
[
j
].
source
==
'
touchscreen
'
||
res
.
axisRanges
[
j
].
source
==
'
joystick
'
||
res
.
axisRanges
[
j
].
source
==
'
trackball
'
).
assertTrue
();
...
...
@@ -511,5 +569,5 @@ describe('MultimodalInput_Device_test', function () {
}
console
.
info
(
`inputDevice::getDeviceInfo_promise_test exit`
);
})
})
})
}
multimodalinput/input_js_standard/src/main/js/test/ListMultimodalinput.test.js
浏览文件 @
2eb5d0ba
...
...
@@ -13,13 +13,11 @@
* limitations under the License.
*/
import
MultimodalInput_Device_test
from
'
./InputDevice.test.js
'
import
MultimodalInput_KeyCode_test
from
'
./MultimodalInputKey_Code.test.js
'
import
MultimodalInput_Pointer_test
from
'
./Pointer.test.js
'
export
default
function
testsuite
()
{
MultimodalInput_Device_test
()
MultimodalInput_KeyCode_test
()
MultimodalInput_Pointer_test
()
MultimodalInput_Device_test
()
MultimodalInput_KeyCode_test
()
MultimodalInput_Pointer_test
()
}
\ No newline at end of file
multimodalinput/input_js_standard/src/main/js/test/MultimodalInputKey_Code.test.js
浏览文件 @
2eb5d0ba
...
...
@@ -12,12 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
inputkeyCode
from
'
@ohos.multimodalInput.keyCode
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
,
TestType
,
Size
,
Level
}
from
'
@ohos/hypium
'
export
default
function
MultimodalInput_KeyCode_test
()
{
export
default
function
MultimodalInput_KeyCode_test
()
{
describe
(
'
MultimodalInput_KeyCode_test
'
,
function
()
{
it
(
'
Multimodalinput_KeyCode_test::SUB_MMI_KeyCodeTest_0010
'
,
0
,
function
()
{
console
.
info
(
`Multimodalinput_KeyCode_test::SUB_MMI_KeyCodeTest_0010 enter`
);
...
...
@@ -2658,6 +2658,5 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
console
.
info
(
`Multimodalinput_KeyCode_test::SUB_MMI_KeyCodeTest_348 exit`
);
})
})
}
})
}
multimodalinput/input_js_standard/src/main/js/test/Pointer.test.js
浏览文件 @
2eb5d0ba
...
...
@@ -16,43 +16,56 @@
import
pointer
from
'
@ohos.multimodalInput.pointer
'
import
window
from
'
@ohos.window
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
,
TestType
,
Size
,
Level
}
from
'
@ohos/hypium
'
export
default
function
MultimodalInput_Pointer_test
()
{
export
default
function
MultimodalInput_Pointer_test
()
{
describe
(
'
MultimodalInput_Pointer_test
'
,
function
()
{
it
(
'
MultimodalInput_Pointer_test::PointerVisibleTest_001
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 enter`
);
var
callback
=
function
(
err
,
data
)
{
try
{
pointer
.
setPointerVisible
(
false
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 success
`
);
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 success. data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
}
};
pointer
.
setPointerVisible
(
false
,
callback
);
});
}
catch
(
error
)
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 error`
);
expect
(
false
).
assertTrue
();
}
try
{
pointer
.
isPointerVisible
().
then
(
data
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
==
false
).
assertTrue
();
}
,
err
=>
{
}
).
catch
((
err
)
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_001 exit`
);
})
it
(
'
MultimodalInput_Pointer_test::PointerVisibleTest_002
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 enter`
);
try
{
pointer
.
setPointerVisible
(
true
).
then
(
data
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
}
,
err
=>
{
}
).
catch
((
err
)
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
var
callback
=
function
(
err
,
data
)
{
}
catch
(
error
)
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 error`
);
expect
(
false
).
assertTrue
();
}
try
{
pointer
.
isPointerVisible
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
...
...
@@ -60,8 +73,11 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
==
true
).
assertTrue
();
}
};
pointer
.
isPointerVisible
(
callback
);
});
}
catch
(
error
)
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 exit`
);
})
...
...
@@ -78,14 +94,19 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
console
.
info
(
`SetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
try
{
var
windowId
=
data
.
id
;
pointer
.
setPointerStyle
(
windowId
,
4
).
then
(()
=>
{
expect
(
true
).
assertTrue
();
console
.
info
(
`SetPointerStyle_001 success`
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
promise::catch
"
,
err
);
console
.
info
(
`SetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
error
)
{
console
.
info
(
`SetPointerStyle_001 error`
);
expect
(
false
).
assertTrue
();
}
})
})
})
...
...
@@ -103,6 +124,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
console
.
info
(
`SetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
try
{
var
windowId
=
data
.
id
;
pointer
.
setPointerStyle
(
windowId
,
4
,
(
err
)
=>
{
if
(
err
)
{
...
...
@@ -113,6 +135,10 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`SetPointerStyle_002 error`
);
expect
(
false
).
assertTrue
();
}
})
})
})
...
...
@@ -131,13 +157,18 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
expect
(
false
).
assertTrue
();
}
var
windowId
=
data
.
id
;
try
{
pointer
.
getPointerStyle
(
windowId
).
then
((
data
)
=>
{
console
.
info
(
`GetPointerStyle_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
).
assertTrue
(
'
Number
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
"
promise::catch
"
,
err
);
console
.
info
(
`GetPointerStyle_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`GetPointerStyle_001 error`
);
expect
(
false
).
assertTrue
();
}
})
})
})
...
...
@@ -155,6 +186,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
console
.
info
(
`GetPointerStyle_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
try
{
var
windowId
=
data
.
id
;
pointer
.
getPointerStyle
(
windowId
,
(
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -165,6 +197,10 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
expect
(
data
).
assertTrue
(
'
Number
'
);
}
});
}
catch
(
error
)
{
console
.
info
(
`GetPointerStyle_002 error`
);
expect
(
false
).
assertTrue
();
}
})
})
})
...
...
@@ -287,5 +323,5 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
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
();
})
})
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录