提交 35c8badd 编写于 作者: B bayanxing

code check

Signed-off-by: Nbayanxing <bayanxing@kaihong.com>
上级 3a7b23a1
...@@ -36,6 +36,7 @@ export async function idleCallback(avRecorder, avConfig, done) { ...@@ -36,6 +36,7 @@ export async function idleCallback(avRecorder, avConfig, done) {
}); });
} }
// create avRecorder(promise)
export async function idle(avRecorder) { export async function idle(avRecorder) {
console.info('case createAVRecorder called'); console.info('case createAVRecorder called');
await media.createAVRecorder().then((recorder) => { await media.createAVRecorder().then((recorder) => {
...@@ -258,7 +259,7 @@ export async function releaseCallback(avRecorder) { ...@@ -258,7 +259,7 @@ export async function releaseCallback(avRecorder) {
if (typeof(avRecorder) == 'undefined') { if (typeof(avRecorder) == 'undefined') {
return; return;
} }
await avRecorder.release((err) => { avRecorder.release((err) => {
console.info('case release called'); console.info('case release called');
if (err == null) { if (err == null) {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED); expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
...@@ -389,6 +390,7 @@ export async function setPrepareOnCallback(avConfig, avRecorder, recorderTime, d ...@@ -389,6 +390,7 @@ export async function setPrepareOnCallback(avConfig, avRecorder, recorderTime, d
} }
export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime, done) { export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime, done) {
// Create an instance
avRecorder = await idle(avRecorder) avRecorder = await idle(avRecorder)
setOnCallback(avConfig, avRecorder, recorderTime, done); setOnCallback(avConfig, avRecorder, recorderTime, done);
await avRecorder.prepare(avConfig) await avRecorder.prepare(avConfig)
...@@ -925,7 +927,7 @@ export async function avRecorderLoopCreate2ReleaseWithCallback(avConfig, avRecor ...@@ -925,7 +927,7 @@ export async function avRecorderLoopCreate2ReleaseWithCallback(avConfig, avRecor
console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start5 `) console.info(`avRecorderLoopCreate2ReleaseWithCallback test loop start5 `)
console.info(`avRecorderLoopCreate2ReleaseWithCallback loop time is :${loopTimes}`) console.info(`avRecorderLoopCreate2ReleaseWithCallback loop time is :${loopTimes}`)
loopTimes--; loopTimes--;
await avRecorder.release((err) => { avRecorder.release((err) => {
if (err == null) { if (err == null) {
console.info('release AVRecorder success'); console.info('release AVRecorder success');
if(loopTimes == 0){ if(loopTimes == 0){
...@@ -2224,7 +2226,7 @@ export async function releaseTimeTestCallback(avConfig, avRecorder, recorderTime ...@@ -2224,7 +2226,7 @@ export async function releaseTimeTestCallback(avConfig, avRecorder, recorderTime
let end; let end;
let start = Date.now(); let start = Date.now();
console.info(`releaseTimeTestCallback start time is : ${start}`) console.info(`releaseTimeTestCallback start time is : ${start}`)
await avRecorder.release((err) => { avRecorder.release((err) => {
if (err == null) { if (err == null) {
console.info(`releaseTimeTestCallback current state is : ${avRecorder.state}`) console.info(`releaseTimeTestCallback current state is : ${avRecorder.state}`)
console.info('release releaseTimeTestCallback success'); console.info('release releaseTimeTestCallback success');
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "6000000", "test-timeout": "6000000",
"shell-timeout": "6000000", "shell-timeout": "6000000",
"testcase-timeout": 1400000, "testcase-timeout": 1100000,
"bundle-name": "ohos.acts.multimedia.audio.avrecorder", "bundle-name": "ohos.acts.multimedia.audio.avrecorder",
"package-name": "ohos.acts.multimedia.audio.avrecorder" "package-name": "ohos.acts.multimedia.audio.avrecorder"
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册