Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
703af7fc
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看板
未验证
提交
703af7fc
编写于
1月 05, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 05, 2023
浏览文件
操作
浏览文件
下载
差异文件
!6899 audio player timeupdate 事件从seekdon改成position上报,测试用例进行对应修改
Merge pull request !6899 from FULIZHONG/OpenHarmony-3.1-Release
上级
53986267
2ae9dc64
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
45 deletion
+17
-45
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
...ioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
+5
-16
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
...oPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
+11
-26
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
...layer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
+1
-3
未找到文件。
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js
浏览文件 @
703af7fc
...
...
@@ -128,6 +128,9 @@ describe('PlayerLocalTestAudioAPI', function () {
case
SEEK_STATE
:
console
.
info
(
`case seek to time is
${
mySteps
[
SECOND_INDEX
]}
`
);
audioPlayer
.
seek
(
mySteps
[
SECOND_INDEX
]);
mySteps
.
shift
();
mySteps
.
shift
();
nextStep
(
mySteps
,
done
);
break
;
case
VOLUME_STATE
:
console
.
info
(
`case to setVolume`
);
...
...
@@ -206,22 +209,7 @@ describe('PlayerLocalTestAudioAPI', function () {
console
.
info
(
`case seek filed,errcode is
${
seekDoneTime
}
`
);
return
;
}
if
(
mySteps
[
0
]
!=
SEEK_STATE
)
{
return
;
}
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case seekDoneTime is
${
seekDoneTime
}
`
);
console
.
info
(
`case seek called`
);
expect
(
audioPlayer
.
currentTime
+
DELTA_TIME
).
assertClose
(
seekDoneTime
+
DELTA_TIME
,
DELTA_TIME
);
console
.
info
(
`case loop is
${
audioPlayer
.
loop
}
`
);
if
((
audioPlayer
.
loop
==
true
)
&&
(
seekDoneTime
==
DURATION_TIME
))
{
console
.
info
(
'
case loop is true
'
);
sleep
(
PLAY_STATE
);
}
if
((
seekDoneTime
<
audioPlayer
.
duration
)
||
(
audioPlayer
.
state
==
'
paused
'
))
{
nextStep
(
mySteps
,
done
);
}
console
.
info
(
`case timeUpdate, seekDoneTime is
${
seekDoneTime
}
`
);
});
audioPlayer
.
on
(
'
volumeChange
'
,
()
=>
{
console
.
info
(
`case setvolume called`
);
...
...
@@ -250,6 +238,7 @@ describe('PlayerLocalTestAudioAPI', function () {
nextStep
(
mySteps
,
done
);
}
else
if
(
mySteps
[
0
]
==
ERROR_STATE
)
{
mySteps
.
shift
();
nextStep
(
mySteps
,
done
);
}
else
if
(
mySteps
[
0
]
==
END_STATE
)
{
console
.
info
(
'
case release player error
'
);
}
else
{
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js
浏览文件 @
703af7fc
...
...
@@ -129,6 +129,11 @@ describe('PlayerLocalTestAudioFUNC', function () {
case
SEEK_STATE
:
console
.
info
(
`case seek to time is
${
mySteps
[
SECOND_INDEX
]}
`
);
audioPlayer
.
seek
(
mySteps
[
SECOND_INDEX
]);
if
(
mySteps
[
2
]
!=
ERROR_STATE
)
{
mySteps
.
shift
();
mySteps
.
shift
();
nextStep
(
mySteps
,
done
);
}
break
;
case
VOLUME_STATE
:
console
.
info
(
`case to setVolume`
);
...
...
@@ -139,6 +144,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
mySteps
.
shift
();
audioPlayer
.
release
();
audioPlayer
=
undefined
;
nextStep
(
mySteps
,
done
);
break
;
case
LOOP_STATE
:
audioPlayer
.
loop
=
mySteps
[
SECOND_INDEX
];
...
...
@@ -205,26 +211,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
nextStep
(
mySteps
,
done
);
});
audioPlayer
.
on
(
'
timeUpdate
'
,
(
seekDoneTime
)
=>
{
if
(
typeof
(
seekDoneTime
)
==
'
undefined
'
)
{
console
.
info
(
`case seek filed,errcode is
${
seekDoneTime
}
`
);
return
;
}
if
(
mySteps
[
0
]
!=
SEEK_STATE
)
{
return
;
}
mySteps
.
shift
();
mySteps
.
shift
();
console
.
info
(
`case seekDoneTime is
${
seekDoneTime
}
`
);
console
.
info
(
`case seek called`
);
expect
(
audioPlayer
.
currentTime
+
DELTA_TIME
).
assertClose
(
seekDoneTime
+
DELTA_TIME
,
DELTA_TIME
);
console
.
info
(
`case loop is
${
audioPlayer
.
loop
}
`
);
if
((
audioPlayer
.
loop
==
true
)
&&
(
seekDoneTime
==
DURATION_TIME
))
{
console
.
info
(
'
case loop is true
'
);
sleep
(
PLAY_STATE
);
}
if
((
seekDoneTime
<
audioPlayer
.
duration
)
||
(
audioPlayer
.
state
==
'
paused
'
))
{
nextStep
(
mySteps
,
done
);
}
console
.
info
(
'
case timeUpdate seekDoneTime is
'
+
seekDoneTime
);
});
audioPlayer
.
on
(
'
volumeChange
'
,
()
=>
{
console
.
info
(
`case setvolume called`
);
...
...
@@ -243,18 +230,16 @@ describe('PlayerLocalTestAudioFUNC', function () {
nextStep
(
mySteps
,
done
);
});
audioPlayer
.
on
(
'
error
'
,
(
err
)
=>
{
console
.
info
(
`case error called,errName is
${
err
.
name
}
`
);
console
.
info
(
`case error called,errCode is
${
err
.
code
}
`
);
console
.
info
(
`case error called,errMessage is
${
err
.
message
}
`
);
if
((
mySteps
[
0
]
==
SEEK_STATE
)
||
(
mySteps
[
0
]
==
VOLUME_STATE
))
{
mySteps
.
shift
();
mySteps
.
shift
();
mySteps
.
shift
();
}
else
{
mySteps
.
shift
();
mySteps
.
shift
();
}
nextStep
(
mySteps
,
done
);
expect
(
mySteps
[
0
]).
assertEqual
(
ERROR_STATE
);
mySteps
.
shift
();
nextStep
(
mySteps
,
done
);
});
}
...
...
@@ -452,7 +437,7 @@ describe('PlayerLocalTestAudioFUNC', function () {
*/
it
(
'
SUB_MEDIA_PLAYER_LOCAL_AUDIO_FUNCTION_04_1500
'
,
0
,
async
function
(
done
)
{
let
mySteps
=
new
Array
(
SRC_STATE
,
PLAY_STATE
,
PAUSE_STATE
,
SEEK_STATE
,
DURATION_TIME
,
PLAY_STATE
,
FINISH_STATE
,
END_STATE
);
PLAY_STATE
,
FINISH_STATE
,
RESET_STATE
,
RELEASE_STATE
,
END_STATE
);
initAudioPlayer
();
setCallback
(
mySteps
,
done
);
audioPlayer
.
src
=
fdPath
;
...
...
multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js
浏览文件 @
703af7fc
...
...
@@ -114,13 +114,11 @@ describe('PlayerLocalTestAudioFormat', function () {
return
;
}
console
.
info
(
'
case seek success, and seek time is
'
+
seekDoneTime
);
if
(
!
isToDuration
)
{
if
(
(
!
isToDuration
)
&&
(
seekDoneTime
>=
SEEK_TIME
)
)
{
expect
(
SEEK_TIME
).
assertEqual
(
seekDoneTime
);
isToDuration
=
true
;
sleep
(
PLAY_TIME
);
audioPlayer
.
seek
(
audioPlayer
.
duration
);
}
else
{
expect
(
audioPlayer
.
duration
).
assertEqual
(
seekDoneTime
);
}
});
audioPlayer
.
on
(
'
volumeChange
'
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录