Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
47bdcf8d
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看板
未验证
提交
47bdcf8d
编写于
3月 25, 2023
作者:
R
renhw001
提交者:
Gitee
3月 25, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js.
Signed-off-by:
N
renhw001
<
renhongwei9@huawei.com
>
上级
f0a08c3a
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
66 addition
and
3 deletion
+66
-3
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+66
-3
未找到文件。
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
47bdcf8d
...
...
@@ -54,10 +54,12 @@ export default function ImageReceiver() {
image
.
createImageReceiver
(
wid
,
hei
,
fmt
,
cap
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
info
(
`
${
testNum
}
err message`
+
error
);
done
();
return
;
}
}
...
...
@@ -67,11 +69,13 @@ export default function ImageReceiver() {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
...
...
@@ -82,6 +86,7 @@ export default function ImageReceiver() {
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -94,10 +99,12 @@ export default function ImageReceiver() {
await
img
.
getComponent
(
param
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
return
;
}
}
});
...
...
@@ -113,11 +120,13 @@ export default function ImageReceiver() {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
...
...
@@ -128,6 +137,7 @@ export default function ImageReceiver() {
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -140,11 +150,13 @@ export default function ImageReceiver() {
img
.
getComponent
(
param
,
(
err
,
component
)
=>
{
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
return
;
}
}
});
...
...
@@ -165,6 +177,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
...
...
@@ -175,6 +188,7 @@ export default function ImageReceiver() {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -194,11 +208,13 @@ export default function ImageReceiver() {
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
checkStride
(
component
.
rowStride
,
component
.
pixelStride
);
done
();
return
;
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
});
...
...
@@ -219,6 +235,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
...
...
@@ -229,6 +246,7 @@ export default function ImageReceiver() {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -242,12 +260,14 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
console
.
log
(
`
${
testNum
}
geterror: `
+
err
);
done
();
return
;
}
else
{
expect
(
component
!=
undefined
).
assertTrue
();
expect
(
component
.
componentType
==
param
).
assertTrue
();
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
checkStride
(
component
.
rowStride
,
component
.
pixelStride
);
done
();
return
;
}
});
}
...
...
@@ -263,12 +283,14 @@ export default function ImageReceiver() {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
try
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
param
,
()
=>
{
expect
(
false
).
assertTrue
();
...
...
@@ -277,6 +299,7 @@ export default function ImageReceiver() {
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
return
;
}
var
dummy
=
receiver
.
test
;
}
...
...
@@ -302,12 +325,14 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
console
.
info
(
"
receiver_001 undefined
"
);
done
();
return
;
}
else
{
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
expect
(
receiver
.
format
==
FORMATJPEG
).
assertTrue
();
done
();
return
;
}
});
...
...
@@ -516,12 +541,14 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400 undefined
"
);
done
();
return
;
}
else
{
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
expect
(
receiver
.
format
==
FORMATJPEG
).
assertTrue
();
done
();
return
;
}
});
...
...
@@ -548,15 +575,18 @@ export default function ImageReceiver() {
);
expect
(
isString
(
id
)).
assertTrue
();
done
();
return
;
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
else
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
});
...
...
@@ -581,11 +611,13 @@ export default function ImageReceiver() {
);
expect
(
isString
(
id
)).
assertTrue
();
done
();
return
;
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -607,15 +639,18 @@ export default function ImageReceiver() {
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 release
"
);
expect
(
true
).
assertTrue
();
done
();
return
;
})
.
catch
((
error
)
=>
{
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -636,16 +671,19 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 release fail
"
);
done
();
return
;
}
else
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 release call back
"
);
expect
(
true
).
assertTrue
();
done
();
return
;
}
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -665,6 +703,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
...
...
@@ -674,16 +713,19 @@ export default function ImageReceiver() {
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 readLatestImage Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
return
;
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -703,6 +745,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
...
...
@@ -712,11 +755,13 @@ export default function ImageReceiver() {
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
return
;
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -736,6 +781,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
var
dummy
=
receiver
.
test
;
expect
(
receiver
!=
undefined
).
assertTrue
();
...
...
@@ -746,16 +792,19 @@ export default function ImageReceiver() {
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
return
;
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -775,6 +824,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
...
...
@@ -782,18 +832,21 @@ export default function ImageReceiver() {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 readNextImage call back Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
return
;
}
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished
"
);
done
();
return
;
}
});
...
...
@@ -869,11 +922,13 @@ export default function ImageReceiver() {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
let
pass
=
false
;
receiver
.
on
(
"
imageArrival
"
,
(
err
)
=>
{
...
...
@@ -881,6 +936,7 @@ export default function ImageReceiver() {
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on err
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
pass
=
true
;
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on call back IN
"
);
...
...
@@ -891,6 +947,7 @@ export default function ImageReceiver() {
await
sleep
(
2000
);
expect
(
pass
).
assertTrue
();
done
();
return
;
}
});
...
...
@@ -917,6 +974,7 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
...
...
@@ -930,6 +988,7 @@ export default function ImageReceiver() {
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -943,11 +1002,13 @@ export default function ImageReceiver() {
.
then
(()
=>
{
expect
(
true
).
assertTrue
();
done
();
return
;
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
});
}
})
...
...
@@ -955,6 +1016,7 @@ export default function ImageReceiver() {
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 readLatestImage err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
});
});
...
...
@@ -981,13 +1043,12 @@ export default function ImageReceiver() {
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
});
var
dummy
=
receiver
.
test
;
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
...
...
@@ -1007,9 +1068,11 @@ export default function ImageReceiver() {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
true
).
assertTrue
();
done
();
return
;
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录