Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fb749a3a
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看板
未验证
提交
fb749a3a
编写于
5月 26, 2023
作者:
黄
黄开兴
提交者:
Gitee
5月 26, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update receiver.test.js.
Signed-off-by:
N
黄开兴
<
huangkaixing@huawei.com
>
上级
b184a22d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
0 addition
and
46 deletion
+0
-46
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+0
-46
未找到文件。
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
fb749a3a
...
@@ -17,8 +17,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
...
@@ -17,8 +17,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
export
default
function
ImageReceiver
()
{
export
default
function
ImageReceiver
()
{
describe
(
"
ImageReceiver
"
,
function
()
{
describe
(
"
ImageReceiver
"
,
function
()
{
let
globalreceiver
;
let
globalImg
;
const
WIDTH
=
8192
;
const
WIDTH
=
8192
;
const
HEIGHT
=
8
;
const
HEIGHT
=
8
;
const
CAPACITY
=
8
;
const
CAPACITY
=
8
;
...
@@ -36,22 +34,6 @@ export default function ImageReceiver() {
...
@@ -36,22 +34,6 @@ export default function ImageReceiver() {
});
});
afterEach
(
async
function
()
{
afterEach
(
async
function
()
{
if
(
globalImg
!=
undefined
)
{
console
.
info
(
"
globalImg release start
"
);
try
{
await
globalImg
.
release
();
}
catch
(
error
)
{
console
.
info
(
"
globalImg release fail
"
);
}
}
if
(
globalreceiver
!=
undefined
)
{
console
.
info
(
"
globalreceiver release start
"
);
try
{
await
globalreceiver
.
release
();
}
catch
(
error
)
{
console
.
info
(
"
globalreceiver release fail
"
);
}
}
console
.
info
(
"
afterEach case
"
);
console
.
info
(
"
afterEach case
"
);
});
});
...
@@ -89,7 +71,6 @@ export default function ImageReceiver() {
...
@@ -89,7 +71,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -107,7 +88,6 @@ export default function ImageReceiver() {
...
@@ -107,7 +88,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalImg
=
img
;
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
console
.
log
(
`
${
testNum
}
img.format:
${
img
.
format
}
`
)
console
.
log
(
`
${
testNum
}
img.format:
${
img
.
format
}
`
)
...
@@ -142,7 +122,6 @@ export default function ImageReceiver() {
...
@@ -142,7 +122,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -160,7 +139,6 @@ export default function ImageReceiver() {
...
@@ -160,7 +139,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalImg
=
img
;
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
console
.
log
(
`
${
testNum
}
img.format:
${
img
.
format
}
`
)
console
.
log
(
`
${
testNum
}
img.format:
${
img
.
format
}
`
)
...
@@ -195,7 +173,6 @@ export default function ImageReceiver() {
...
@@ -195,7 +173,6 @@ export default function ImageReceiver() {
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
return
;
return
;
}
}
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -213,7 +190,6 @@ export default function ImageReceiver() {
...
@@ -213,7 +190,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalImg
=
img
;
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
checkFormat
(
img
.
format
);
checkFormat
(
img
.
format
);
...
@@ -255,7 +231,6 @@ export default function ImageReceiver() {
...
@@ -255,7 +231,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
}
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -273,7 +248,6 @@ export default function ImageReceiver() {
...
@@ -273,7 +248,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalImg
=
img
;
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
checkFormat
(
img
.
format
);
checkFormat
(
img
.
format
);
...
@@ -311,7 +285,6 @@ export default function ImageReceiver() {
...
@@ -311,7 +285,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalreceiver
=
receiver
;
try
{
try
{
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
...
@@ -354,7 +327,6 @@ export default function ImageReceiver() {
...
@@ -354,7 +327,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalreceiver
=
receiver
;
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
...
@@ -571,7 +543,6 @@ export default function ImageReceiver() {
...
@@ -571,7 +543,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalreceiver
=
receiver
;
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
...
@@ -594,7 +565,6 @@ export default function ImageReceiver() {
...
@@ -594,7 +565,6 @@ export default function ImageReceiver() {
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
receiver
.
getReceivingSurfaceId
()
.
getReceivingSurfaceId
()
.
then
((
id
)
=>
{
.
then
((
id
)
=>
{
...
@@ -633,7 +603,6 @@ export default function ImageReceiver() {
...
@@ -633,7 +603,6 @@ export default function ImageReceiver() {
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
.
getReceivingSurfaceId
((
err
,
id
)
=>
{
receiver
.
getReceivingSurfaceId
((
err
,
id
)
=>
{
console
.
info
(
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 getReceivingSurfaceId call back [
"
+
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 getReceivingSurfaceId call back [
"
+
...
@@ -664,7 +633,6 @@ export default function ImageReceiver() {
...
@@ -664,7 +633,6 @@ export default function ImageReceiver() {
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
receiver
.
release
()
.
release
()
.
then
(()
=>
{
.
then
(()
=>
{
...
@@ -698,7 +666,6 @@ export default function ImageReceiver() {
...
@@ -698,7 +666,6 @@ export default function ImageReceiver() {
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
.
release
((
err
)
=>
{
receiver
.
release
((
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -740,11 +707,9 @@ export default function ImageReceiver() {
...
@@ -740,11 +707,9 @@ export default function ImageReceiver() {
}
}
var
dummy
=
receiver
.
test
;
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
receiver
.
readLatestImage
()
.
readLatestImage
()
.
then
((
img
)
=>
{
.
then
((
img
)
=>
{
globalImg
=
img
;
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 readLatestImage Success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 readLatestImage Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
expect
(
img
!=
undefined
).
assertTrue
();
done
();
done
();
...
@@ -784,9 +749,7 @@ export default function ImageReceiver() {
...
@@ -784,9 +749,7 @@ export default function ImageReceiver() {
}
}
var
dummy
=
receiver
.
test
;
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
.
readLatestImage
((
err
,
img
)
=>
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
globalImg
=
img
;
console
.
info
(
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 readLatestImage call back Success
"
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 readLatestImage call back Success
"
);
);
...
@@ -823,11 +786,9 @@ export default function ImageReceiver() {
...
@@ -823,11 +786,9 @@ export default function ImageReceiver() {
var
dummy
=
receiver
.
test
;
var
dummy
=
receiver
.
test
;
expect
(
receiver
!=
undefined
).
assertTrue
();
expect
(
receiver
!=
undefined
).
assertTrue
();
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
receiver
.
readNextImage
()
.
readNextImage
()
.
then
((
img
)
=>
{
.
then
((
img
)
=>
{
globalImg
=
img
;
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
expect
(
img
!=
undefined
).
assertTrue
();
done
();
done
();
...
@@ -867,14 +828,12 @@ export default function ImageReceiver() {
...
@@ -867,14 +828,12 @@ export default function ImageReceiver() {
}
}
var
dummy
=
receiver
.
test
;
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
if
(
receiver
!=
undefined
)
{
globalreceiver
=
receiver
;
receiver
.
readNextImage
((
err
,
img
)
=>
{
receiver
.
readNextImage
((
err
,
img
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalImg
=
img
;
console
.
info
(
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 readNextImage call back Success
"
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 readNextImage call back Success
"
);
);
...
@@ -965,7 +924,6 @@ export default function ImageReceiver() {
...
@@ -965,7 +924,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -1012,7 +970,6 @@ export default function ImageReceiver() {
...
@@ -1012,7 +970,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
}
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -1033,7 +990,6 @@ export default function ImageReceiver() {
...
@@ -1033,7 +990,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
else
{
}
else
{
globalImg
=
img
;
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
RGBA
).
assertTrue
();
expect
(
img
.
format
==
RGBA
).
assertTrue
();
...
@@ -1083,7 +1039,6 @@ export default function ImageReceiver() {
...
@@ -1083,7 +1039,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
}
globalreceiver
=
receiver
;
var
error
=
receiver
.
checkDeviceTest
;
var
error
=
receiver
.
checkDeviceTest
;
if
(
DEVICE_CODE
==
error
)
{
if
(
DEVICE_CODE
==
error
)
{
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
expect
(
error
==
DEVICE_CODE
).
assertTrue
();
...
@@ -1100,7 +1055,6 @@ export default function ImageReceiver() {
...
@@ -1100,7 +1055,6 @@ export default function ImageReceiver() {
done
();
done
();
return
;
return
;
}
}
globalImg
=
img
;
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
RGBA
).
assertTrue
();
expect
(
img
.
format
==
RGBA
).
assertTrue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录