Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9d008cbc
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,发现更多精彩内容 >>
提交
9d008cbc
编写于
3月 09, 2022
作者:
F
fulizhong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix videoPlayer case Signed-off-by: NOBUGGERS<ruanmeng@huawei.com>
Signed-off-by:
N
fulizhong
<
fulizhong@huawei.com
>
上级
6fb6950a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
87 addition
and
19 deletion
+87
-19
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
...corder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
+1
-1
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
...order/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
+1
-1
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
...layer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
+77
-13
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
...der/src/main/js/test/VideoRecorderAPICallbackTest.test.js
+4
-2
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
...der/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
+4
-2
未找到文件。
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js
浏览文件 @
9d008cbc
...
...
@@ -32,7 +32,7 @@ describe('RecorderLocalTestAudioAPI', function () {
const
SOURCE_TYPE
=
1
;
const
ENCORDER_AACLC
=
3
;
const
CHANNEL_TWO
=
2
;
const
RECORDER_TIME
=
1
000
;
const
RECORDER_TIME
=
3
000
;
let
fdPath
;
let
fileAsset
;
let
fdNumber
;
...
...
multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js
浏览文件 @
9d008cbc
...
...
@@ -31,7 +31,7 @@ describe('RecorderLocalTestAudioFUNC', function () {
const
RESET_STATE
=
6
;
const
RELEASE_STATE
=
7
;
const
ERROR_STATE
=
8
;
const
RECORDER_TIME
=
1
000
;
const
RECORDER_TIME
=
3
000
;
const
CHANNEL_ONE
=
1
;
const
CHANNEL_TWO
=
2
;
const
FORMAT_MP4
=
2
;
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
浏览文件 @
9d008cbc
...
...
@@ -127,31 +127,96 @@ describe('VideoPlayerFuncPromiseTest', function () {
/* *
* @tc.number : SUB_MEDIA_PLAYER_MULTIPLE_0100
* @tc.name : 001.Multi-instance (
16
promise)
* @tc.name : 001.Multi-instance (
2 videoPlayer
promise)
* @tc.desc : Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MEDIA_PLAYER_MULTIPLE_0100
'
,
0
,
async
function
(
done
)
{
let
arr
=
new
Array
();
for
(
let
i
=
0
;
i
<
14
;
i
++
)
{
await
getFd
();
setTimeout
(
async
function
()
{
surfaceID
=
globalThis
.
value
;
console
.
info
(
'
case new surfaceID is
'
+
surfaceID
);
let
testVideoPlayer1
=
null
;
let
testVideoPlayer2
=
null
;
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
arr
[
i
]
=
video
console
.
info
(
'
case createVideoPlayer success
'
+
i
);
testVideoPlayer1
=
video
console
.
info
(
'
case createVideoPlayer success
'
);
}
else
{
console
.
info
(
'
case createVideoPlayer is failed
'
);
expect
().
assertFail
();
}
},
failureCallback
).
catch
(
catchCallback
);
}
for
(
let
j
=
0
;
j
<
14
;
j
++
)
{
await
arr
[
j
].
release
().
then
(()
=>
{
console
.
info
(
'
case release success
'
+
j
);
},
failureCallback
).
catch
(
catchCallback
);
}
done
();
testVideoPlayer1
.
url
=
fdPath
;
await
testVideoPlayer1
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
console
.
info
(
'
case setDisplaySurface success
'
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
idle
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
testVideoPlayer1
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called!!
'
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
prepared
'
);
expect
(
testVideoPlayer1
.
duration
).
assertEqual
(
DURATION_TIME
);
expect
(
testVideoPlayer1
.
width
).
assertEqual
(
WIDTH_VALUE
);
expect
(
testVideoPlayer1
.
height
).
assertEqual
(
HEIGHT_VALUE
);
},
failureCallback
).
catch
(
catchCallback
);
let
startTime
=
testVideoPlayer1
.
currentTime
;
await
testVideoPlayer1
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called!!
'
);
sleep
(
PLAY_TIME
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
playing
'
);
},
failureCallback
).
catch
(
catchCallback
);
let
endTime
=
testVideoPlayer1
.
currentTime
;
expect
(
endTime
-
startTime
).
assertClose
(
PLAY_TIME
,
DELTA_TIME
);
await
testVideoPlayer1
.
release
().
then
(()
=>
{
console
.
info
(
'
case release called!!
'
);
},
failureCallback
).
catch
(
catchCallback
);
testVideoPlayer1
=
null
;
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
testVideoPlayer2
=
video
console
.
info
(
'
case createVideoPlayer success
'
);
}
else
{
console
.
info
(
'
case createVideoPlayer is failed
'
);
expect
().
assertFail
();
}
},
failureCallback
).
catch
(
catchCallback
);
testVideoPlayer2
.
url
=
fdPath
;
await
testVideoPlayer2
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
console
.
info
(
'
case setDisplaySurface success
'
);
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
idle
'
);
},
failureCallback
).
catch
(
catchCallback
);
await
testVideoPlayer2
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called!!
'
);
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
prepared
'
);
expect
(
testVideoPlayer2
.
duration
).
assertEqual
(
DURATION_TIME
);
expect
(
testVideoPlayer2
.
width
).
assertEqual
(
WIDTH_VALUE
);
expect
(
testVideoPlayer2
.
height
).
assertEqual
(
HEIGHT_VALUE
);
},
failureCallback
).
catch
(
catchCallback
);
startTime
=
testVideoPlayer2
.
currentTime
;
await
testVideoPlayer2
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called!!
'
);
sleep
(
PLAY_TIME
);
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
playing
'
);
},
failureCallback
).
catch
(
catchCallback
);
endTime
=
testVideoPlayer2
.
currentTime
;
expect
(
endTime
-
startTime
).
assertClose
(
PLAY_TIME
,
DELTA_TIME
);
await
testVideoPlayer2
.
release
().
then
(()
=>
{
console
.
info
(
'
case release called!!
'
);
},
failureCallback
).
catch
(
catchCallback
);
testVideoPlayer2
=
null
;
done
();
},
1000
);
})
/* *
...
...
@@ -163,7 +228,6 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0
*/
it
(
'
SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
await
getFd
();
setTimeout
(
async
function
()
{
surfaceID
=
globalThis
.
value
;
console
.
info
(
'
case new surfaceID is
'
+
surfaceID
);
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
浏览文件 @
9d008cbc
...
...
@@ -44,6 +44,8 @@ describe('VideoRecorderAPICallbackTest', function () {
let
videoOutput
;
let
surfaceID
;
let
fdPath
;
let
fileAsset
;
let
fdNumber
;
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
...
...
@@ -130,8 +132,8 @@ describe('VideoRecorderAPICallbackTest', function () {
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
let
fileAsset
=
await
fetchFileResult
.
getAllObject
();
let
fdNumber
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
fileAsset
=
await
fetchFileResult
.
getAllObject
();
fdNumber
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
fdPath
=
"
fd://
"
+
fdNumber
.
toString
();
}
}
...
...
multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
浏览文件 @
9d008cbc
...
...
@@ -25,6 +25,8 @@ describe('VideoRecorderFuncPromiseTest', function () {
let
cameras
;
let
captureSession
;
let
fdPath
;
let
fileAsset
;
let
fdNumber
;
let
configFile
=
{
audioBitrate
:
48000
,
audioChannels
:
2
,
...
...
@@ -164,8 +166,8 @@ describe('VideoRecorderFuncPromiseTest', function () {
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
let
fileAsset
=
await
fetchFileResult
.
getAllObject
();
let
fdNumber
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
fileAsset
=
await
fetchFileResult
.
getAllObject
();
fdNumber
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
fdPath
=
"
fd://
"
+
fdNumber
.
toString
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录