提交 2b95dfe2 编写于 作者: D dongwei

偶现fail修复

Signed-off-by: Ndongwei <dongwei@kaihong.com>
上级 3922dd17
...@@ -1910,7 +1910,7 @@ export async function avRecorderReliabilitTest31(avConfig, avRecorder, recorderT ...@@ -1910,7 +1910,7 @@ export async function avRecorderReliabilitTest31(avConfig, avRecorder, recorderT
let surfaceID = null; let surfaceID = null;
let result = true; let result = true;
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
avRecorder.getInputSurface().then((surfaceId) => { await avRecorder.getInputSurface().then((surfaceId) => {
console.info('avRecorderReliabilitTest31 getInputSurface success'); console.info('avRecorderReliabilitTest31 getInputSurface success');
surfaceID = surfaceId; surfaceID = surfaceId;
}).catch((err) => { }).catch((err) => {
...@@ -2196,6 +2196,18 @@ export async function avRecorderReliabilitTest37(avConfig, avRecorder, recorderT ...@@ -2196,6 +2196,18 @@ export async function avRecorderReliabilitTest37(avConfig, avRecorder, recorderT
await preparePromise(avRecorder, avConfig) await preparePromise(avRecorder, avConfig)
} }
async function getInputSurfaceCatachError(avRecorder, result, surfaceID){
await avRecorder.getInputSurface().then((surfaceId) => {
console.info('getInputSurfaceTest38 getInputSurface success');
surfaceID = surfaceId;
}).catch((err) => {
console.info('getInputSurfaceTest38 getInputSurface failed and catch error is ' + err.message);
result = false
console.info('getInputSurfaceTest38 getInputSurface result is ' + result);
expect(result).assertEqual(false);
});
}
export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime, done) { export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime, done) {
let result1 = true; let result1 = true;
let result2 = true; let result2 = true;
...@@ -2208,33 +2220,9 @@ export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime, ...@@ -2208,33 +2220,9 @@ export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime,
case AV_RECORDER_STATE.PREPARED: case AV_RECORDER_STATE.PREPARED:
console.info(`case getInputSurfaceTest38 state is PREPARED`); console.info(`case getInputSurfaceTest38 state is PREPARED`);
expect(avRecorder.state).assertEqual('prepared'); expect(avRecorder.state).assertEqual('prepared');
getInputSurfaceCatachError(avRecorder, result1, surfaceID)
avRecorder.getInputSurface().then((surfaceId) => { getInputSurfaceCatachError(avRecorder, result2, surfaceID)
console.info('getInputSurfaceTest38 getInputSurface success'); getInputSurfaceCatachError(avRecorder, result3, surfaceID)
surfaceID = surfaceId;
}).catch((err) => {
console.info('getInputSurfaceTest38 getInputSurface failed and catch error is ' + err.message);
result1 = false
});
expect(result1).assertEqual(true);
avRecorder.getInputSurface().then((surfaceId) => {
console.info('getInputSurfaceTest38 getInputSurface success');
surfaceID = surfaceId;
}).catch((err) => {
console.info('getInputSurfaceTest38 getInputSurface failed and catch error is ' + err.message);
result2 = false
});
expect(result2).assertEqual(true);
avRecorder.getInputSurface().then((surfaceId) => {
console.info('getInputSurfaceTest38 getInputSurface success');
surfaceID = surfaceId;
}).catch((err) => {
console.info('getInputSurfaceTest38 getInputSurface failed and catch error is ' + err.message);
result3 = false
});
expect(result3).assertEqual(true);
releasePromise(avRecorder) releasePromise(avRecorder)
break; break;
case AV_RECORDER_STATE.RELEASED: case AV_RECORDER_STATE.RELEASED:
...@@ -2256,6 +2244,7 @@ export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime, ...@@ -2256,6 +2244,7 @@ export async function getInputSurfaceTest38(avConfig, avRecorder, recorderTime,
}); });
} }
export async function avRecorderReliabilitTest38(avConfig, avRecorder, recorderTime, done) { export async function avRecorderReliabilitTest38(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
getInputSurfaceTest38(avConfig, avRecorder, recorderTime, done) getInputSurfaceTest38(avConfig, avRecorder, recorderTime, done)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册