提交 329b2556 编写于 作者: Y yygxr

fix camera session xts error

Signed-off-by: Nyygxr <wuhao30@huawei.com>
上级 c636d146
......@@ -1660,107 +1660,7 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102
* @tc.name : Check capture session add/remove output with callback or not for video
* @tc.desc : Check capture session add/remove output with callback or not for video
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102--------------");
if (isEmpty(mCameraInputArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 FAILED with NoCamera");
expect().assertFail();
done();
}
else {
if (!isEmpty(mVideoOutput) && (mCanAddOutput == true)) {
mCameraSession.addOutput(mVideoOutput, async (err) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 add callback");
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 add PASSED");
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 add FAILED : " + err.message);
expect().assertFail();
}
})
await mCameraSession.addInput(mCameraInputArray[0]);
await sleep(500);
await commitCameraSessionConfig();
await sleep(1);
await beginCameraSessionConfig();
await sleep(1);
await sleep(500);
mCameraSession.removeOutput(mVideoOutput, async (err) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 remove callback");
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 remove PASSED");
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 remove FAILED : " + err.message);
expect().assertFail();
}
})
await mCameraSession.removeInput(mCameraInputArray[0]);
await sleep(500);
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 FAILED");
expect().assertFail();
}
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 ends here");
done();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102
* @tc.name : Check capture session can add/remove output with promise or not for video
* @tc.desc : Check capture session can add/remove output with promise or not for video
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102--------------");
if (isEmpty(mCameraInputArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 FAILED with NoCamera");
expect().assertFail();
done();
}
else {
if (!isEmpty(mVideoOutput) && (mCanAddOutput == true)) {
await mCameraSession.addOutput(mVideoOutput);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 PASSED");
await mCameraSession.addInput(mCameraInputArray[0]);
await sleep(500);
await commitCameraSessionConfig();
await sleep(1);
await beginCameraSessionConfig();
await sleep(1);
await sleep(500);
await mCameraSession.removeOutput(mVideoOutput);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 remove PASSED");
await mCameraSession.removeInput(mCameraInputArray[0]);
await sleep(500);
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 FAILED");
expect().assertFail();
}
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 ends here");
done();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册