未验证 提交 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;
......
......@@ -36,6 +36,7 @@ export async function idleCallback(avRecorder, avConfig, done) {
});
}
// create avRecorder(promise)
export async function idle(avRecorder) {
console.info('case createAVRecorder called');
await media.createAVRecorder().then((recorder) => {
......@@ -68,6 +69,8 @@ export function prepareCallback(avRecorder, avConfig) {
avRecorder.prepare(avConfig, (err) => {
console.info('case prepare called' + err);
if (err == null) {
sleep(200)
console.error(`case prepare success, state is ${avRecorder.state}`);
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
console.info('prepare success');
} else {
......@@ -92,7 +95,7 @@ export async function getInputSurfacePromise(avRecorder) {
let surfaceID = null;
if (typeof(avRecorder) == 'undefined') {
return;
}
}
await avRecorder.getInputSurface().then((surfaceId) => {
console.info('getInputSurface success');
surfaceID = surfaceId;
......@@ -116,16 +119,18 @@ export function getInputSurfaceCallback(avRecorder) {
});
}
export function startCallback(avRecorder, recorderTime) {
export async function startCallback(avRecorder, recorderTime) {
if (typeof(avRecorder) == 'undefined') {
return;
}
avRecorder.start((err) => {
await avRecorder.start((err) => {
console.info('case start called');
if (err == null) {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
console.info('start AVRecorder success');
sleep(recorderTime);
if (recorderTime != undefined) {
sleep(recorderTime);
}
} else {
console.info('start AVRecorder failed and error is ' + err.message);
}
......@@ -150,11 +155,11 @@ export async function startPromise(avRecorder, recorderTime) {
}
}
export function pauseCallback(avRecorder) {
export async function pauseCallback(avRecorder) {
if (typeof(avRecorder) == 'undefined') {
return;
}
avRecorder.pause((err) => {
await avRecorder.pause((err) => {
console.info('case pause called');
if (err == null) {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PAUSED);
......@@ -177,11 +182,11 @@ export async function pausePromise(avRecorder) {
});
}
export function resumeCallback(avRecorder) {
export async function resumeCallback(avRecorder) {
if (typeof(avRecorder) == 'undefined') {
return;
}
avRecorder.resume((err) => {
await avRecorder.resume((err) => {
console.info('case resume called');
if (err == null) {
console.info('resume AVRecorder success');
......@@ -197,7 +202,7 @@ export async function resumePromise(avRecorder) {
}
await avRecorder.resume().then(() => {
console.info('resume success');
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}
export function stopCallback(avRecorder) {
......@@ -227,11 +232,11 @@ export async function stopPromise(avRecorder) {
});
}
export function resetCallback(avRecorder) {
export async function resetCallback(avRecorder) {
if (typeof(avRecorder) == 'undefined') {
return;
}
avRecorder.reset((err) => {
await avRecorder.reset((err) => {
console.info('case reset called');
if (err == null) {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE);
......@@ -253,7 +258,7 @@ export async function resetPromise(avRecorder) {
});
}
export function releaseCallback(avRecorder) {
export async function releaseCallback(avRecorder) {
if (typeof(avRecorder) == 'undefined') {
return;
}
......@@ -298,7 +303,7 @@ export function offCallback(avRecorder, typeArr)
if (avRecorder == null) {
return;
}
for (let i = 0; i < typeArr.length; i++) {
for (let i = 0; i < typeArr.length; i++) {
switch (typeArr[i]) {
case 'stateChange':
avRecorder.off('stateChange');
......@@ -320,7 +325,7 @@ export async function setOnCallback(avConfig, avRecorder, recorderTime, done) {
case AV_RECORDER_STATE.IDLE:
console.info(`case avRecorderWithCallBack is idle`);
expect(avRecorder.state).assertEqual("idle");
// start->stop->release
// start->stop->release
prepareCallback(avRecorder, avConfig);
break;
case AV_RECORDER_STATE.PREPARED:
......@@ -356,7 +361,7 @@ export async function setOnCallback(avConfig, avRecorder, recorderTime, done) {
console.info('case state is unknown');
}
});
avRecorder.on('error', (err) => {
console.info('case avRecorder.on(error) called, errMessage is ' + err.message);
});
......@@ -388,6 +393,7 @@ export async function setPrepareOnCallback(avConfig, avRecorder, recorderTime, d
}
export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime, done) {
// Create an instance
avRecorder = await idle(avRecorder)
setOnCallback(avConfig, avRecorder, recorderTime, done);
await avRecorder.prepare(avConfig)
......@@ -395,7 +401,6 @@ export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime,
export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
......@@ -412,7 +417,6 @@ export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
......@@ -430,7 +434,6 @@ export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
......@@ -446,7 +449,6 @@ export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack5(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
......@@ -479,7 +481,6 @@ export async function avRecorderWithCallBack6(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack7(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
......@@ -577,136 +578,25 @@ export async function avRecorderWithCallBack13(avConfig, avRecorder, recorderTim
});
}
export async function setPrepareOnPromise(avRecorder, avConfig, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.IDLE:
console.info(`case avRecorderWithPreparePromise is idled`)
expect(avRecorder.state).assertEqual('idle');
while (loopTimes > 0) {
avRecorder.prepare(avConfig).then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
loopTimes--;
console.info('prepare success');
}).catch((err) => {
console.info('prepare failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.PREPARED:
console.info(`case avRecorderWithPreparePromise is prepared`)
expect(avRecorder.state).assertEqual('prepared');
if (loopTimes <= 0) {
releasePromise(avRecorder);
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case setPrepareOnCallback is released`);
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
}
export async function avRecorderWithPreparePromise(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await resetPromise(avRecorder);
setPrepareOnPromise(avRecorder, avConfig, loopTimes, done);
}
export async function setStartOnPromise(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.PREPARED:
console.info(`case avRecorderWithStartPromise is prepared`)
expect(avRecorder.state).assertEqual('prepared');
while (loopTimes > 0) {
avRecorder.start().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
loopTimes--;
console.info('start success');
}).catch((err) => {
console.info('start failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.STARTED:
console.info(`case avRecorderWithStartPromise is started`)
expect(avRecorder.state).assertEqual('started');
if (loopTimes <= 0) {
releasePromise(avRecorder);
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case setPrepareOnCallback is released`);
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
while (loopTimes > 0) {
await preparePromise(avRecorder, avConfig);
loopTimes--;
}
await releaseDone(avRecorder, done)
}
export async function avRecorderWithStartPromise(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
setStartOnPromise(avRecorder, loopTimes, done);
}
export async function setPauseOnPromise(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.STARTED:
console.info(`case avRecorderWithPausePromise is started`)
expect(avRecorder.state).assertEqual('started');
while (loopTimes > 0) {
avRecorder.pause().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PAUSED);
loopTimes--;
console.info('pause success');
}).catch((err) => {
console.info('pause failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.PAUSED:
console.info(`case avRecorderWithPausePromise is paused`)
expect(avRecorder.state).assertEqual('paused');
if (loopTimes <= 0) {
releasePromise(avRecorder);
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case setPrepareOnCallback is released`);
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
while (loopTimes > 0) {
await startPromise(avRecorder);
loopTimes--;
}
await releaseDone(avRecorder, done)
}
export async function avRecorderWithPausePromise(avConfig, avRecorder, recorderTime, loopTimes, done) {
......@@ -714,47 +604,11 @@ export async function avRecorderWithPausePromise(avConfig, avRecorder, recorderT
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
setPauseOnPromise(avRecorder, loopTimes, done);
}
export async function setResumeOnPromise(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.PAUSED:
console.info(`case avRecorderWithResumePromise is paused`)
expect(avRecorder.state).assertEqual('paused');
while (loopTimes > 0) {
avRecorder.resume().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PAUSED);
loopTimes--;
console.info('resume success');
}).catch((err) => {
console.info('resume failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.STARTED:
console.info(`case avRecorderWithResumePromise is resumed`)
expect(avRecorder.state).assertEqual('started');
if (loopTimes <= 0) {
releasePromise(avRecorder);
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case setPrepareOnCallback is released`);
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
while (loopTimes > 0) {
await pausePromise(avRecorder);
loopTimes--;
}
await releaseDone(avRecorder, done)
}
export async function avRecorderWithResumePromise(avConfig, avRecorder, recorderTime, loopTimes, done) {
......@@ -763,46 +617,11 @@ export async function avRecorderWithResumePromise(avConfig, avRecorder, recorder
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
await pausePromise(avRecorder);
setResumeOnPromise(avRecorder, loopTimes, done);
}
export async function setStopOnPromise(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.STARTED:
console.info(`case avRecorderWithStopPromise is started`)
expect(avRecorder.state).assertEqual('started');
while (loopTimes > 0) {
avRecorder.stop().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STOPPED);
loopTimes--;
console.info('stop success');
}).catch((err) => {
console.info('stop failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.STOPPED:
console.info(`case avRecorderWithStopPromise is stopped`)
expect(avRecorder.state).assertEqual('stopped');
if (loopTimes <= 0) {
releasePromise(avRecorder);
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case setPrepareOnCallback is released`);
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
while (loopTimes > 0) {
await resumePromise(avRecorder);
loopTimes--;
}
await releaseDone(avRecorder, done)
}
export async function avRecorderWithStopPromise(avConfig, avRecorder, recorderTime, loopTimes, done) {
......@@ -810,46 +629,11 @@ export async function avRecorderWithStopPromise(avConfig, avRecorder, recorderTi
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
setStopOnPromise(avRecorder, loopTimes, done);
}
export async function setResetOnPromise(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.STARTED:
console.info(`case avRecorderWithResetPromise is started`)
expect(avRecorder.state).assertEqual('started');
while (loopTimes > 0) {
avRecorder.reset().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE);
loopTimes--;
console.info('reset success');
}).catch((err) => {
console.info('reset failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.IDLE:
console.info(`case avRecorderWithResetPromise is reseted`)
expect(avRecorder.state).assertEqual('idle');
if (loopTimes <= 0) {
releasePromise(avRecorder);
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case setPrepareOnCallback is released`);
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
while (loopTimes > 0) {
await stopPromise(avRecorder);
loopTimes--;
}
await releaseDone(avRecorder, done)
}
export async function avRecorderWithResetPromise(avConfig, avRecorder, recorderTime, loopTimes, done) {
......@@ -857,41 +641,11 @@ export async function avRecorderWithResetPromise(avConfig, avRecorder, recorderT
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
setResetOnPromise(avRecorder, loopTimes, done);
}
export async function setReleaseOnPromise(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.STARTED:
console.info(`case avRecorderWithReleasePromise is started`)
expect(avRecorder.state).assertEqual('started');
while (loopTimes > 0) {
avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
loopTimes--;
console.info('release success');
}).catch((err) => {
console.info('release failed and catch error is ' + err.message);
});
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case avRecorderWithReleasePromise is released`)
expect(avRecorder.state).assertEqual('released');
if (loopTimes <= 0) {
offCallback(avRecorder, ['stateChange', 'error']);
done();
}
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
while (loopTimes > 0) {
await resetPromise(avRecorder);
loopTimes--;
}
await releaseDone(avRecorder, done)
}
export async function avRecorderWithReleasePromise(avConfig, avRecorder, recorderTime, loopTimes, done) {
......@@ -899,469 +653,364 @@ export async function avRecorderWithReleasePromise(avConfig, avRecorder, recorde
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
setReleaseOnPromise(avRecorder, loopTimes, done);
while (loopTimes > 0) {
await releasePromise(avRecorder);
loopTimes--;
}
done();
}
export async function avRecorderWithPrepareCallback(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
while (loopTimes > 0) {
if(loopTimes == 1){
avRecorder.release()
done();
}
prepareCallback(avRecorder, avConfig);
loopTimes--;
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
}
export async function avRecorderWithStartCallback(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
sleep(300)
await avRecorder.prepare(avConfig).then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
console.info('prepare success');
}).catch((err) => {
console.info('prepare failed and catch error is ' + err.message);
});
await sleep(300)
while (loopTimes > 0) {
avRecorder.start((err) => {
console.info('case start called');
if (err == null) {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
console.info('start AVRecorder success');
} else {
console.info('start AVRecorder failed and error is ' + err.message);
}
})
console.info(`avRecorderWithStartCallback loop time is :${loopTimes}`)
startCallback(avRecorder);
await sleep(200)
loopTimes--;
if(loopTimes == 0){
await avRecorder.release().then(() => {
console.info(`avRecorderWithStartCallback release success`)
done();
}).catch((err) => {
console.info('release avRecorderWithStartCallback failed and catch error is ' + err.message);
});
done();
}
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
}
export async function avRecorderWithPauseCallback(avConfig, avRecorder, recorderTime, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
console.info('case avRecorderWithPauseCallback avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
while (loopTimes > 0) {
pauseCallback(avRecorder, avConfig);
loopTimes--;
for(var i = 0;i < 1001;i++){
if(i == 1000){
avRecorder.release()
done();
}else{
console.info(`avRecorderWithPauseCallback loop time is :${i}`)
}
await pauseCallback(avRecorder, avConfig);
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
}
export async function avRecorderWithResumeCallback(avConfig, avRecorder, recorderTime, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
console.info('case avRecorderWithPauseCallback avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
await pausePromise(avRecorder);
while (loopTimes > 0) {
resumeCallback(avRecorder, avConfig);
loopTimes--;
for(var i = 0;i < 1001;i++){
if(i == 1000){
avRecorder.release()
done();
}else{
console.info(`avRecorderWithResumeCallback loop time is :${i}`)
}
await resumeCallback(avRecorder);
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
}
export async function avRecorderWithStopCallback(avConfig, avRecorder, recorderTime, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
console.info('case avRecorderWithStopCallback avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
while (loopTimes > 0) {
if(loopTimes == 1){
avRecorder.release()
done();
}
stopCallback(avRecorder, avConfig);
loopTimes--;
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
// await releaseDone(avRecorder, done)
}
export async function avRecorderWithResetCallback(avConfig, avRecorder, recorderTime, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
console.info('case avRecorderWithResetCallback avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
while (loopTimes > 0) {
resetCallback(avRecorder, avConfig);
if(loopTimes == 1){
avRecorder.release()
done();
}
await resetCallback(avRecorder);
loopTimes--;
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
// await releaseDone(avRecorder, done)
}
export async function avRecorderWithReleaseCallback(avConfig, avRecorder, recorderTime, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
console.info('case avRecorderWithReleaseCallback avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
while (loopTimes > 0) {
if(loopTimes == 1){
avRecorder.release()
done();
}
releaseCallback(avRecorder, avConfig);
loopTimes--;
}
done();
}
export async function avRecorderWithLongRun(avConfig, avRecorder, recorderTime, done) {
///xxxxx
export async function avRecorderLoopPrepare2ResetWithPromise(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime);
await stopPromise(avRecorder);
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
}
export async function avRecorderLoopPrepare2Reset(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
sleep(300)
console.info('case avRecorderLoopPrepare2ResetWithPromise avConfig.url is ' + avConfig.url);
while (loopTimes > 0) {
prepareCallback(avRecorder, avConfig);
startCallback(avRecorder);
resetCallback(avRecorder);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder);
await resetPromise(avRecorder);
console.info(`avRecorderLoopPrepare2ResetWithPromise loop time is :${loopTimes}`)
loopTimes--;
if(loopTimes == 0){
await avRecorder.release().then(() => {
console.info(`avRecorderLoopPrepare2ResetWithPromise release success`)
done();
}).catch((err) => {
console.info('release avRecorderLoopPrepare2ResetWithPromise failed and catch error is ' + err.message);
});
done();
}
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
// await releaseDone(avRecorder, done)
}
export async function avRecorderLoopCreate2Release(avConfig, avRecorder, loopTimes, done) {
export async function avRecorderLoopCreate2ReleaseWithPromise(avConfig, avRecorder, loopTimes, done) {
console.info(`avRecorderLoopCreate2ReleaseWithPromise loop begin`)
while (loopTimes > 0) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
prepareCallback(avRecorder, avConfig);
startCallback(avRecorder);
resetCallback(avRecorder);
releaseCallback(avRecorder);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder);
await resetPromise(avRecorder);
await releasePromise(avRecorder);
console.info(`avRecorderLoopCreate2ReleaseWithPromise loop time is :${loopTimes}`)
loopTimes--;
if(loopTimes == 0){
done();
}
}
done();
}
export async function avRecorderLoopPrepare2Stop(avConfig, avRecorder, loopTimes, done) {
export async function avRecorderLoopPrepare2StopWithPromise(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
while (loopTimes > 0) {
prepareCallback(avRecorder, avConfig);
startCallback(avRecorder);
stopCallback(avRecorder);
await startPromise(avRecorder);
await stopPromise(avRecorder);
loopTimes--;
console.info(`avRecorderLoopPrepare2StopWithPromise loop time is :${loopTimes}`)
if(loopTimes == 0){
await avRecorder.release().then(() => {
done();
console.info(`avRecorderLoopPrepare2StopWithPromise release success`)
}).catch((err) => {
console.info('release avRecorderLoopPrepare2StopWithPromise failed and catch error is ' + err.message);
});
}
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
// await releaseDone(avRecorder, done)
}
export async function avRecorderLoopPause2Resume(avConfig, avRecorder, loopTimes, done) {
export async function avRecorderLoopPause2ResumeWithPromise(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
sleep(200)
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
sleep(200)
await startPromise(avRecorder);
while (loopTimes > 0) {
pauseCallback(avRecorder);
resumeCallback(avRecorder);
await pausePromise(avRecorder);
await sleep(20)
await resumePromise(avRecorder);
console.info(`avRecorderLoopPause2ResumeWithPromise loop time is :${loopTimes}`)
loopTimes--;
if(loopTimes == 0){
await sleep(2000)
await avRecorder.release().then(() => {
console.info(`avRecorderLoopPause2ResumeWithPromise release success`)
done();
}).catch((err) => {
console.info('release avRecorderLoopPause2ResumeWithPromise failed and catch error is ' + err.message);
});
}
}
await avRecorder.release().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('release AVRecorder failed and catch error is ' + err.message);
});
// await releaseDone(avRecorder, done)
}
export async function avRecorderLoopCreate2Release2(avConfig, avRecorder, loopTimes, done) {
export async function avRecorderLoopCreate2Release2WithPromise(avConfig, avRecorder, loopTimes, done) {
while (loopTimes > 0) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
releaseCallback(avRecorder);
await releasePromise(avRecorder);
console.info(`avRecorderLoopCreate2Release2WithPromise loop time is :${loopTimes}`)
loopTimes--;
if(loopTimes == 0){
avRecorder.release()
done();
}
}
done();
}
export async function setPrepare2ResetOnCallback(avConfig, avRecorder, done) {
console.info(`case setOnCallback in`);
let count = 0;
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.IDLE:
console.info(`case AV_RECORDER_STATE.IDLE`);
expect(avRecorder.state).assertEqual('idle');
count++;
if (count == 1001) {
releasePromise(avRecorder);
} else {
avRecorder.prepare(avConfig).then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
console.info(`case avRecorderLoopPrepare2ResetWithCallback is prepared`);
avRecorder.start().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
console.info(`case avRecorderLoopPrepare2ResetWithCallback is started`);
avRecorder.reset().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE);
console.info(`case avRecorderLoopPrepare2ResetWithCallback is reset`);
}).catch((err1) => {
console.info('reset failed and catch error is ' + err1.message);
});
}).catch((err2) => {
console.info('start failed and catch error is ' + err2.message);
});
}).catch((err3) => {
console.info('prepare failed and catch error is ' + err3.message);
});
}
case AV_RECORDER_STATE.RELEASED:
console.info(`case AV_RECORDER_STATE.RELEASED`)
expect(avRecorder.state).assertEqual('released');
offCallback(avRecorder, ['stateChange', 'error']);
export async function avRecorderLoopPrepare2ResetWithCallback(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
sleep(200)
while (loopTimes > 0) {
await avRecorder.prepare(avConfig).then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
console.info('prepare success');
}).catch((err) => {
console.info('prepare failed and catch error is ' + err.message);
});
await sleep(100)
await startCallback(avRecorder);
await sleep(100)
await resetCallback(avRecorder);
loopTimes--;
console.info(`avRecorderLoopPrepare2ResetWithCallback loop time is :${loopTimes}`)
if(loopTimes == 0){
await sleep(2000)
await avRecorder.release().then(() => {
console.info(`avRecorderLoopPrepare2ResetWithCallback release success`)
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}).catch((err) => {
console.info('release avRecorderLoopPrepare2ResetWithCallback failed and catch error is ' + err.message);
});
}
});
}
export async function avRecorderLoopPrepare2ResetWithCallback(avConfig, avRecorder, done) {
avRecorder = await idle(avRecorder);
await preparePromise(avRecorder, avConfig);
await resetPromise(avRecorder);
setPrepare2ResetOnCallback(avConfig, avRecorder, done);
}
}
export async function setCreate2ReleaseOnCallback(avRecorder, avConfig, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.IDLE:
console.info(`case AV_RECORDER_STATE.IDLE`);
expect(avRecorder.state).assertEqual('idle');
await releasePromise(avRecorder);
case AV_RECORDER_STATE.PREPARED:
console.info(`case AV_RECORDER_STATE.PREPARED`);
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
await startPromise(avRecorder);
break;
case AV_RECORDER_STATE.STARTED:
console.info(`case AV_RECORDER_STATE.STARTED`)
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
await resetPromise(avRecorder);
break;
case AV_RECORDER_STATE.RELEASED:
console.info(`case AV_RECORDER_STATE.RELEASED`);
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
loopTimes--;
if (loopTimes <= 0) {
export async function avRecorderLoopCreate2ReleaseWithCallback(avConfig, avRecorder, loopTimes, done) {
while (loopTimes > 0) {
console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start1 `)
avRecorder = await idle(avRecorder);
await sleep(200)
console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start2 `)
await avRecorder.prepare(avConfig).then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
console.info('prepare success');
}).catch((err) => {
console.info('prepare failed and catch error is ' + err.message);
});
console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start3 `)
await startCallback(avRecorder);
await sleep(100)
console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start4 `)
await resetCallback(avRecorder);
console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start5 `)
console.info(`avRecorderLoopCreate2ReleaseWithCallback loop time is :${loopTimes}`)
loopTimes--;
avRecorder.release((err) => {
if (err == null) {
console.info('release AVRecorder success');
if(loopTimes == 0){
done();
} else {
avRecorderLoopCreate2ReleaseWithCallback(avRecorder, avConfig, loopTimes, done);
}
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}
});
} else {
console.info('release AVRecorder failed and error is ' + err.message);
}
});
}
}
export async function avRecorderLoopCreate2ReleaseWithCallback(avRecorder, avConfig, loopTimes, done) {
export async function avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
sleep(200)
await preparePromise(avRecorder, avConfig);
setCreate2ReleaseOnCallback(avRecorder, loopTimes, done)
}
export async function setPrepare2StopOnCallback(avRecorder, done) {
console.info(`case setOnCallback in`);
let count = 0;
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.PREPARED:
console.info(`case AV_RECORDER_STATE.PREPARED`);
expect(avRecorder.state).assertEqual('prepared');
while (count < 1001) {
avRecorder.start().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
console.info(`case avRecorderLoopPrepare2StopWithCallback is started`);
avRecorder.stop().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STOPPED);
console.info(`case avRecorderLoopPrepare2StopWithCallback is stopped`);
count++;
}).catch((err1) => {
console.info('stop failed and catch error is ' + err1.message);
});
}).catch((err2) => {
console.info('start failed and catch error is ' + err2.message);
});
}
offCallback(avRecorder, ['stateChange', 'error']);
done();
case AV_RECORDER_STATE.STOPPED:
console.info(`case AV_RECORDER_STATE.STOPPED`)
expect(avRecorder.state).assertEqual('stopped');
if (count == 1001) {
await releasePromise(avRecorder);
}
break;
case AV_RECORDER_STATE.RELEASED:
console.info(`case AV_RECORDER_STATE.RELEASED`)
expect(avRecorder.state).assertEqual('released');
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
sleep(200)
while (loopTimes > 0) {
startCallback(avRecorder, 200);
stopCallback(avRecorder);
sleep(200)
loopTimes--;
console.info(`avRecorderLoopPrepare2StopWithCallback loop time is :${loopTimes}`)
if(loopTimes == 0){
await avRecorder.release().then(() => {
console.info(`avRecorderLoopPrepare2StopWithCallback release success`)
}).catch((err) => {
console.info('release avRecorderLoopPrepare2StopWithCallback failed and catch error is ' + err.message);
});
done();
} else {
await preparePromise(avRecorder, avConfig);
sleep(200);
}
});
}
}
export async function avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, done) {
export async function avRecorderLoopPause2ResumeWithCallback(avConfig, avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
setPrepare2StopOnCallback(avRecorder, done)
}
export async function setPause2ResumeOnCallback(avRecorder, done) {
console.info(`case setOnCallback in`);
let count = 0;
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.STARTED:
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED);
console.info(`case avRecorderLoopPause2ResumeWithCallback is started`);
count++;
if (count == 1001) {
offCallback(avRecorder, ['stateChange', 'error']);
done();
} else {
avRecorder.pause().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PAUSED);
console.info(`case avRecorderLoopPause2ResumeWithCallback is paused`);
avRecorder.reset().then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE);
console.info(`case avRecorderLoopPause2ResumeWithCallback is resumed`);
}).catch((err1) => {
console.info('reset failed and catch error is ' + err1.message);
});
}).catch((err2) => {
console.info('pause failed and catch error is ' + err2.message);
});
}
case AV_RECORDER_STATE.IDLE:
console.info(`case AV_RECORDER_STATE.IDLE`)
expect(avRecorder.state).assertEqual('idle');
if (count == 1001) {
await releasePromise(avRecorder);
}
break;
case AV_RECORDER_STATE.RELEASED:
console.info(`case AV_RECORDER_STATE.RELEASED`)
expect(avRecorder.state).assertEqual('released');
sleep(2000)
await startPromise(avRecorder);
while (loopTimes > 0) {
pauseCallback(avRecorder);
resumeCallback(avRecorder);
await sleep(50)
console.info(`avRecorderLoopPause2ResumeWithCallback loop time is :${loopTimes}`)
loopTimes--;
if(loopTimes == 0){
await sleep(2000)
await avRecorder.release().then(() => {
console.info(`avRecorderLoopPause2ResumeWithCallback release success`)
done();
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
}).catch((err) => {
console.info('release avRecorderLoopPause2ResumeWithCallback failed and catch error is ' + err.message);
});
}
});
}
export async function avRecorderLoopPause2ResumeWithCallback(avConfig, avRecorder, done) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder);
setPause2ResumeOnCallback(avRecorder, done);
}
// await releaseDone(avRecorder, done)
}
export async function setCreate2Release2OnCallback(avRecorder, loopTimes, done) {
console.info(`case setOnCallback in`);
avRecorder.on('stateChange', async (state, reason) => {
console.info('case state has changed, new state is :' + state + ',and new reason is : ' + reason);
switch (state) {
case AV_RECORDER_STATE.IDLE:
console.info(`case AV_RECORDER_STATE.IDLE`);
expect(avRecorder.state).assertEqual('idle');
case AV_RECORDER_STATE.RELEASED:
console.info(`case AV_RECORDER_STATE.RELEASED`);
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
loopTimes--;
if (loopTimes <= 0) {
done();
} else {
avRecorderLoopCreate2Release2WithCallback(avRecorder, loopTimes, done);
}
break;
case AV_RECORDER_STATE.ERROR:
console.info(`case AV_RECORDER_STATE.ERROR`)
expect(avRecorder.state).assertEqual('error');
break;
default:
console.info('case state is unknown');
export async function avRecorderLoopCreate2Release2WithCallback(avConfig, avRecorder, loopTimes, done) {
while (loopTimes > 0) {
avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url);
releaseCallback(avRecorder);
console.info(`avRecorderLoopCreate2Release2WithCallback loop time is :${loopTimes}`)
loopTimes--;
if(loopTimes == 0){
sleep(2000)
done();
}
});
}
export async function avRecorderLoopCreate2Release2WithCallback(avRecorder, loopTimes, done) {
avRecorder = await idle(avRecorder);
await releasePromise(avRecorder);
setCreate2Release2OnCallback(avRecorder, done);
}
}
export async function avRecorderReliabilitTest01(avConfig, avRecorder, recorderTime, done) {
let result = true;
avRecorder = await idle(avRecorder);
sleep(2000)
await avRecorder.pause((err) => {
if (err == null) {
console.info('pause avRecorderReliabilitTest01 success');
......@@ -1369,9 +1018,10 @@ export async function avRecorderReliabilitTest01(avConfig, avRecorder, recorderT
result = false
expect(result).assertEqual(false);
console.info('pause avRecorderReliabilitTest01 failed and error is ' + err.message);
sleep(1000)
}
});
sleep(2000)
console.info('pause avRecorderReliabilitTest01 001');
await releaseDone(avRecorder, done)
}
......@@ -2579,7 +2229,7 @@ export async function releaseTimeTestCallback(avConfig, avRecorder, recorderTime
let end;
let start = Date.now();
console.info(`releaseTimeTestCallback start time is : ${start}`)
await avRecorder.release((err) => {
avRecorder.release((err) => {
if (err == null) {
console.info(`releaseTimeTestCallback current state is : ${avRecorder.state}`)
console.info('release releaseTimeTestCallback success');
......
......@@ -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"
},
......
......@@ -99,10 +99,836 @@ export default function avRecorderTest() {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0200
* @tc.name : 002.pause->resume
* @tc.desc : Recorder audio pause->resume
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0200', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0200 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack2(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0200 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300
* @tc.name : 003.test recording 3 seconds to stop
* @tc.desc : Local Video recording 3 seconds to stop
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack3(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400
* @tc.name : 004.pause->resume->pause
* @tc.desc : Local Video pause->resume->pause
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack4(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0500
* @tc.name : 005.pause->stop->reset
* @tc.desc : Local Video pause->stop->reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack5(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0600
* @tc.name : 006.pause->resume->stop->reset
* @tc.desc : Local Video pause->resume->stop->reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0600', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0600 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack6(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0600 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0700
* @tc.name : 007.stop->reset->pause->resume->stop->reset
* @tc.desc : Local Video stop->reset->pause->resume->stop->reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0700', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0700 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack7(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0700 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0800
* @tc.name : 008.stop->reset->pause->stop->reset
* @tc.desc : Local Video stop->reset->pause->stop->reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0800', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0800 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack8(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0800 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0900
* @tc.name : 009.start->pause->start(error)
* @tc.desc : Local Video start->pause->start(error)
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0900', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0900 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack9(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0900 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1000
* @tc.name : 010.start->stop->pause(error)
* @tc.desc : Local Video start->stop->pause(error)
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1000', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1000 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack10(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1000 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1100
* @tc.name : 011. API8 audioEncoderMime
* @tc.desc : Local Video audioEncoderMime
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithCallBack11(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0100
* @tc.name : 音频录制,location对应的latitude和longitude为-30和60
* @tc.desc : Local Video recorder with designated latitude and longitude
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
let newAvConfig = {
audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
profile: avProfile,
url: 'fd://',
rotation: 0,
location: { latitude: -30, longitude: 60 }
}
newAvConfig.url = fdPath;
console.info('avConfig.url ' + newAvConfig.url);
avRecorderTestBase.avRecorderWithCallBack13(newAvConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0200
* @tc.name : 音频录制,location对应的latitude和longitude为90和180
* @tc.desc : Local Video recorder with designated latitude and longitude
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0200', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0200 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
let newAvConfig = {
audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
profile: avProfile,
url: 'fd://',
rotation: 0,
location: { latitude: 90, longitude: 180 }
}
newAvConfig.url = fdPath;
console.info('avConfig.url ' + newAvConfig.url);
avRecorderTestBase.avRecorderWithCallBack13(newAvConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0200 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0300
* @tc.name : 音频录制,location对应的latitude和longitude为60和-90
* @tc.desc : Local Video recorder with designated latitude and longitude
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
let newAvConfig = {
audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
profile: avProfile,
url: 'fd://',
rotation: 0,
location: { latitude: 60, longitude: -90 }
}
newAvConfig.url = fdPath;
console.info('avConfig.url ' + newAvConfig.url);
avRecorderTestBase.avRecorderWithCallBack13(newAvConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0400
* @tc.name : 音频录制,location对应的latitude和longitude为0和0
* @tc.desc : Local Video recorder with designated latitude and longitude
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
let newAvConfig = {
audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
profile: avProfile,
url: 'fd://',
rotation: 0,
location: { latitude: 0, longitude: 0 }
}
newAvConfig.url = fdPath;
console.info('avConfig.url ' + newAvConfig.url);
avRecorderTestBase.avRecorderWithCallBack13(newAvConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0500
* @tc.name : 音频录制,location对应的latitude和longitude为0和180
* @tc.desc : Local Video recorder with designated latitude and longitude
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
let newAvConfig = {
audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
profile: avProfile,
url: 'fd://',
rotation: 0,
location: { latitude: 0, longitude: 180 }
}
newAvConfig.url = fdPath;
console.info('avConfig.url ' + newAvConfig.url);
avRecorderTestBase.avRecorderWithCallBack13(newAvConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0600
* @tc.name : 音频录制,location对应的latitude和longitude为-90和-180
* @tc.desc : Local Video recorder with designated latitude and longitude
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0600', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0600 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
let newAvConfig = {
audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
profile: avProfile,
url: 'fd://',
rotation: 0,
location: { latitude: -90, longitude: -180 }
}
newAvConfig.url = fdPath;
console.info('avConfig.url ' + newAvConfig.url);
avRecorderTestBase.avRecorderWithCallBack13(newAvConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0600 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0100
* @tc.name : 01.AVRecorder.prepare(promise)
* @tc.desc : Local Video AVRecorder.prepare(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithPreparePromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0200
* @tc.name : 02.AVRecorder.start(promise)
* @tc.desc : Local Video AVRecorder.start(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0200', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0200 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithStartPromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0200 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0300
* @tc.name : 03.AVRecorder.pause(promise)
* @tc.desc : Local Video AVRecorder.pause(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithPausePromise(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0400
* @tc.name : 04.AVRecorder.resume(promise)
* @tc.desc : Local Video AVRecorder.resume(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithResumePromise(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0500
* @tc.name : 05.AVRecorder.stop(promise)
* @tc.desc : Local Video AVRecorder.stop(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithStopPromise(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0600
* @tc.name : 06.AVRecorder.reset(promise)
* @tc.desc : Local Video AVRecorder.reset(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0600', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0600 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithResetPromise(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0600 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0700
* @tc.name : 07.AVRecorder.release(promise)
* @tc.desc : Local Video AVRecorder.release(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0700', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0700 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithReleasePromise(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0700 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0100
* @tc.name : 01.AVRecorder.prepare(callback)
* @tc.desc : Local Video AVRecorder.prepare(callback) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithPrepareCallback(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0200
* @tc.name : 02.AVRecorder.start(callbcak)
* @tc.desc : Local Video AVRecorder.start(callbcak) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0200', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0200 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithStartCallback(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0200 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0300
* @tc.name : 03.AVRecorder.pause(callbcak)
* @tc.desc : Local Video AVRecorder.pause(callbcak) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithPauseCallback(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0400
* @tc.name : 04.AVRecorder.resume(callbcak)
* @tc.desc : Local Video AVRecorder.resume(callbcak) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithResumeCallback(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0500
* @tc.name : 05.AVRecorder.stop(promise)
* @tc.desc : Local Video AVRecorder.stop(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithStopCallback(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0600
* @tc.name : 06.AVRecorder.reset(promise)
* @tc.desc : Local Video AVRecorder.reset(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0600', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0600 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithResetCallback(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0600 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0700
* @tc.name : 07.AVRecorder.release(promise)
* @tc.desc : Local Video AVRecorder.release(promise) 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0700', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0700 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderWithReleaseCallback(avConfig, avRecorder, RECORDER_TIME, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0700 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0100
* @tc.name : 01.prepare->start>reset
* @tc.desc : Local Video prepare->start>reset 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopPrepare2ResetWithPromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0200
* @tc.name : 02.create->prepare->start->reset->release
* @tc.desc : Local Video create->prepare->start->reset->release 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0200', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0200 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopCreate2ReleaseWithPromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0200 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0300
* @tc.name : 03.prepare->start->stop
* @tc.desc : Local Video prepare->start->stop 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopPrepare2StopWithPromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0400
* @tc.name : 04.pause->resume
* @tc.desc : Local Video pause->resume 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopPause2ResumeWithPromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0500
* @tc.name : 05.create->release
* @tc.desc : Local Video create->release 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopCreate2Release2WithPromise(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_02_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0100
* @tc.name : 01.prepare->start>reset
* @tc.desc : Local Video prepare->start>reset 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopPrepare2ResetWithCallback(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0300
* @tc.name : 03.prepare->start->stop
* @tc.desc : Local Video prepare->start->stop 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0400
* @tc.name : 04.pause->resume
* @tc.desc : Local Video pause->resume 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopPause2ResumeWithCallback(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0500
* @tc.name : 05.create->release
* @tc.desc : Local Video create->release 1000 times
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
console.info('case fdPath is: ' + fdPath);
avConfig.url = fdPath;
console.info('avConfig.url ' + avConfig.url);
avRecorderTestBase.avRecorderLoopCreate2Release2WithCallback(avConfig, avRecorder, LOOP_TIMES, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_02_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100
* @tc.name : 001.test pause->prepare
* @tc.desc : Recorder pause->prepare
* @tc.desc : Recorder pause->prepare 1000 times
* @tc.size : MediumTest
* @tc.type : Reliabilit test
* @tc.level : Level2
......@@ -961,6 +1787,167 @@ export default function avRecorderTest() {
avRecorderTestBase.releaseTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0900 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0100
* @tc.name : 01.createAVRecorder
* @tc.desc : AvRecorder.createAVRecorder
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0100', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0100 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.createTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0100 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0200
* @tc.name : 02.AvRecorder.prepare
* @tc.desc : AvRecorder.prepare
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0200', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0200 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.prepareTimePromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0200 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0300
* @tc.name : 03.AvRecorder.getInputSurface
* @tc.desc : AvRecorder.getInputSurface
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0300', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0300 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.getInputSurfaceTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0300 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0400
* @tc.name : 04.AvRecorder.start
* @tc.desc : AvRecorder.start
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0400 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.startTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0400 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0500
* @tc.name : 05.AvRecorder.pause
* @tc.desc : AvRecorder.pause
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0500', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0500 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.pauseTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0500 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0600
* @tc.name : 06.AvRecorder.resume
* @tc.desc : AvRecorder.resume
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0600', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0600 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.resumeTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0600 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0700
* @tc.name : 07.AvRecorder.stop
* @tc.desc : AvRecorder.stop
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0700', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0700 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.stopTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0700 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0800
* @tc.name : 08.AvRecorder.reset
* @tc.desc : AvRecorder.reset
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0800', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0800 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.resetTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0800 end')
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0900
* @tc.name : 09.AvRecorder.release
* @tc.desc : AvRecorder.release
* @tc.size : MediumTest
* @tc.type : Performance test
* @tc.level : Level 4
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0900', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0900 start')
let fileName = avRecorderTestBase.resourceName()
fdObject = await mediaTestBase.getAvRecorderFd(fileName, "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.releaseTimeTestPromise(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_PROMISE_01_0900 end')
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册