Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
855615ad
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看板
提交
855615ad
编写于
4月 28, 2022
作者:
F
fulizhong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify videoPlayer testcase Signed-off-by: FULIZHONG<fulizhong@huawei.com>
Signed-off-by:
N
fulizhong
<
fulizhong@huawei.com
>
上级
d8a85883
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
9 addition
and
91 deletion
+9
-91
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
...layer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
+9
-91
未找到文件。
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
浏览文件 @
855615ad
...
@@ -495,7 +495,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
...
@@ -495,7 +495,7 @@ describe('VideoPlayerFuncPromiseTest', function () {
it
(
'
SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_Loop
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_Loop
'
,
0
,
async
function
(
done
)
{
mediaTestBase
.
isFileOpen
(
fileDescriptor
,
done
);
mediaTestBase
.
isFileOpen
(
fileDescriptor
,
done
);
let
videoPlayer
=
null
;
let
videoPlayer
=
null
;
let
bufferCount
=
0
;
let
bufferCount
=
false
;
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
videoPlayer
=
video
;
videoPlayer
=
video
;
...
@@ -508,17 +508,23 @@ describe('VideoPlayerFuncPromiseTest', function () {
...
@@ -508,17 +508,23 @@ describe('VideoPlayerFuncPromiseTest', function () {
videoPlayer
.
on
(
'
playbackCompleted
'
,
async
()
=>
{
videoPlayer
.
on
(
'
playbackCompleted
'
,
async
()
=>
{
console
.
info
(
'
case playbackCompleted success
'
);
console
.
info
(
'
case playbackCompleted success
'
);
await
videoPlayer
.
play
().
then
(()
=>
{
expect
(
videoPlayer
.
loop
).
assertEqual
(
false
);
console
.
info
(
'
case play called!!
'
);
mediaTestBase
.
msleep
(
PLAY_TIME
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
release
().
then
(()
=>
{
await
videoPlayer
.
release
().
then
(()
=>
{
console
.
info
(
'
case release called!!
'
);
console
.
info
(
'
case release called!!
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
expect
(
bufferCount
).
assertEqual
(
19
);
expect
(
bufferCount
).
assertEqual
(
true
);
done
();
done
();
});
});
videoPlayer
.
on
(
'
bufferingUpdate
'
,
(
infoType
,
value
)
=>
{
videoPlayer
.
on
(
'
bufferingUpdate
'
,
(
infoType
,
value
)
=>
{
console
.
info
(
'
case bufferingUpdate success infoType is
'
+
infoType
);
console
.
info
(
'
case bufferingUpdate success infoType is
'
+
infoType
);
console
.
info
(
'
case bufferingUpdate success value is
'
+
value
);
console
.
info
(
'
case bufferingUpdate success value is
'
+
value
);
bufferCount
++
;
bufferCount
=
true
;
console
.
info
(
'
case bufferingUpdate bufferCount value is
'
+
bufferCount
);
console
.
info
(
'
case bufferingUpdate bufferCount value is
'
+
bufferCount
);
});
});
...
@@ -670,92 +676,4 @@ describe('VideoPlayerFuncPromiseTest', function () {
...
@@ -670,92 +676,4 @@ describe('VideoPlayerFuncPromiseTest', function () {
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
videoPlayer
.
loop
=
false
;
videoPlayer
.
loop
=
false
;
})
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_MULTIPLE
* @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_VIDEO_PLAYER_FUNCTION_PROMISE_MULTIPLE
'
,
0
,
async
function
(
done
)
{
mediaTestBase
.
isFileOpen
(
fileDescriptor
,
done
);
let
testVideoPlayer1
=
null
;
let
testVideoPlayer2
=
null
;
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
console
.
info
(
'
case createVideoPlayer success
'
);
testVideoPlayer1
=
video
;
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
idle
'
);
}
else
{
console
.
info
(
'
case createVideoPlayer is failed
'
);
expect
().
assertFail
();
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
testVideoPlayer1
.
url
=
fdHead
+
fileDescriptor
.
fd
;
await
testVideoPlayer1
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
console
.
info
(
'
case setDisplaySurface success
'
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
idle
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
toNewPage
(
page
);
page
=
(
page
+
1
)
%
2
;
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
surfaceID
=
globalThis
.
value
;
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
console
.
info
(
'
case createVideoPlayer success
'
);
testVideoPlayer2
=
video
;
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
idle
'
);
}
else
{
console
.
info
(
'
case createVideoPlayer is failed
'
);
expect
().
assertFail
();
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
testVideoPlayer2
.
url
=
fdHead
+
fileDescriptor
.
fd
;
await
testVideoPlayer2
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
console
.
info
(
'
case setDisplaySurface success
'
);
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
idle
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
testVideoPlayer1
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called!!
'
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
prepared
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
testVideoPlayer1
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called!!
'
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
playing
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
testVideoPlayer2
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called!!
'
);
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
prepared
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
testVideoPlayer2
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called!!
'
);
expect
(
testVideoPlayer2
.
state
).
assertEqual
(
'
playing
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
mediaTestBase
.
msleep
(
PLAY_TIME
);
await
testVideoPlayer1
.
reset
().
then
(()
=>
{
console
.
info
(
'
case reset called!!
'
);
expect
(
testVideoPlayer1
.
state
).
assertEqual
(
'
idle
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
testVideoPlayer1
.
url
=
fdHead
+
fileDescriptor
.
fd
;
await
testVideoPlayer2
.
release
().
then
(()
=>
{
console
.
info
(
'
case release called!!
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
await
testVideoPlayer1
.
release
().
then
(()
=>
{
console
.
info
(
'
case release called!!
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
done
();
})
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录