diff --git a/multimedia/media/media_js_standard/AVRecorderTestBase.js b/multimedia/media/media_js_standard/AVRecorderTestBase.js index 03832e309743d5139ec7c827baccb3a4540ed093..40d12acf3da5076de3496ebc4197a61a8a4899df 100644 --- a/multimedia/media/media_js_standard/AVRecorderTestBase.js +++ b/multimedia/media/media_js_standard/AVRecorderTestBase.js @@ -16,6 +16,21 @@ import media from '@ohos.multimedia.media' import * as mediaTestBase from './MediaTestBase.js'; +async function idleCallBack(avRecorder) { + console.info('case createAVRecorder called'); + await media.createAVRecorder().then((recorder) => { + if (recorder != null) { + avRecorder = recorder; + console.info('createAVRecorder success'); + } else { + console.info('createAVRecorder fail'); + } + }).catch((error) => { + console.info(`createAVRecorder catchCallback, error:${error}`); + }); + return avRecorder; +} + export async function idle(avRecorder) { console.info('case createAVRecorder called'); await media.createAVRecorder().then((recorder) => { @@ -48,6 +63,7 @@ export function prepareCallback(avRecorder, avConfig) { avRecorder.prepare(avConfig, (err) => { console.info('case prepare called' + err); if (err == null) { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); console.info('prepare success'); } else { console.error(`case prepare error, errMessage is ${err.message}`); @@ -60,6 +76,7 @@ export function preparePromise(avRecorder, avConfig) { return; } avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); console.info('prepare success'); }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); } @@ -95,27 +112,35 @@ export function getInputSurfaceCallback(avRecorder) { // videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID); } -export function startCallback(avRecorder) { +export function startCallback(avRecorder, recorderTime) { if (typeof(avRecorder) == 'undefined') { return; } 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); } else { console.info('start AVRecorder failed and error is ' + err.message); } }) } -export function startPromise(avRecorder) { +export function startPromise(avRecorder, recorderTime) { if (typeof(avRecorder) == 'undefined') { return; } avRecorder.start().then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STARTED); console.info('start success'); - }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + if (recorderTime != undefined) { + sleep(recorderTime); + } + }).catch((err) => { + console.info('start failed and catch error is ' + err.message); + }); } export function pauseCallback(avRecorder) { @@ -125,6 +150,7 @@ export function pauseCallback(avRecorder) { avRecorder.pause((err) => { console.info('case pause called'); if (err == null) { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PAUSED); console.info('pause AVRecorder success'); } else { console.info('pause AVRecorder failed and error is ' + err.message); @@ -137,8 +163,11 @@ export function pausePromise(avRecorder) { return; } avRecorder.pause().then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PAUSED); console.info('pause success'); - }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + }).catch((err) => { + console.info('pause failed and catch error is ' + err.message); + }); } export function resumeCallback(avRecorder) { @@ -171,6 +200,7 @@ export function stopCallback(avRecorder) { avRecorder.stop((err) => { console.info('case stop called'); if (err == null) { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STOPPED); console.info('stop AVRecorder success'); } else { console.info('stop AVRecorder failed and error is ' + err.message); @@ -183,8 +213,11 @@ export function stopPromise(avRecorder) { return; } avRecorder.stop().then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.STOPPED); console.info('stop success'); - }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + }).catch((err) => { + console.info('stop failed and catch error is ' + err.message); + }); } export function resetCallback(avRecorder) { @@ -194,6 +227,7 @@ export function resetCallback(avRecorder) { avRecorder.reset((err) => { console.info('case reset called'); if (err == null) { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); console.info('reset AVRecorder success'); } else { console.info('reset AVRecorder failed and error is ' + err.message); @@ -206,8 +240,10 @@ export function resetPromise(avRecorder) { return; } avRecorder.reset().then(() => { - console.info('reset success'); - }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); } export function releaseCallback(avRecorder) { @@ -217,6 +253,7 @@ export function releaseCallback(avRecorder) { avRecorder.release((err) => { console.info('case release called'); if (err == null) { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); console.info('release AVRecorder success'); } else { console.info('release AVRecorder failed and error is ' + err.message); @@ -229,8 +266,10 @@ export function releasePromise(avRecorder) { return; } avRecorder.release().then(() => { - console.info('release success'); - }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }).catch((err) => { + console.info('release AVRecorder failed and catch error is ' + err.message); + }); } export function sleep(ms) { @@ -285,7 +324,7 @@ export async function setOnCallback(avConfig, avRecorder, recorderTime, done) { case AV_RECORDER_STATE.STOPPED: console.info(`case avRecorderWithCallBack is stopped`) expect(avRecorder.state).assertEqual('stopped'); - avRecorder.release() + releasePromise(avRecorder) break; case AV_RECORDER_STATE.RELEASED: console.info(`case avRecorderWithCallBack is released`); @@ -317,7 +356,7 @@ export async function setPrepareOnCallback(avConfig, avRecorder, recorderTime, d releaseCallback(avRecorder); break; case AV_RECORDER_STATE.RELEASED: - console.info(`case avRecorderReliabilitTest03 is released`); + console.info(`case setPrepareOnCallback is released`); expect(avRecorder.state).assertEqual('released'); done(); break; @@ -337,23 +376,135 @@ export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime, await avRecorder.prepare(avConfig) } -export async function avRecorderReliabilitTest01(avConfig, avRecorder, recorderTime, done) { - let result = true; +export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime, done) { avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); console.info('case avConfig.url is ' + avConfig.url); - await avRecorder.pause().then(() => { - console.info('pause AVRecorder success'); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await stopPromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); }).catch((err) => { - console.info('pause AVRecorder failed and catch error is ' + err.message); - result = false + console.info('reset AVRecorder failed and catch error is ' + err.message); }); - expect(result).assertEqual(false); - await avRecorder.prepare(avConfig).then(() => { - expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); - console.info('prepare success'); +} + +export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await resumePromise(avRecorder); + await stopPromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await stopPromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack5(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await resumePromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack6(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await startPromise(avRecorder, recorderTime); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack7(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await resumePromise(avRecorder); + await pausePromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack8(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await stopPromise(avRecorder); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); }).catch((err) => { - console.info('prepare failed and catch error is ' + err.message); + console.info('reset AVRecorder failed and catch error is ' + err.message); }); +} + +export async function avRecorderWithCallBack9(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await stopPromise(avRecorder); await avRecorder.release().then(() => { console.info('release AVRecorder success'); expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); @@ -363,28 +514,2316 @@ export async function avRecorderReliabilitTest01(avConfig, avRecorder, recorderT }); } -export async function avRecorderReliabilitTest02(avConfig, avRecorder, recorderTime, done) { +export async function avRecorderWithCallBack10(avConfig, avRecorder, recorderTime, done) { avRecorder = await idle(avRecorder); - await avRecorder.prepare(avConfig).then(() => { - expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); - console.info('avRecorderReliabilitTest02 prepare success'); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await stopPromise(avRecorder); + await pausePromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack11(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); + }).catch((err) => { + console.info('reset AVRecorder failed and catch error is ' + err.message); + }); +} + +export async function avRecorderWithCallBack12(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await stopPromise(avRecorder); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await resumePromise(avRecorder); + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.IDLE); + done(); }).catch((err) => { - console.info('avRecorderReliabilitTest02 prepare failed and catch error is ' + err.message); + console.info('reset AVRecorder failed and catch error is ' + err.message); }); +} + +//02.Record AAC format mp4 -- SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_MP4_0100 +//02.Record AAC format m4a -- SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FORMAT_M4A_0100 +// avConfig.location change +export async function avRecorderWithCallBack13(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + await resumePromise(avRecorder); + await sleep(recorderTime); + await stopPromise(avRecorder); + //restart 是 resume or reset or prepare ? await avRecorder.release().then(() => { - console.info('avRecorderReliabilitTest02 release AVRecorder success'); expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + console.info('release success'); done(); }).catch((err) => { - console.info('avRecorderReliabilitTest02 release AVRecorder failed and catch error is ' + err.message); + console.info('release failed and catch error is ' + err.message); }); } -export async function avRecorderReliabilitTest03(avConfig, avRecorder, recorderTime, done) { +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'); + 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'); + } + }); +} + +export async function avRecorderWithPreparePromise(avConfig, avRecorder, loopTimes, done) { avRecorder = await idle(avRecorder); - setPrepareOnCallback(avConfig, avRecorder, recorderTime, done) - await avRecorder.prepare(avConfig) + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + 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'); + 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'); + } + }); +} + +export async function avRecorderWithStartPromise(avConfig, avRecorder, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + 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'); + 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'); + } + }); +} + +export async function avRecorderWithPausePromise(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + 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'); + 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'); + } + }); +} + +export async function avRecorderWithResumePromise(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + setResumeOnPromise(avRecorder, loopTimes, done); + 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'); + 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'); + } + }); +} + +export async function avRecorderWithStopPromise(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + 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'); + 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'); + } + }); +} + +export async function avRecorderWithResetPromise(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + 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'); + 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'); + } + }); +} + +export async function avRecorderWithReleasePromise(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + setReleaseOnPromise(avRecorder, loopTimes, done); +} + +export async function avRecorderWithPrepareCallback(avConfig, avRecorder, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + while (loopTimes > 0) { + prepareCallback(avRecorder, avConfig); + loopTimes--; + } + done(); +} + +export async function avRecorderWithStartCallback(avConfig, avRecorder, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + 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); + } + }) + loopTimes--; + } + done(); +} + +export async function avRecorderWithPauseCallback(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + while (loopTimes > 0) { + pauseCallback(avRecorder, avConfig); + loopTimes--; + } + done(); +} + +export async function avRecorderWithResumeCallback(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await pausePromise(avRecorder); + while (loopTimes > 0) { + resumeCallback(avRecorder, avConfig); + loopTimes--; + } + done(); +} + +export async function avRecorderWithStopCallback(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + while (loopTimes > 0) { + stopCallback(avRecorder, avConfig); + loopTimes--; + } + done(); +} + +export async function avRecorderWithResetCallback(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + while (loopTimes > 0) { + resetCallback(avRecorder, avConfig); + loopTimes--; + } + done(); +} + +export async function avRecorderWithReleaseCallback(avConfig, avRecorder, recorderTime, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + while (loopTimes > 0) { + releaseCallback(avRecorder, avConfig); + loopTimes--; + } + done(); +} + +export async function avRecorderWithLongRun(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder, recorderTime); + await stopPromise(avRecorder); + done(); +} + +export async function avRecorderLoopPrepare2Reset(avConfig, avRecorder, loopTimes, done) { + avRecorder = await idle(avRecorder); + // setOnCallback(avConfig, avRecorder, recorderTime, done); + console.info('case avConfig.url is ' + avConfig.url); + while (loopTimes > 0) { + prepareCallback(avRecorder, avConfig); + startCallback(avRecorder); + resetCallback(avRecorder); + loopTimes--; + } + done(); +} + +export async function avRecorderLoopCreate2Release(avConfig, avRecorder, loopTimes, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + while (loopTimes > 0) { + avRecorder = await idle(avRecorder); + console.info('case avConfig.url is ' + avConfig.url); + prepareCallback(avRecorder, avConfig); + startCallback(avRecorder); + resetCallback(avRecorder); + releaseCallback(avRecorder); + loopTimes--; + } + done(); +} + +export async function avRecorderLoopPrepare2Stop(avConfig, avRecorder, loopTimes, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + avRecorder = await idle(avRecorder); + console.info('case avConfig.url is ' + avConfig.url); + while (loopTimes > 0) { + prepareCallback(avRecorder, avConfig); + startCallback(avRecorder); + stopCallback(avRecorder); + loopTimes--; + } + done(); +} + +export async function avRecorderLoopPause2Resume(avConfig, avRecorder, loopTimes, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + avRecorder = await idle(avRecorder); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder); + while (loopTimes > 0) { + pauseCallback(avRecorder); + resumeCallback(avRecorder); + loopTimes--; + } + done(); +} + +export async function avRecorderLoopCreate2Release2(avConfig, avRecorder, loopTimes, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + while (loopTimes > 0) { + avRecorder = await idle(avRecorder); + console.info('case avConfig.url is ' + avConfig.url); + releaseCallback(avRecorder); + loopTimes--; + } + 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) { + offCallback(avRecorder, ['stateChange', 'error']); + done(); + } 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.ERROR: + console.info(`case AV_RECORDER_STATE.ERROR`) + expect(avRecorder.state).assertEqual('error'); + break; + default: + console.info('case state is unknown'); + } + }); +} + +export async function avRecorderLoopPrepare2ResetWithCallback(avConfig, avRecorder, done) { + avRecorder = await idle(avRecorder); + setPrepare2ResetOnCallback(avConfig, avRecorder, done); +} + +export async function setCreate2ReleaseOnCallback(avRecorder, avConfig, done) { + console.info(`case setOnCallback in`); + avRecorder = await idle(avRecorder); + let isReset = false; + 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'); + if (isReset) { + await releasePromise(avRecorder); + } else { + await preparePromise(avRecorder, avConfig); + } + 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 avRecorder.reset().then(() => { + console.info(`case avRecorderLoopCreate2ReleaseWithCallback is reset`); + isReset = true; + }).catch((err) => { + console.info('reset failed and catch error is ' + err.message); + }); + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case AV_RECORDER_STATE.RELEASED`); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.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'); + } + }); +} + +export async function avRecorderLoopCreate2ReleaseWithCallback(avConfig, avRecorder, loopTimes, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + while (loopTimes > 0) { + setCreate2ReleaseOnCallback(avRecorder, avConfig, done) + loopTimes--; + } +} + +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.ERROR: + console.info(`case AV_RECORDER_STATE.ERROR`) + expect(avRecorder.state).assertEqual('error'); + break; + default: + console.info('case state is unknown'); + } + }); +} + +export async function avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, 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.STARTED); + 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.ERROR: + console.info(`case AV_RECORDER_STATE.ERROR`) + expect(avRecorder.state).assertEqual('error'); + break; + default: + console.info('case state is unknown'); + } + }); +} + +export async function avRecorderLoopPause2ResumeWithCallback(avConfig, avRecorder, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + avRecorder = await idle(avRecorder); + console.info('case avConfig.url is ' + avConfig.url); + await preparePromise(avRecorder, avConfig); + await startPromise(avRecorder); + setPause2ResumeOnCallback(avRecorder, done); +} + +export async function setCreate2Release2OnCallback(avRecorder, done) { + console.info(`case setOnCallback in`); + avRecorder = await idle(avRecorder); + 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'); + releasePromise(avRecorder); + case AV_RECORDER_STATE.RELEASED: + console.info(`case AV_RECORDER_STATE.RELEASED`); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.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'); + } + }); +} + +export async function avRecorderLoopCreate2Release2WithCallback(avRecorder, loopTimes, done) { + // setOnCallback(avConfig, avRecorder, recorderTime, done); + while (loopTimes > 0) { + setCreate2Release2OnCallback(avRecorder, done); + loopTimes--; + } +} + +export async function avRecorderReliabilitTest01(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await avRecorder.pause((err) => { + if (err == null) { + console.info('pause avRecorderReliabilitTest01 success'); + } else { + result = false + console.info('pause avRecorderReliabilitTest01 failed and error is ' + err.message); + } + }); + expect(result).assertEqual(false); + await preparePromise(avRecorder, avConfig) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest02(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest03(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + setPrepareOnCallback(avConfig, avRecorder, recorderTime, done) + await avRecorder.prepare(avConfig) +} + +export async function avRecorderReliabilitTest04(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await avRecorder.resume().then(() => { + console.info('resume avRecorderReliabilitTest04 success'); + }).catch((err) => { + console.info('resume avRecorderReliabilitTest04 failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await preparePromise(avRecorder, avConfig) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest05(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + await prepareCallback(avRecorder, avConfig) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest06(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await startPromise(avRecorder) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest07(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await resumePromise(avRecorder) + await startPromise(avRecorder) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest08(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest08 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest08 failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest09(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest09 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest09 failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest10(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest11(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await resumePromise(avRecorder) + await pausePromise(avRecorder) + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest12(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await stopPromise(avRecorder) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest13(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await stopPromise(avRecorder) + await resetPromise(avRecorder) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest14(avConfig, avRecorder, recorderTime, done) { + let result1 = true; + let result2 = true; + let result3 = true; + let result4 = true; + let result5 = true; + + avRecorder = await idle(avRecorder); + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result1 = false + }); + expect(result1).assertEqual(false); + + await preparePromise(avRecorder, avConfig) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result2 = false + }); + expect(result2).assertEqual(false); + + await startPromise(avRecorder) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result3 = false + }); + expect(result3).assertEqual(true); + + await stopPromise(avRecorder) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result4 = false + }); + expect(result4).assertEqual(false); + + await resetPromise(avRecorder) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result5 = false + }); + expect(result5).assertEqual(false); + + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest15(avConfig, avRecorder, recorderTime, done) { + let result1 = true; + let result2 = true; + let result3 = true; + + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result1 = false + }); + expect(result1).assertEqual(true); + + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result2 = false + }); + expect(result2).assertEqual(false); + + await avRecorder.pause().then(() => { + console.info('pause avRecorderReliabilitTest12 success'); + }).catch((err) => { + console.info('pause avRecorderReliabilitTest12 failed and catch error is ' + err.message); + result3 = false + }); + expect(result3).assertEqual(false); + + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest16(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest17(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest18(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest19(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(true); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest20(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await stopPromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest21(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await resetPromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest22(avConfig, avRecorder, recorderTime, done) { + let result1 = true; + let result2 = true; + let result3 = true; + let result4 = true; + let result5 = true; + + avRecorder = await idle(avRecorder); + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result1 = false + }); + expect(result1).assertEqual(false); + + await preparePromise(avRecorder, avConfig) + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result2 = false + }); + expect(result2).assertEqual(false); + + await startPromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result3 = false + }); + expect(result3).assertEqual(false); + + await pausePromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result4 = false + }); + expect(result4).assertEqual(true); + + await resetPromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result5 = false + }); + expect(result5).assertEqual(false); + + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest23(avConfig, avRecorder, recorderTime, done) { + let result1 = true; + let result2 = true; + let result3 = true; + + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result1 = false + }); + expect(result1).assertEqual(true); + + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result2 = false + }); + expect(result2).assertEqual(false); + + await avRecorder.resume().then(() => { + console.info('resume avRecorder success'); + }).catch((err) => { + console.info('resume avRecorder failed and catch error is ' + err.message); + result3 = false + }); + expect(result3).assertEqual(false); + + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest24(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await avRecorder.stop().then(() => { + console.info('stop avRecorder success'); + }).catch((err) => { + console.info('stop avRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(true); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest25(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await resumePromise(avRecorder) + await avRecorder.stop().then(() => { + console.info('stop avRecorder success'); + }).catch((err) => { + console.info('stop avRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest26(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await avRecorder.reset().then(() => { + console.info('reset avRecorder success'); + }).catch((err) => { + console.info('reset avRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(true); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest27(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await resumePromise(avRecorder) + await avRecorder.reset().then(() => { + console.info('reset avRecorder success'); + }).catch((err) => { + console.info('reset avRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(true); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest28(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await avRecorder.release().then(() => { + console.info('release avRecorder success'); + }).catch((err) => { + console.info('release avRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(true); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest29(avConfig, avRecorder, recorderTime, done) { + let result = true; + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await resumePromise(avRecorder) + await avRecorder.release().then(() => { + console.info('release avRecorder success'); + }).catch((err) => { + console.info('release avRecorder failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(true); + await releaseDone(avRecorder, done) +} + +export async function avRecorderReliabilitTest30(avConfig, avRecorder, recorderTime, done) { + let result1 = true; + let result2 = true; + let result3 = true; + + avRecorder = await idle(avRecorder); + await preparePromise(avRecorder, avConfig) + await startPromise(avRecorder) + await pausePromise(avRecorder) + await avRecorder.release().then(() => { + console.info('release avRecorder success'); + }).catch((err) => { + console.info('release avRecorder failed and catch error is ' + err.message); + result1 = false + }); + expect(result1).assertEqual(true); + + await avRecorder.release().then(() => { + console.info('release avRecorder success'); + }).catch((err) => { + console.info('release avRecorder failed and catch error is ' + err.message); + result2 = false + }); + expect(result2).assertEqual(false); + + await avRecorder.release().then(() => { + console.info('release avRecorder success'); + }).catch((err) => { + console.info('release avRecorder failed and catch error is ' + err.message); + result3 = false + }); + expect(result3).assertEqual(false); + done(); +} + +export async function avRecorderReliabilitTest31(avConfig, avRecorder, recorderTime, done) { + let surfaceID = null; + let result = true; + avRecorder = await idle(avRecorder); + avRecorder.getInputSurface().then((surfaceId) => { + console.info('getInputSurface success'); + surfaceID = surfaceId; + }).catch((err) => { + console.info('getInputSurface failed and catch error is ' + err.message); + result = false + }); + expect(result).assertEqual(false); + await releaseDone(avRecorder, done) +} + + +export async function getInputSurfaceTest32(avConfig, avRecorder, recorderTime, done) { + console.info(`case getInputSurfaceTest in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + getInputSurfacePromise(avRecorder) + releasePromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest32(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest32(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function getInputSurfaceTest33(avConfig, avRecorder, recorderTime, done) { + console.info(`case getInputSurfaceTest33 in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + getInputSurfacePromise(avRecorder) + startPromise(avRecorder) + break; + case AV_RECORDER_STATE.STARTED: + console.info(`case avRecorderWithCallBack is started`) + expect(avRecorder.state).assertEqual('started'); + await sleep(recorderTime); + getInputSurfacePromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest33(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest33(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function getInputSurfaceTest34(avConfig, avRecorder, recorderTime, done) { + console.info(`case getInputSurfaceTest34 in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + getInputSurfacePromise(avRecorder) + startPromise(avRecorder) + break; + case AV_RECORDER_STATE.STARTED: + console.info(`case avRecorderWithCallBack is started`) + expect(avRecorder.state).assertEqual('started'); + await sleep(recorderTime); + pausePromise(avRecorder) + break; + case AV_RECORDER_STATE.PAUSED: + console.info(`case avRecorderWithCallBackis paused`) + expect(avRecorder.state).assertEqual('paused'); + getInputSurfacePromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest34(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest34(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function getInputSurfaceTest35(avConfig, avRecorder, recorderTime, done) { + console.info(`case getInputSurfaceTest35 in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + getInputSurfacePromise(avRecorder) + startPromise(avRecorder) + break; + case AV_RECORDER_STATE.STARTED: + console.info(`case avRecorderWithCallBack is started`) + expect(avRecorder.state).assertEqual('started'); + await sleep(recorderTime); + pausePromise(avRecorder) + break; + case AV_RECORDER_STATE.PAUSED: + console.info(`case avRecorderWithCallBackis paused`) + expect(avRecorder.state).assertEqual('paused'); + resumePromise(avRecorder) + getInputSurfacePromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest35(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest35(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function getInputSurfaceTest36(avConfig, avRecorder, recorderTime, done) { + console.info(`case getInputSurfaceTest36 in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + getInputSurfacePromise(avRecorder) + startPromise(avRecorder) + break; + case AV_RECORDER_STATE.STARTED: + console.info(`case avRecorderWithCallBack is started`) + expect(avRecorder.state).assertEqual('started'); + await sleep(recorderTime); + stopPromise(avRecorder) + break; + case AV_RECORDER_STATE.STOPPED: + console.info(`case avRecorderWithCallBack is stopped`) + expect(avRecorder.state).assertEqual('stopped'); + getInputSurfacePromise(avRecorder) + releasePromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest36(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest36(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function getInputSurfaceTest37(avConfig, avRecorder, recorderTime, done) { + console.info(`case getInputSurfaceTest37 in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.IDLE: + console.info(`case avRecorderWithCallBack is idle`); + expect(avRecorder.state).assertEqual("idle"); + getInputSurfacePromise(avRecorder) + break; + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + getInputSurfacePromise(avRecorder) + startPromise(avRecorder) + break; + case AV_RECORDER_STATE.STARTED: + console.info(`case avRecorderWithCallBack is started`) + expect(avRecorder.state).assertEqual('started'); + await sleep(recorderTime); + resetPromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest37(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest37(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime, done) { + let result1 = true; + let result2 = true; + let result3 = true; + let surfaceID = null; + console.info(`case getInputSurfaceTest38 in`); + avRecorder.on('stateChange', async (state, reason) => { + console.info('case state has changed, new state is :' + state); + switch (state) { + case AV_RECORDER_STATE.PREPARED: + console.info(`case AV_RECORDER_STATE.PREPARED`); + expect(avRecorder.state).assertEqual('prepared'); + + avRecorder.getInputSurface().then((surfaceId) => { + console.info('getInputSurface success'); + surfaceID = surfaceId; + }).catch((err) => { + console.info('getInputSurface failed and catch error is ' + err.message); + result1 = false + }); + expect(result1).assertEqual(true); + + avRecorder.getInputSurface().then((surfaceId) => { + console.info('getInputSurface success'); + surfaceID = surfaceId; + }).catch((err) => { + console.info('getInputSurface failed and catch error is ' + err.message); + result2 = false + }); + expect(result2).assertEqual(false); + + avRecorder.getInputSurface().then((surfaceId) => { + console.info('getInputSurface success'); + surfaceID = surfaceId; + }).catch((err) => { + console.info('getInputSurface failed and catch error is ' + err.message); + result3 = false + }); + expect(result3).assertEqual(false); + releasePromise(avRecorder) + break; + case AV_RECORDER_STATE.RELEASED: + console.info(`case avRecorderReliabilitTest03 is 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'); + } + }); + avRecorder.on('error', (err) => { + console.info('case avRecorder.on(error) called, errMessage is ' + err.message); + done(); + }); +} + +export async function avRecorderReliabilitTest38(avConfig, avRecorder, recorderTime, done) { + avRecorder = await idle(avRecorder); + getInputSurfaceTest38(avConfig, avRecorder, recorderTime, done) + await preparePromise(avRecorder, avConfig) +} + +export async function createTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + let start = Date.now(); + console.info(`createTimeTestCallback start time is : ${start}`) + avRecorder = await idleCallBack(avRecorder); + let end = Date.now() + let execution = parseInt(end - start) + console.info("createTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('createTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("createTimeTest avg time is :" + avg) + done(); +} + +export async function prepareTimeCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + let start = Date.now(); + console.info(`prepareTimeWithoutCallback start time is : ${start}`) + let end; + await avRecorder.prepare(AVRecorderConfig, (err) => { + if (err == null) { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('prepareTimeWithoutCallback avPlayer state is prepared') + end = Date.now() + console.info(`prepareTimeWithoutCallback end time is : ${end}`) + } else { + console.info('prepare failed and error is ' + err.message); + } + }) + let execution = parseInt(end - start) + console.info("prepareTimeWithoutCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('prepareTimeWithoutCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("prepareTimeWithoutCallback avg time is :" + avg) + done(); +} + +export async function getInputSurfaceTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + let surfaceID = null; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + let end; + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('getInputSurfaceTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + + let start = Date.now(); + console.info(`getInputSurfaceTimeTestCallback start time is : ${start}`) + await avRecorder.getInputSurface((err, surfaceId) => { + if (err == null) { + console.info('getInputSurfaceTimeTestCallback success'); + surfaceID = surfaceId; + end = Date.now() + console.info(`getInputSurfaceTimeTestCallback end time is : ${end}`) + } else { + console.info('getInputSurfaceTimeTestCallback failed and error is ' + err.message); + } + }); + let execution = parseInt(end - start) + console.info("getInputSurfaceTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('getInputSurfaceTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("getInputSurfaceTimeTestCallback avg time is :" + avg) + done(); +} + +export async function startTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + let end; + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('startTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + let start = Date.now(); + console.info(`startTimeTestCallback start time is : ${start}`) + await avRecorder.start((err) => { + if (err == null) { + end = Date.now() + console.info(`startTimeTestCallback end time is : ${end}`) + console.info('startTimeTestCallback avRecorder success'); + } else { + console.info('startTimeTestCallback failed and error is ' + err.message); + } + }); + let execution = parseInt(end - start) + console.info("startTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('startTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("startTimeTestCallback avg time is :" + avg) + done(); +} + +export async function pauseTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('pauseTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + + await avRecorder.start().then(() => { + console.info('start avRecorder success'); + }).catch((err) => { + console.info('pauseTimeTestCallback start avRecorder failed and catch error is ' + err.message); + }); + let start = Date.now(); + console.info(`pauseTimeTestCallback start time is : ${start}`) + let end; + await avRecorder.pause((err) => { + if (err == null) { + end = Date.now() + console.info(`pauseTimeTestCallback end time is : ${end}`) + console.info('pause pauseTimeTestCallback success'); + } else { + console.info('pause pauseTimeTestCallback failed and error is ' + err.message); + } + }); + + let execution = parseInt(end - start) + console.info("pauseTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('pauseTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("pauseTimeTestCallback avg time is :" + avg) + done(); +} + +export async function resumeTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('resumeTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + + await avRecorder.start().then(() => { + console.info('start resumeTimeTestCallback success'); + }).catch((err) => { + console.info('resumeTimeTestCallback start avRecorder failed and catch error is ' + err.message); + }); + let end; + await avRecorder.pause((err) => { + if (err == null) { + console.info('pause resumeTimeTestCallback success'); + } else { + console.info('pause resumeTimeTestCallback failed and error is ' + err.message); + } + }); + let start = Date.now(); + console.info(`resumeTimeTestCallback start time is : ${start}`) + await avRecorder.resume((err) => { + if (err == null) { + console.info('resume resumeTimeTestCallback success'); + end = Date.now() + console.info(`resumeTimeTestCallback end time is : ${end}`) + } else { + console.info('resume resumeTimeTestCallback failed and error is ' + err.message); + } + }); + let execution = parseInt(end - start) + console.info("resumeTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('resumeTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("resumeTimeTestCallback avg time is :" + avg) + done(); +} + +export async function stopTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('stopTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + + await avRecorder.start().then(() => { + console.info('start stopTimeTestCallback success'); + }).catch((err) => { + console.info('stopTimeTestCallback start avRecorder failed and catch error is ' + err.message); + }); + let end; + let start = Date.now(); + console.info(`stopTimeTestCallback start time is : ${start}`) + await avRecorder.stop((err) => { + if (err == null) { + console.info('resume stopTimeTestCallback success'); + end = Date.now() + console.info(`stopTimeTestCallback end time is : ${end}`) + } else { + console.info('resume stopTimeTestCallback failed and error is ' + err.message); + } + }); + let execution = parseInt(end - start) + console.info("stopTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('stopTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("stopTimeTestCallback avg time is :" + avg) + done(); +} + +export async function resetTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('resetTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + + await avRecorder.start().then(() => { + console.info('start resetTimeTestCallback success'); + }).catch((err) => { + console.info('resetTimeTestCallback start avRecorder failed and catch error is ' + err.message); + }); + let end; + let start = Date.now(); + console.info(`resetTimeTestCallback start time is : ${start}`) + await avRecorder.reset((err) => { + if (err == null) { + console.info('resume resetTimeTestCallback success'); + end = Date.now() + console.info(`resetTimeTestCallback end time is : ${end}`) + } else { + console.info('resume resetTimeTestCallback failed and error is ' + err.message); + } + }); + let execution = parseInt(end - start) + console.info("resetTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('resetTimeTestCallback avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("resetTimeTestCallback avg time is :" + avg) + done(); +} + +export async function releaseTimeTestCallback(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idleCallBack(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('releaseTimeTestCallback avPlayer state is prepared') + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + + await avRecorder.start().then(() => { + console.info('start releaseTimeTestCallback success'); + }).catch((err) => { + console.info('releaseTimeTestCallback start avRecorder failed and catch error is ' + err.message); + }); + let end; + let start = Date.now(); + console.info(`releaseTimeTestCallback start time is : ${start}`) + await avRecorder.release((err) => { + if (err == null) { + console.info('resume releaseTimeTestCallback success'); + end = Date.now() + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + console.info(`releaseTimeTestCallback end time is : ${end}`) + } else { + console.info('resume releaseTimeTestCallback failed and error is ' + err.message); + } + }); + let execution = parseInt(end - start) + console.info("releaseTimeTestCallback execution time is :" + execution) + totalTime = totalTime + execution; + } + let avg = totalTime/10; + console.info("releaseTimeTestCallback avg time is :" + avg) + done(); +} + +export async function createTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + let start = Date.now(); + console.info(`createTimeTestPromise start time is : ${start}`) + avRecorder = await idle(avRecorder); + let end = Date.now() + let execution = parseInt(end - start) + console.info("createTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('createTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + } + let avg = totalTime/10; + console.info("createTimeTestPromise avg time is :" + avg) + done(); +} + +export async function prepareTimePromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + let start = Date.now(); + console.info(`prepareTimeWithoutPromise start time is : ${start}`) + let end; + await avRecorder.prepare(AVRecorderConfig).then(() => { + console.info('prepare success'); + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('prepareTimeWithoutPromise avPlayer state is prepared') + end = Date.now() + console.info(`prepareTimeWithoutPromise end time is : ${end}`) + }).catch((err) => { + console.info('prepare failed and catch error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("prepareTimeWithoutPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('prepareTimeWithoutPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("prepareTimeWithoutPromise avg time is :" + avg) + done(); +} + +export async function getInputSurfaceTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + let surfaceID = null; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + let end; + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('getInputSurfaceTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + let start = Date.now(); + console.info(`getInputSurfaceTimeTestPromise start time is : ${start}`) + await avRecorder.getInputSurface().then((surfaceId) => { + console.info('getInputSurfaceTimeTestPromise success'); + surfaceID = surfaceId; + end = Date.now() + console.info(`getInputSurfaceTimeTestPromise end time is : ${end}`) + }).catch((err) => { + console.info('getInputSurface failed and catch error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("getInputSurfaceTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('getInputSurfaceTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("getInputSurfaceTimeTestPromise avg time is :" + avg) + done(); +} + +export async function startTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + let end; + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('startTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + let start = Date.now(); + console.info(`startTimeTestPromise start time is : ${start}`) + await avRecorder.start().then(() => { + console.info('start AVRecorder success'); + end = Date.now() + console.info(`startTimeTestPromise end time is : ${end}`) + console.info('startTimeTestPromise avRecorder success'); + }).catch((err) => { + console.info('start AVRecorder failed and catch error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("startTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('startTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("startTimeTestPromise avg time is :" + avg) + done(); +} + +export async function pauseTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('pauseTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + await avRecorder.start().then(() => { + console.info('start avRecorder success'); + }).catch((err) => { + console.info('pauseTimeTestPromise start avRecorder failed and catch error is ' + err.message); + }); + let start = Date.now(); + console.info(`pauseTimeTestPromise start time is : ${start}`) + let end; + await avRecorder.pause().then(() => { + console.info('pause AVRecorder success'); + end = Date.now() + console.info(`pauseTimeTestPromise end time is : ${end}`) + console.info('pause pauseTimeTestPromise success'); + }).catch((err) => { + console.info('pause AVRecorder failed and catch error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("pauseTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('pauseTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("pauseTimeTestPromise avg time is :" + avg) + done(); +} + +export async function resumeTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('resumeTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + + await avRecorder.start().then(() => { + console.info('start resumeTimeTestPromise success'); + }).catch((err) => { + console.info('resumeTimeTestPromise start avRecorder failed and catch error is ' + err.message); + }); + let end; + await avRecorder.pause((err) => { + if (err == null) { + console.info('pause resumeTimeTestPromise success'); + } else { + console.info('pause resumeTimeTestPromise failed and error is ' + err.message); + } + }); + let start = Date.now(); + console.info(`resumeTimeTestPromise start time is : ${start}`) + await avRecorder.resume().then(() => { + console.info('resume AVRecorder success'); + console.info('resume resumeTimeTestPromise success'); + end = Date.now() + console.info(`resumeTimeTestPromise end time is : ${end}`) + }).catch((err) => { + console.info('resume AVRecorder failed and catch error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("resumeTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('resumeTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("resumeTimeTestPromise avg time is :" + avg) + done(); +} + +export async function stopTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('stopTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + + await avRecorder.start().then(() => { + console.info('start stopTimeTestPromise success'); + }).catch((err) => { + console.info('stopTimeTestPromise start avRecorder failed and catch error is ' + err.message); + }); + let end; + let start = Date.now(); + console.info(`stopTimeTestPromise start time is : ${start}`) + await avRecorder.stop().then(() => { + console.info('stop AVRecorder success'); + console.info('resume stopTimeTestPromise success'); + end = Date.now() + console.info(`stopTimeTestPromise end time is : ${end}`) + }).catch((err) => { + console.info('stop AVRecorder failed and catch error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("stopTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('stopTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("stopTimeTestPromise avg time is :" + avg) + done(); +} + +export async function resetTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('resetTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + + await avRecorder.start().then(() => { + console.info('start resetTimeTestPromise success'); + }).catch((err) => { + console.info('resetTimeTestPromise start avRecorder failed and catch error is ' + err.message); + }); + let end; + let start = Date.now(); + console.info(`resetTimeTestPromise start time is : ${start}`) + await avRecorder.reset().then(() => { + console.info('reset AVRecorder success'); + console.info('resume resetTimeTestPromise success'); + end = Date.now() + console.info(`resetTimeTestPromise end time is : ${end}`) + }).catch((err) => { + console.info('resume resetTimeTestPromise failed and error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("resetTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + await avRecorder.release().then(() => { + console.info('resetTimeTestPromise avPlayer is release') + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + } + let avg = totalTime/10; + console.info("resetTimeTestPromise avg time is :" + avg) + done(); +} + +export async function releaseTimeTestPromise(avConfig, avRecorder, recorderTime, done) { + let totalTime = 0; + for(var i = 0;i < 10;i++){ + avRecorder = await idlePromise(avRecorder); + await sleep(20) + await avRecorder.prepare(avConfig).then(() => { + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED); + console.info('releaseTimeTestPromise avPlayer state is prepared') + }, mediaTestBase.failurePromise).catch(mediaTestBase.catchPromise); + + await avRecorder.start().then(() => { + console.info('start releaseTimeTestPromise success'); + }).catch((err) => { + console.info('releaseTimeTestPromise start avRecorder failed and catch error is ' + err.message); + }); + let end; + let start = Date.now(); + console.info(`releaseTimeTestPromise start time is : ${start}`) + await avRecorder.release().then(() => { + console.info('release AVRecorder success'); + console.info('resume releaseTimeTestPromise success'); + end = Date.now() + expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); + console.info(`releaseTimeTestPromise end time is : ${end}`) + }).catch((err) => { + console.info('resume releaseTimeTestPromise failed and error is ' + err.message); + }); + let execution = parseInt(end - start) + console.info("releaseTimeTestPromise execution time is :" + execution) + totalTime = totalTime + execution; + } + let avg = totalTime/10; + console.info("releaseTimeTestPromise avg time is :" + avg) + done(); +} + + + + + + + + + + + + + diff --git a/multimedia/media/media_js_standard/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js b/multimedia/media/media_js_standard/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js index 1230def728949b60a8f0d74fe8532bf55425fdf0..656649366a1bc1fce0fd1edc4f91ba8c0e79186b 100644 --- a/multimedia/media/media_js_standard/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js +++ b/multimedia/media/media_js_standard/avRecorder/src/main/js/test/AVRecorderFuncTest.test.js @@ -34,7 +34,94 @@ export default function avRecorderTest() { 'audio_9.m4a', 'audio_10.m4a', 'audio_11.m4a', - 'audio_12.m4a' + 'audio_12.m4a', + 'audio_13.m4a', + 'audio_14.m4a', + 'audio_15.m4a', + 'audio_16.m4a', + 'audio_17.m4a', + 'audio_18.m4a', + 'audio_19.m4a', + 'audio_20.m4a', + 'audio_21.m4a', + 'audio_22.m4a', + 'audio_23.m4a', + 'audio_24.m4a', + 'audio_25.m4a', + 'audio_26.m4a', + 'audio_27.m4a', + 'audio_28.m4a', + 'audio_29.m4a', + 'audio_30.m4a', + 'audio_31.m4a', + 'audio_32.m4a', + 'audio_33.m4a', + 'audio_34.m4a', + 'audio_35.m4a', + 'audio_36.m4a', + 'audio_37.m4a', + 'audio_38.m4a', + 'audio_39.m4a', + 'audio_40.m4a', + 'audio_41.m4a', + 'audio_42.m4a', + 'audio_43.m4a', + 'av_audio_1.m4a', + 'av_audio_2.m4a', + 'av_audio_3.m4a', + 'av_audio_4.m4a', + 'av_audio_5.m4a', + 'av_audio_6.m4a', + 'av_audio_7.m4a', + 'av_audio_8.m4a', + 'av_audio_9.m4a', + 'av_audio_10.m4a', + 'av_audio_11.m4a', + 'av_audio_12.m4a', + 'av_audio_13.m4a', + 'av_audio_14.m4a', + 'av_audio_15.m4a', + 'av_audio_16.m4a', + 'av_audio_17.m4a', + 'av_audio_18.m4a', + 'av_audio_19.m4a', + 'av_audio_20.m4a', + 'av_audio_21.m4a', + 'av_audio_22.m4a', + 'av_audio_23.m4a', + 'av_audio_24.m4a', + 'av_audio_25.m4a', + 'av_audio_26.m4a', + 'av_audio_27.m4a', + 'av_audio_28.m4a', + 'av_audio_29.m4a', + 'av_audio_30.m4a', + 'av_audio_31.m4a', + 'av_audio_32.m4a', + 'av_audio_33.m4a', + 'av_audio_34.m4a', + 'av_audio_35.m4a', + 'av_audio_36.m4a', + 'av_audio_37.m4a', + 'av_audio_38.m4a', + 'av_audio_39.m4a', + 'av_audio_40.m4a', + 'av_audio_41.m4a', + 'av_audio_42.m4a', + 'av_audio_43.m4a', + 'av_audio_44.m4a', + 'av_audio_45.m4a', + 'av_audio_46.m4a', + 'av_audio_47.m4a', + 'av_audio_48.m4a', + 'av_audio_49.m4a', + 'av_audio_50.m4a', + 'av_audio_51.m4a', + 'av_audio_52.m4a', + 'av_audio_53.m4a', + 'av_audio_54.m4a', + 'av_audio_55.m4a', + 'av_audio_56.m4a' ] const RECORDER_TIME = 3000; @@ -45,7 +132,7 @@ export default function avRecorderTest() { let fdObject; let fdPath; - let TAG = "[AudioRecorderLocalTest] "; + let TAG = "[AvRecorderLocalTest] "; let avProfile = { audioBitrate : 48000, audioChannels : 2, @@ -89,7 +176,7 @@ export default function avRecorderTest() { /* * * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0100 * @tc.name : 001.test pause - * @tc.desc : Local Video 001.pause + * @tc.desc : Recorder audio 001.pause * @tc.size : MediumTest * @tc.type : Function test * @tc.level : Level2 @@ -104,54 +191,1805 @@ export default function avRecorderTest() { }) /* * - * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100 - * @tc.name : 001.test pause->prepare - * @tc.desc : Local Video 01.pause->prepare + * @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_PREPARE_API_0100', 0, async function (done) { - console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100 start') + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0200 start') fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[1], "audio"); fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); avConfig.url = fdPath; - avRecorderTestBase.avRecorderReliabilitTest01(avConfig, avRecorder, RECORDER_TIME, done); - console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100 end') + 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_PREPARE_API_0200 - * @tc.name : 001.test prepare without callback - * @tc.desc : Local Video prepare without callback + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300 + * @tc.name : 003.test recording 3 seconds to stop + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) * @tc.size : MediumTest * @tc.type : Function test * @tc.level : Level2 */ - it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200', 0, async function (done) { - console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200 start') + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0300 start') fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[2], "audio"); fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); avConfig.url = fdPath; - avRecorderTestBase.avRecorderReliabilitTest02(avConfig, avRecorder, RECORDER_TIME, done); - console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200 end') + 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_PREPARE_API_0300 - * @tc.name : 001.test prepare with callback - * @tc.desc : Local Video prepare with callback + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400 + * @tc.name : 004.pause->resume->pause + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) * @tc.size : MediumTest * @tc.type : Function test * @tc.level : Level2 */ - it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300', 0, async function (done) { - console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 start') + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_0400 start') fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[3], "audio"); fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); avConfig.url = fdPath; - avRecorderTestBase.avRecorderReliabilitTest03(avConfig, avRecorder, RECORDER_TIME, done); - console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 end') + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[4], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[5], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[6], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[7], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[8], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[9], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[10], "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_AUDIO_FUNCTION_1200 + * @tc.name : 012. audioEncoderMime : audio/mp4a-latm, fileFormat: m4a + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1200 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[11], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderWithCallBack12(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_AUDIO_FUNCTION_1200 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_FORMAT_API_0100 + * @tc.name : 音频录制,location对应的latitude和longitude为-30和60 + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[12], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + let newAvConfig = { + audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, + //videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[13], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + let newAvConfig = { + audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, + //videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[14], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + let newAvConfig = { + audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, + //videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[15], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + let newAvConfig = { + audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, + //videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[16], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + let newAvConfig = { + audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, + //videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[17], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + let newAvConfig = { + audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, + //videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, + 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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[18], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[19], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[20], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[21], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[22], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[23], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[24], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[25], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[26], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[27], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[28], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[29], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[30], "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 play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[31], "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_LOCAL_STABILITY_02_0100 + * @tc.name : 001.recording 1 hours + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @tc.size : MediumTest + * @tc.type : Function test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_LOCAL_STABILITY_02_0100', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_LOCAL_STABILITY_02_0100 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[32], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderWithLongRun(avConfig, avRecorder, RECORDER_LONG_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_LOCAL_STABILITY_02_0100 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0100 + * @tc.name : 01.prepare->start>reset + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[33], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopPrepare2Reset(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.create->prepare->start->reset->release + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[34], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopCreate2Release(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.prepare->start->stop + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[35], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopPrepare2Stop(avConfig, avRecorder, 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.pause->resume + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[36], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopPause2Resume(avConfig, avRecorder, 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.create->release + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[37], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopCreate2Release2(avConfig, avRecorder, LOOP_TIMES, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_PROMISE_01_0500 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STABILITY_CALLBACK_01_0100 + * @tc.name : 01.prepare->start>reset + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[38], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopPrepare2ResetWithCallback(avConfig, avRecorder, 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.create->prepare->start->reset->release + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[39], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopCreate2ReleaseWithCallback(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.prepare->start->stop + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[40], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, 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.pause->resume + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[41], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + console.info('case fdPath is: ' + fdPath); + avConfig.url = fdPath; + console.info('avConfig.url ' + avConfig.url); + avRecorderTestBase.avRecorderLoopPause2ResumeWithCallback(avConfig, avRecorder, 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.create->release + * @tc.desc : Local Video play to pause 1000 times (waiting for callback) + * @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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[42], "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_01_0500 end') + }) + + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100 + * @tc.name : 001.test pause->prepare + * @tc.desc : Recorder pause->prepare + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[43], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest01(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0100 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200 + * @tc.name : 001.test channel + * @tc.desc : Recorder audio channel + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[44], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest02(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0200 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 + * @tc.name : 001.test channel + * @tc.desc : Recorder audio channel + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[45], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest03(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400 + * @tc.name : 001.test resume->prepare + * @tc.desc : Recorder audio resume->prepare + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[46], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest04(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0500 + * @tc.name : 001.test channel + * @tc.desc : Recorder audio channel + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0500', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0500 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[47], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest05(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0500 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0600 + * @tc.name : 001.test pause->start + * @tc.desc : Recorder audio pause->start + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0600', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0600 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[48], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest06(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0600 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0700 + * @tc.name : 001.test resume->start + * @tc.desc : Recorder audio resume->start + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0700', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0700 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[49], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest07(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0700 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_0800 + * @tc.name : 001.test creatAVRecorder->pause + * @tc.desc : Recorder audio creatAVRecorder->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_0800', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_0800 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[50], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest08(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_0800 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0900 + * @tc.name : 001.test prepare->pause + * @tc.desc : Recorder audio prepare->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0900', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0900 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[51], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest09(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_START_API_0900 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1000 + * @tc.name : 001.test start->pause + * @tc.desc : Recorder audio start->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1000', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1000 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[52], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest10(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1000 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1100 + * @tc.name : 001.test resume->pause + * @tc.desc : Recorder audio resume->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1100', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1100 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[53], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest11(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1100 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1200 + * @tc.name : 001.test stop->pause + * @tc.desc : Recorder audio stop->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1200 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[54], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest12(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1200 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1300 + * @tc.name : 001.test reset->pause + * @tc.desc : Recorder audio reset->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1300', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1300 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[55], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest13(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1300 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1400 + * @tc.name : 001.test all step->pause + * @tc.desc : Recorder audio all step->pause + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1400', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1400 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[56], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest14(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1400 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1500 + * @tc.name : 001.test pause three times + * @tc.desc : Recorder audio pause three times + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1500', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1500 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[57], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest15(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PAUSE_API_1500 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1600 + * @tc.name : 001.test creatAVRecorder->resume + * @tc.desc : Recorder audio creatAVRecorder->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1600', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1600 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[58], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest16(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1600 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1700 + * @tc.name : 001.test prepare->resume + * @tc.desc : Recorder audio prepare->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1700', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1700 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[59], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest17(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1700 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1800 + * @tc.name : 001.test start->resume + * @tc.desc : Recorder audio start->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1800', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1800 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[60], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest18(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1800 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1900 + * @tc.name : 001.test pause->resume + * @tc.desc : Recorder audio pause->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1900', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1900 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[61], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest19(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_1900 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2000 + * @tc.name : 001.test stop->resume + * @tc.desc : Recorder audio stop->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2000', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2000 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[62], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest20(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2000 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2100 + * @tc.name : 001.test reset->resume + * @tc.desc : Recorder audio reset->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2100', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2100 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[63], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest21(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2100 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2200 + * @tc.name : 001.test all->resume + * @tc.desc : Recorder audio all->resume + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2200 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[64], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest22(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2200 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2300 + * @tc.name : 001.test resume threee times + * @tc.desc : Recorder audio resume threee times + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2300', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2300 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[65], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest23(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESUME_API_2300 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2400 + * @tc.name : 001.test pause->stop + * @tc.desc : Recorder audio pause->stop + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2400', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2400 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[66], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest24(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2400 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2500 + * @tc.name : 001.test resume->stop + * @tc.desc : Recorder audio resume->stop + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2500', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2500 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[67], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest25(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_STOP_API_2500 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2600 + * @tc.name : 001.test pause->reset + * @tc.desc : Recorder audio pause->reset + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2600', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2600 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[68], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest26(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2600 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2700 + * @tc.name : 001.test resume->reset + * @tc.desc : Recorder audio resume->reset + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2700', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2700 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[69], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest27(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RESET_API_2700 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2800 + * @tc.name : 001.test pause->release + * @tc.desc : Recorder audio pause->release + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2800', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2800 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[70], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest28(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2800 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2900 + * @tc.name : 001.test resume->release + * @tc.desc : Recorder audio resume->release + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2900', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2900 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[71], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest29(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_2900 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_3000 + * @tc.name : 001.test release 3 times + * @tc.desc : Recorder audio release 3 times + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_3000', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_3000 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[72], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest30(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_RELEASE_API_3000 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3100 + * @tc.name : 001.test create->getInputSurface + * @tc.desc : Recorder audio create->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3100', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3100 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[73], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest31(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3100 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3200 + * @tc.name : 001.test prepare->getInputSurface + * @tc.desc : Recorder audio prepare->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3200 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[74], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest32(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3200 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3300 + * @tc.name : 001.test start->getInputSurface + * @tc.desc : Recorder audio start->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3300', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3300 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[75], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest33(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3300 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3400 + * @tc.name : 001.test pause->getInputSurface + * @tc.desc : Recorder audio pause->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3400', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3400 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[76], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest34(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3400 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3500 + * @tc.name : 001.test resume->getInputSurface + * @tc.desc : Recorder audio resume->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3500', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3500 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[77], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest35(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3500 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3600 + * @tc.name : 001.test stop->getInputSurface + * @tc.desc : Recorder audio stop->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3600', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3600 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[78], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest36(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3600 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3700 + * @tc.name : 001.test reset->getInputSurface + * @tc.desc : Recorder audio reset->getInputSurface + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3700', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3700 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[79], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest37(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3700 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3800 + * @tc.name : 001.test getInputSurface 3 times + * @tc.desc : Recorder audio getInputSurface 3 times + * @tc.size : MediumTest + * @tc.type : Reliabilit test + * @tc.level : Level2 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3800', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3800 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[80], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.avRecorderReliabilitTest38(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_GETINPUTSURFACE_API_3800 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0100 + * @tc.name : 001.test createAVRecorder + * @tc.desc : Recorder audio createAVRecorder + * @tc.size : MediumTest + * @tc.type : Performance test + * @tc.level : Level 4 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0100', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0100 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[81], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.createTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0100 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0200 + * @tc.name : 02.AvRecorder.prepare + * @tc.desc : Recorder audio AvRecorder.prepare + * @tc.size : MediumTest + * @tc.type : Performance test + * @tc.level : Level 4 + */ + it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0200', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0200 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[82], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.prepareTimeCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0200 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0300', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0300 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[83], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.getInputSurfaceTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0300 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0400', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0400 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[84], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.startTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0400 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0500', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0500 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[85], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.pauseTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0500 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0600', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0600 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[86], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.resumeTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0600 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0700', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0700 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[87], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.stopTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0700 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0800', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0800 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[88], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + avRecorderTestBase.resetTimeTestCallback(avConfig, avRecorder, RECORDER_TIME, done); + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0800 end') + }) + + /* * + * @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_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_CALLBACK_01_0900', 0, async function (done) { + console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PERFORMANCE_CALLBACK_01_0900 start') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[89], "audio"); + fdPath = "fd://" + fdObject.fdNumber; + avConfig.url = fdPath; + 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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[90], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[91], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[92], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[93], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[94], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[95], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[96], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[97], "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') + fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[98], "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') }) }) }