Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
75a923cb
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看板
提交
75a923cb
编写于
3月 23, 2023
作者:
R
renhongwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add device doce
Signed-off-by:
N
renhongwei
<
renhongwei9@huawei.com
>
上级
4015fba6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
2 deletion
+56
-2
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+56
-2
未找到文件。
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
75a923cb
...
...
@@ -22,6 +22,7 @@ export default function ImageReceiver() {
const
CAPACITY
=
8
;
const
RGBA
=
12
;
const
Jpg_Stride
=
1
;
const
DEVICE_CODE
=
801
;
const
{
JPEG
:
FORMATJPEG
}
=
image
.
ImageFormat
;
const
{
JPEG
}
=
image
.
ComponentType
;
beforeAll
(
async
function
()
{
...
...
@@ -67,6 +68,11 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
done
();
}
else
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
...
...
@@ -108,6 +114,11 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
done
();
}
else
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
...
...
@@ -150,6 +161,11 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
return
;
}
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
...
...
@@ -199,6 +215,11 @@ export default function ImageReceiver() {
done
();
return
;
}
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
...
...
@@ -635,6 +656,11 @@ export default function ImageReceiver() {
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
receiver
...
...
@@ -668,6 +694,11 @@ export default function ImageReceiver() {
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
...
...
@@ -696,6 +727,11 @@ export default function ImageReceiver() {
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
var
dummy
=
receiver
.
test
;
expect
(
receiver
!=
undefined
).
assertTrue
();
if
(
receiver
!=
undefined
)
{
...
...
@@ -730,6 +766,11 @@ export default function ImageReceiver() {
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
receiver
.
readNextImage
((
err
,
img
)
=>
{
...
...
@@ -824,6 +865,11 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
done
();
}
else
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
let
pass
=
false
;
receiver
.
on
(
"
imageArrival
"
,
(
err
)
=>
{
if
(
err
)
{
...
...
@@ -862,7 +908,11 @@ export default function ImageReceiver() {
done
();
return
;
}
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
});
...
...
@@ -922,7 +972,11 @@ export default function ImageReceiver() {
done
();
return
;
}
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录