Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0c6456f5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c6456f5
编写于
6月 24, 2022
作者:
F
fengzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete format check and code check
Signed-off-by:
N
fengzewu
<
fengzewu@huawei.com
>
上级
812d99af
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
27 deletion
+30
-27
multimedia/BUILD.gn
multimedia/BUILD.gn
+1
-1
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+29
-26
未找到文件。
multimedia/BUILD.gn
浏览文件 @
0c6456f5
...
...
@@ -24,8 +24,8 @@ group("multimedia") {
"image/image_js_standard/imageDecodeOptions:image_DecodeOptions_js_hap",
"image/image_js_standard/imageExif:image_exif_js_hap",
"image/image_js_standard/imagePixelMapFramework:image_pixelmapframework_js_hap",
"image/image_js_standard/imageWebp:image_webp_js_hap",
"image/image_js_standard/imageReceiver:image_receiver_js_hap",
"image/image_js_standard/imageWebp:image_webp_js_hap",
"media/media_js_standard/audioCodecFormat:audio_codec_format_js_hap",
"media/media_js_standard/audioDecoder:audio_decoder_js_hap",
"media/media_js_standard/audioEncoder:audio_encoder_js_hap",
...
...
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
0c6456f5
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
...
@@ -49,8 +63,7 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
expect
(
true
).
assertTrue
();
...
...
@@ -61,8 +74,7 @@ describe('ImageReceiver', function () {
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -88,8 +100,7 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
expect
(
true
).
assertTrue
();
...
...
@@ -100,8 +111,7 @@ describe('ImageReceiver', function () {
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -128,8 +138,7 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -142,7 +151,6 @@ describe('ImageReceiver', function () {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -156,7 +164,6 @@ describe('ImageReceiver', function () {
if
(
component
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
component
.
componentType
==
param
).
assertTrue
();
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
...
...
@@ -175,8 +182,7 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -189,7 +195,6 @@ describe('ImageReceiver', function () {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -220,7 +225,6 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
try
{
receiver
.
on
(
param
,
()
=>
{
...
...
@@ -487,7 +491,7 @@ describe('ImageReceiver', function () {
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_005 release fail
'
);
done
()
done
()
;
}
else
{
console
.
info
(
'
Receiver_005 release call back
'
);
expect
(
true
).
assertTrue
();
...
...
@@ -497,7 +501,7 @@ describe('ImageReceiver', function () {
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_005 finished
'
);
done
()
done
()
;
}
})
...
...
@@ -527,7 +531,7 @@ describe('ImageReceiver', function () {
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_006 finished
'
);
done
()
done
()
;
}
})
...
...
@@ -575,7 +579,7 @@ describe('ImageReceiver', function () {
receiver
.
readNextImage
().
then
(
img
=>
{
console
.
info
(
'
Receiver_008 readNextImage Success
'
);
expect
(
img
!=
undefined
).
assertTrue
();
done
()
done
()
;
}).
catch
(
error
=>
{
console
.
log
(
'
Receiver_008 error:
'
+
error
);
expect
(
false
).
assertTrue
();
...
...
@@ -693,6 +697,7 @@ describe('ImageReceiver', function () {
it
(
'
Receiver_010_4
'
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
'
Receiver_010_4
'
,
JPEG
)
})
/**
* @tc.number : Receiver_010_5
* @tc.name : getComponent-YUV_Y
...
...
@@ -707,6 +712,7 @@ describe('ImageReceiver', function () {
it
(
'
Receiver_010_5
'
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
'
Receiver_010_5
'
,
YUV_Y
)
})
/**
* @tc.number : Receiver_010_6
* @tc.name : getComponent-YUV_V
...
...
@@ -721,6 +727,7 @@ describe('ImageReceiver', function () {
it
(
'
Receiver_010_6
'
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
'
Receiver_010_6
'
,
YUV_V
)
})
/**
* @tc.number : Receiver_010_7
* @tc.name : getComponent-YUV_U
...
...
@@ -735,6 +742,7 @@ describe('ImageReceiver', function () {
it
(
'
Receiver_010_7
'
,
0
,
async
function
(
done
)
{
getComponentCb
(
done
,
'
Receiver_010_7
'
,
YUV_U
)
})
/**
* @tc.number : Receiver_011
* @tc.name : on
...
...
@@ -749,7 +757,6 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
let
pass
=
false
;
receiver
.
on
(
'
imageArrival
'
,
(
err
)
=>
{
...
...
@@ -787,7 +794,6 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -800,7 +806,6 @@ describe('ImageReceiver', function () {
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
...
...
@@ -843,7 +848,6 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -855,8 +859,7 @@ describe('ImageReceiver', function () {
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
return
;
done
();
}
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录