Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e4c3d1d6
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看板
提交
e4c3d1d6
编写于
2月 18, 2022
作者:
F
fulizhong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify videoRecorder testcases Signed-off-by: FULIZHONG<fulizhong@huawei.com>
Signed-off-by:
N
fulizhong
<
fulizhong@huawei.com
>
上级
af28f521
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
233 addition
and
40 deletion
+233
-40
multimedia/BUILD.gn
multimedia/BUILD.gn
+4
-2
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
...layer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
+0
-10
multimedia/media/media_js_standard/videoRecorder/Test.json
multimedia/media/media_js_standard/videoRecorder/Test.json
+6
-0
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
...der/src/main/js/test/VideoRecorderAPICallbackTest.test.js
+14
-14
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
...er/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
+56
-8
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
...der/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
+153
-6
未找到文件。
multimedia/BUILD.gn
浏览文件 @
e4c3d1d6
...
...
@@ -18,12 +18,14 @@ group("multimedia") {
if (is_standard_system) {
deps = [
"audio/audio_js_standard/audioManager:audio_manager_js_hap",
"media/media_js_standard/audioDecoder:audio_decoder_js_hap",
"media/media_js_standard/audioEncoder:audio_encoder_js_hap",
"media/media_js_standard/audioPlayer:audio_player_js_hap",
"media/media_js_standard/videoPlayer:video_player_js_hap",
"media/media_js_standard/videoRecorder:video_recorder_js_hap",
"medialibrary/mediaLibrary_js_standard:mediaLibrary_js_hap",
#"media/media_js_standard/audioRecorder:audio_recorder_js_hap",
#"media/media_js_standard/audioDecoder:audio_decoder_js_hap",
#"media/media_js_standard/audioEncoder:audio_encoder_js_hap",
]
} else {
deps = [
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
浏览文件 @
e4c3d1d6
...
...
@@ -1143,16 +1143,6 @@ describe('VideoPlayerFuncPromiseTest', function () {
console
.
info
(
'
case reset called!!
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoPlayer
.
getDisplaySurface
().
then
((
outSurface
)
=>
{
videoPlayer
.
url
=
AUDIO_SOURCE
;
surfaceID
=
outSurface
;
},
failureCallback
).
catch
(
catchCallback
);
await
videoPlayer
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
expect
(
videoPlayer
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case setDisplaySurface success
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoPlayer
.
prepare
().
then
(()
=>
{
expect
(
videoPlayer
.
state
).
assertEqual
(
'
prepared
'
);
expect
(
videoPlayer
.
duration
).
assertEqual
(
DURATION_TIME
);
...
...
multimedia/media/media_js_standard/videoRecorder/Test.json
浏览文件 @
e4c3d1d6
...
...
@@ -52,6 +52,12 @@
"touch /data/media/40.mp4"
,
"touch /data/media/41.mp4"
,
"touch /data/media/42.mp4"
,
"touch /data/media/43.mp4"
,
"touch /data/media/44.mp4"
,
"touch /data/media/45.mp4"
,
"touch /data/media/46.mp4"
,
"touch /data/media/47.mp4"
,
"touch /data/media/48.mp4"
,
"touch /data/media/API.mp4"
,
"chmod -R 777 /data/media"
,
"setenforce 0"
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
浏览文件 @
e4c3d1d6
...
...
@@ -403,7 +403,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
PREPARE_EVENT
,
ERROR_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
PREPARE_EVENT
,
ERROR_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -434,7 +434,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
SETPAUSE
,
SETSTART
,
RESUME_EVENT
,
PREPARE_EVENT
,
ERROR_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
PREPARE_EVENT
,
ERROR_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -464,7 +464,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
RESET_EVENT
,
CLOSE_STREAM
,
PREPARE_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
CLOSE_STREAM
,
RESET_EVENT
,
PREPARE_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -523,7 +523,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -538,7 +538,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
START_EVENT
,
ERROR_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
START_EVENT
,
ERROR_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -554,7 +554,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
SETPAUSE
,
SETSTART
,
RESUME_EVENT
,
START_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -599,7 +599,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -614,7 +614,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
START_EVENT
,
START_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
START_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -776,7 +776,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
RESUME_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
START_EVENT
,
RESUME_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -792,7 +792,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
SETPAUSE
,
SETSTART
,
RESUME_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
RESUME_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -853,7 +853,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
SETPAUSE
,
SETSTART
,
RESUME_EVENT
,
RESUME_EVENT
,
RESUME_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
RESUME_EVENT
,
RESUME_EVENT
,
RESUME_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -1134,7 +1134,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
GETSURFACE_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
GETSURFACE_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -1149,7 +1149,7 @@ describe('VideoRecorderAPICallbackTest', function () {
it
(
'
SUB_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
GETSURFACE_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
SETPAUSE
,
PAUSE_EVENT
,
GETSURFACE_EVENT
,
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
@@ -1165,7 +1165,7 @@ describe('VideoRecorderAPICallbackTest', function () {
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_STREEAM
,
START_EVENT
,
SETPAUSE
,
PAUSE_EVENT
,
SETPAUSE
,
SETSTART
,
RESUME_EVENT
,
GETSURFACE_EVENT
,
CLOSE_STREAM
,
RELEASE_EVENT
,
END_EVENT
);
RELEASE_EVENT
,
CLOSE_STREAM
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
浏览文件 @
e4c3d1d6
...
...
@@ -304,14 +304,6 @@ describe('RecorderLocalTestVideoFUNC', function () {
eventEmitter
.
on
(
RELEASE_EVENT
,
async
(
videoRecorder
,
steps
,
done
)
=>
{
steps
.
shift
();
await
videoOutput
.
stop
().
then
(()
=>
{
console
.
info
(
'
case videoOutput stop success
'
);
});
await
videoOutput
.
release
().
then
(()
=>
{
console
.
info
(
'
case videoOutput release success
'
);
});
videoOutput
=
undefined
;
await
stopCaptureSession
();
videoRecorder
.
release
((
err
)
=>
{
if
(
typeof
(
err
)
==
'
undefined
'
)
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
...
...
@@ -321,6 +313,14 @@ describe('RecorderLocalTestVideoFUNC', function () {
printfError
(
err
,
done
);
}
});
await
videoOutput
.
stop
().
then
(()
=>
{
console
.
info
(
'
case videoOutput stop success
'
);
});
await
videoOutput
.
release
().
then
(()
=>
{
console
.
info
(
'
case videoOutput release success
'
);
});
videoOutput
=
undefined
;
await
stopCaptureSession
();
});
/* *
...
...
@@ -675,4 +675,52 @@ describe('RecorderLocalTestVideoFUNC', function () {
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200
* @tc.name : 22.videoFrameRate 20 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200
'
,
0
,
async
function
(
done
)
{
videoConfig
.
url
=
'
file:///data/media/46.mp4
'
;
videoConfig
.
videoFrameRate
=
20
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300
* @tc.name : 23.videoFrameRate 30 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300
'
,
0
,
async
function
(
done
)
{
videoConfig
.
url
=
'
file:///data/media/47.mp4
'
;
videoConfig
.
videoFrameRate
=
30
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400
* @tc.name : 24.videoFrameRate 60 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level1
*/
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400
'
,
0
,
async
function
(
done
)
{
videoConfig
.
url
=
'
file:///data/media/48.mp4
'
;
videoConfig
.
videoFrameRate
=
60
;
let
videoRecorder
=
null
;
let
mySteps
=
new
Array
(
CREATE_EVENT
,
PREPARE_EVENT
,
GETSURFACE_EVENT
,
START_EVENT
,
RELEASE_EVENT
,
END_EVENT
);
eventEmitter
.
emit
(
mySteps
[
0
],
videoRecorder
,
mySteps
,
done
);
})
})
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
浏览文件 @
e4c3d1d6
...
...
@@ -219,11 +219,12 @@ describe('RecorderLocalTestVideoFUNC', function () {
console
.
info
(
'
case start called
'
);
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
release
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
stopVideoOutput
(
videoOutput
);
done
();
})
...
...
@@ -270,7 +271,6 @@ describe('RecorderLocalTestVideoFUNC', function () {
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
pause
().
then
(()
=>
{
console
.
info
(
'
case pause called
'
);
sleep
(
PAUSE_TIME
);
...
...
@@ -280,6 +280,7 @@ describe('RecorderLocalTestVideoFUNC', function () {
console
.
info
(
'
case release
'
);
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
stopVideoOutput
(
videoOutput
);
done
();
})
...
...
@@ -343,6 +344,7 @@ describe('RecorderLocalTestVideoFUNC', function () {
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
stopVideoOutput
(
videoOutput
);
done
();
})
...
...
@@ -388,12 +390,12 @@ describe('RecorderLocalTestVideoFUNC', function () {
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
stop
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
stopped
'
);
console
.
info
(
'
case stop called
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
release
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
...
...
@@ -442,12 +444,12 @@ describe('RecorderLocalTestVideoFUNC', function () {
expect
(
videoRecorder
.
state
).
assertEqual
(
'
playing
'
);
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
reset
().
then
(()
=>
{
console
.
info
(
'
case reset called
'
);
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
release
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
...
...
@@ -642,6 +644,7 @@ describe('RecorderLocalTestVideoFUNC', function () {
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
stopVideoOutput
(
videoOutput
);
done
();
})
...
...
@@ -1369,4 +1372,148 @@ describe('RecorderLocalTestVideoFUNC', function () {
await
stopVideoOutput
(
videoOutput
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2200
* @tc.name : 22.videoFrameRate 20 (promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2200
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
undefined
;
let
surfaceID
=
''
;
let
videoOutput
;
videoConfig
.
url
=
'
file:///data/media/43.mp4
'
;
videoConfig
.
videoFrameRate
=
20
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
videoRecorder
=
recorder
;
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
}
else
{
console
.
info
(
'
case recordr is undefined!!
'
);
expect
().
assertFail
();
}
},
failureCallback
).
catch
(
catchCallback
);
await
videoRecorder
.
prepare
(
videoConfig
).
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
prepared
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoRecorder
.
getInputSurface
().
then
((
outPutSurface
)
=>
{
surfaceID
=
outPutSurface
;
},
failureCallback
).
catch
(
catchCallback
);
videoOutput
=
await
camera
.
createVideoOutput
(
surfaceID
);
await
startVideoOutput
(
videoOutput
);
await
videoRecorder
.
start
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
playing
'
);
console
.
info
(
'
case start called
'
);
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
release
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
stopVideoOutput
(
videoOutput
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2300
* @tc.name : 23.videoFrameRate 30 (promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2300
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
undefined
;
let
surfaceID
=
''
;
let
videoOutput
;
videoConfig
.
url
=
'
file:///data/media/44.mp4
'
;
videoConfig
.
videoFrameRate
=
30
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
videoRecorder
=
recorder
;
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
}
else
{
console
.
info
(
'
case recordr is undefined!!
'
);
expect
().
assertFail
();
}
},
failureCallback
).
catch
(
catchCallback
);
await
videoRecorder
.
prepare
(
videoConfig
).
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
prepared
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoRecorder
.
getInputSurface
().
then
((
outPutSurface
)
=>
{
surfaceID
=
outPutSurface
;
},
failureCallback
).
catch
(
catchCallback
);
videoOutput
=
await
camera
.
createVideoOutput
(
surfaceID
);
await
startVideoOutput
(
videoOutput
);
await
videoRecorder
.
start
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
playing
'
);
console
.
info
(
'
case start called
'
);
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
release
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
stopVideoOutput
(
videoOutput
);
done
();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2400
* @tc.name : 24.videoFrameRate 60 (promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2400
'
,
0
,
async
function
(
done
)
{
let
videoRecorder
=
undefined
;
let
surfaceID
=
''
;
let
videoOutput
;
videoConfig
.
url
=
'
file:///data/media/45.mp4
'
;
videoConfig
.
videoFrameRate
=
60
;
await
media
.
createVideoRecorder
().
then
((
recorder
)
=>
{
console
.
info
(
'
case createVideoRecorder called
'
);
if
(
typeof
(
recorder
)
!=
'
undefined
'
)
{
videoRecorder
=
recorder
;
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
}
else
{
console
.
info
(
'
case recordr is undefined!!
'
);
expect
().
assertFail
();
}
},
failureCallback
).
catch
(
catchCallback
);
await
videoRecorder
.
prepare
(
videoConfig
).
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
prepared
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoRecorder
.
getInputSurface
().
then
((
outPutSurface
)
=>
{
surfaceID
=
outPutSurface
;
},
failureCallback
).
catch
(
catchCallback
);
videoOutput
=
await
camera
.
createVideoOutput
(
surfaceID
);
await
startVideoOutput
(
videoOutput
);
await
videoRecorder
.
start
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
playing
'
);
console
.
info
(
'
case start called
'
);
sleep
(
RECORDER_TIME
);
},
failureCallback
).
catch
(
catchCallback
);
await
videoOutput
.
stop
();
await
videoRecorder
.
release
().
then
(()
=>
{
expect
(
videoRecorder
.
state
).
assertEqual
(
'
idle
'
);
console
.
info
(
'
case release
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
stopVideoOutput
(
videoOutput
);
done
();
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录