未验证 提交 a476a617 编写于 作者: O openharmony_ci 提交者: Gitee

!8532 avPlayer问题修复 用例时长优化 avRecorder用例上库

Merge pull request !8532 from Nicklaus/master
......@@ -425,7 +425,6 @@ function setAVPlayerPlayAndPauseWithCallBack(src, avPlayer, playTime, done) {
console.info('playPauseLoopWithCallBack avPlayer from play to stop')
avPlayer.release().then(() => {
console.info('playPauseLoopWithCallBack avPlayer from stop to release')
offCallback(avPlayer, ['stateChange', 'error']);
done();
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
......@@ -556,7 +555,6 @@ async function playToCompletedLoop(src, avPlayer, done) {
console.info('playToCompletedLoop avPlayer from play to stop')
avPlayer.release().then(() => {
console.info('playToCompletedLoop avPlayer from stop to release')
offCallback(avPlayer, ['stateChange', 'error']);
done();
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
......@@ -621,7 +619,6 @@ export async function seekLoop(src, avPlayer, done) {
}
await avPlayer.stop().then(() => {
console.info('seekLoopWithCallback avPlayer from play to stop')
offCallback(avPlayer, ['stateChange', 'seekDone']);
avPlayer.release().then(() => {
console.info('seekLoopWithCallback avPlayer from stop to release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
......@@ -767,15 +764,12 @@ export async function createToReleaseLoop(src, avPlayer, done) {
await avPlayer.release().then(() => {
console.info('createToReleaseLoop avPlayer from stop to release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
if(i==999){
done();
}
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
console.info(`case createToReleaseLoop loop is ${i}`);
}
await avPlayer.release().then(() => {
console.info('createToReleaseLoop avPlayer from stop to release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
done();
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}
let createLoopTime = 0;
......@@ -785,7 +779,7 @@ export async function createTimeWithCallback(src, avPlayer, done) {
avPlayer = await idle(src, avPlayer)
createStart = Date.now();
console.info(`createTimeWithCallback createStart time is : ${createStart}`)
createTimeWithCallback(src, avPlayer, done)
createTimeCallback(src, avPlayer, done)
}
function createTimeCallback(src, avPlayer, done){
......@@ -1778,7 +1772,6 @@ function setSpeedTimeCallback(avPlayer, done) {
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.PLAYING);
if(loopTime == 10){
avPlayer.release().then(() => {
offCallback(avPlayer, ['stateChange', 'error']);
console.info('setSpeedTimeCallback avPlayer is release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
let avg = totalTime/10;
......@@ -1889,7 +1882,6 @@ function setBitrateTimeCallback(avPlayer, done) {
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.PLAYING);
if(loopTime == 10){
avPlayer.release().then(() => {
offCallback(avPlayer, ['stateChange', 'error']);
console.info('setBitrateTimeCallback avPlayer is release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
let avg = totalTime/10;
......@@ -2001,7 +1993,6 @@ function setVolumeTimeCallback(avPlayer, done) {
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.PLAYING);
if(loopTime == 10){
avPlayer.release().then(() => {
offCallback(avPlayer, ['stateChange', 'error']);
console.info('setVolumeTimeCallback avPlayer is release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
let avg = totalTime/10;
......@@ -2058,7 +2049,6 @@ export async function firstFrameTime(src, avPlayer, done) {
console.info("firstFrameTime execution time is :" + execution)
sleep(100)
avPlayer.release().then(() => {
offCallback(avPlayer, ['stateChange','startRenderFrame']);
console.info('firstFrameTime avPlayer is release')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.RELEASED);
avPlayer = null;
......@@ -2122,6 +2112,13 @@ function setAVPlayerPlay(src, avPlayer, done) {
case AV_PLAYER_STATE.PLAYING:
console.info('setAVPlayerPlay play state is PLAYING')
expect(avPlayer.state).assertEqual(AV_PLAYER_STATE.PLAYING);
if(avPlayer.duration > 3000){
mediaTestBase.msleepAsync(3000);
avPlayer.seek(avPlayer.duration, media.SeekMode.SEEK_NEXT_SYNC)
}else{
mediaTestBase.msleepAsync(500);
avPlayer.seek(avPlayer.duration, media.SeekMode.SEEK_NEXT_SYNC)
}
break;
case AV_PLAYER_STATE.COMPLETED:
expect(avPlayer.currentTime).assertEqual(avPlayer.duration);
......@@ -2131,7 +2128,6 @@ function setAVPlayerPlay(src, avPlayer, done) {
break;
case AV_PLAYER_STATE.RELEASED:
expect(avPlayer.state).assertEqual('released');
offCallback(avPlayer, ['stateChange', 'error']);
avPlayer = null;
done();
break;
......
......@@ -887,14 +887,14 @@ export default function AVPlayerStabilityTest() {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVPLAYER_STABILITY_01_0800 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_PERFORMANCE_01_0100
* @tc.name : 001.test create time (wait callback)
* @tc.desc : Local Video test create time (wait callback)
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level3
*/
// /* *
// * @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_PERFORMANCE_01_0100
// * @tc.name : 001.test create time (wait callback)
// * @tc.desc : Local Video test create time (wait callback)
// * @tc.size : MediumTest
// * @tc.type : Function test
// * @tc.level : Level3
// */
// it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_PERFORMANCE_01_0100', 0, async function (done) {
// console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVPLAYER_PERFORMANCE_01_0100 start')
// AVPlayerTestBase.createTimeWithCallback(videos[0], avPlayer, done);
......
......@@ -2,9 +2,9 @@
"description": "Configuration for avRecorder Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "2000000",
"shell-timeout": "2000000",
"testcase-timeout": 150000,
"test-timeout": "6000000",
"shell-timeout": "6000000",
"testcase-timeout": 1100000,
"bundle-name": "ohos.acts.multimedia.audio.avrecorder",
"package-name": "ohos.acts.multimedia.audio.avrecorder"
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册