Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3e01f7b7
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看板
未验证
提交
3e01f7b7
编写于
11月 14, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6282 YUV split API test
Merge pull request !6282 from caochuan/receiver2
上级
59771a5f
45f3a311
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
145 addition
and
24 deletion
+145
-24
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+145
-24
未找到文件。
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
3e01f7b7
...
...
@@ -21,6 +21,9 @@ export default function ImageReceiver() {
const
HEIGHT
=
8
;
const
CAPACITY
=
8
;
const
RGBA
=
12
;
const
YCBCR
=
22
;
const
Jpg_YStride
=
1
;
const
UVStride
=
2
;
const
{
JPEG
:
FORMATJPEG
,
YCBCR_422_SP
}
=
image
.
ImageFormat
;
const
{
YUV_Y
,
YUV_U
,
YUV_V
,
JPEG
}
=
image
.
ComponentType
;
beforeAll
(
async
function
()
{
...
...
@@ -142,8 +145,8 @@ export default function ImageReceiver() {
}
}
async
function
getComponentPromise
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
YCBCR_422_SP
,
CAPACITY
);
async
function
getComponentPromise
(
done
,
testNum
,
format
,
param
,
checkFormat
,
checkStride
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
format
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
...
...
@@ -161,7 +164,7 @@ export default function ImageReceiver() {
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
RGBA
).
assertTrue
(
);
checkFormat
(
img
.
format
);
expect
(
img
.
clipRect
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
clipRect
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
clipRect
.
x
==
0
).
assertTrue
();
...
...
@@ -175,8 +178,7 @@ export default function ImageReceiver() {
}
expect
(
component
.
componentType
==
param
).
assertTrue
();
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
expect
(
component
.
rowStride
==
8192
).
assertTrue
();
expect
(
component
.
pixelStride
==
1
).
assertTrue
();
checkStride
(
component
.
rowStride
,
component
.
pixelStride
);
done
();
})
.
catch
((
error
)
=>
{
...
...
@@ -188,11 +190,15 @@ export default function ImageReceiver() {
});
expect
(
true
).
assertTrue
();
});
var
dummy
=
receiver
.
test
;
if
(
format
==
FORMATJPEG
)
{
var
dummy
=
receiver
.
test
;
}
else
{
var
dummy
=
receiver
.
testYUV
;
}
}
async
function
getComponentCb
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
YCBCR_422_SP
,
CAPACITY
);
async
function
getComponentCb
(
done
,
testNum
,
format
,
param
,
checkFormat
,
checkStride
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
format
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
...
...
@@ -211,7 +217,7 @@ export default function ImageReceiver() {
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
RGBA
).
assertTrue
(
);
checkFormat
(
img
.
format
);
expect
(
img
.
clipRect
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
clipRect
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
clipRect
.
x
==
0
).
assertTrue
();
...
...
@@ -225,8 +231,7 @@ export default function ImageReceiver() {
expect
(
component
!=
undefined
).
assertTrue
();
expect
(
component
.
componentType
==
param
).
assertTrue
();
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
expect
(
component
.
rowStride
==
8192
).
assertTrue
();
expect
(
component
.
pixelStride
==
1
).
assertTrue
();
checkStride
(
component
.
rowStride
,
component
.
pixelStride
);
done
();
}
});
...
...
@@ -234,7 +239,11 @@ export default function ImageReceiver() {
});
expect
(
true
).
assertTrue
();
});
var
dummy
=
receiver
.
test
;
if
(
format
==
FORMATJPEG
)
{
var
dummy
=
receiver
.
test
;
}
else
{
var
dummy
=
receiver
.
testYUV
;
}
}
async
function
onErr
(
done
,
testNum
,
param
)
{
...
...
@@ -543,8 +552,8 @@ export default function ImageReceiver() {
.
then
((
id
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 getReceivingSurfaceId [
"
+
id
+
"
]
"
id
+
"
]
"
);
expect
(
isString
(
id
)).
assertTrue
();
done
();
...
...
@@ -576,8 +585,8 @@ export default function ImageReceiver() {
receiver
.
getReceivingSurfaceId
((
err
,
id
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 getReceivingSurfaceId call back [
"
+
id
+
"
]
"
id
+
"
]
"
);
expect
(
isString
(
id
)).
assertTrue
();
done
();
...
...
@@ -789,7 +798,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100
"
,
0
,
async
function
(
done
)
{
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100
"
,
JPEG
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
RGBA
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
Jpg_YStride
);
expect
(
pixelStride
==
Jpg_YStride
);
}
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100
"
,
FORMATJPEG
,
JPEG
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -804,7 +827,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100
"
,
0
,
async
function
(
done
)
{
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100
"
,
YUV_U
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
YCBCR
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
UVStride
);
expect
(
pixelStride
==
UVStride
);
}
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100
"
,
YCBCR_422_SP
,
YUV_U
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -819,7 +856,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100
"
,
0
,
async
function
(
done
)
{
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100
"
,
YUV_V
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
YCBCR
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
UVStride
);
expect
(
pixelStride
==
UVStride
);
}
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100
"
,
YCBCR_422_SP
,
YUV_V
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -834,7 +885,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100
"
,
0
,
async
function
(
done
)
{
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100
"
,
YUV_Y
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
YCBCR
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
Jpg_YStride
);
expect
(
pixelStride
==
Jpg_YStride
);
}
getComponentPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100
"
,
YCBCR_422_SP
,
YUV_Y
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -849,7 +914,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100
"
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100
"
,
JPEG
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
RGBA
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
Jpg_YStride
);
expect
(
pixelStride
==
Jpg_YStride
);
}
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100
"
,
FORMATJPEG
,
JPEG
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -864,7 +943,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100
"
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100
"
,
YUV_Y
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
YCBCR
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
Jpg_YStride
);
expect
(
pixelStride
==
Jpg_YStride
);
}
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100
"
,
YCBCR_422_SP
,
YUV_Y
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -879,7 +972,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100
"
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100
"
,
YUV_V
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
YCBCR
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
UVStride
);
expect
(
pixelStride
==
UVStride
);
}
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100
"
,
YCBCR_422_SP
,
YUV_V
,
checkFormat
,
checkStride
);
});
/**
...
...
@@ -894,7 +1001,21 @@ export default function ImageReceiver() {
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100
"
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100
"
,
YUV_U
);
function
checkFormat
(
imgformat
)
{
expect
(
imgformat
==
YCBCR
);
}
function
checkStride
(
rowStride
,
pixelStride
)
{
expect
(
rowStride
==
WIDTH
/
UVStride
);
expect
(
pixelStride
==
UVStride
);
}
getComponentCb
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100
"
,
YCBCR_422_SP
,
YUV_U
,
checkFormat
,
checkStride
);
});
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录