diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets index be40df9c6f852920606546c3c5cc68ca560d5f91..a878e3c7b712501c349b9bf9ad5b6618c3aba563 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets @@ -2991,7 +2991,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { await CaptureSessionPromise.addInput(camera1InputPromise); - + // 创建预览输出流 + let previewOutput = await cameraObj.createPreviewOutput(surfaceId); // 创建ImageReceiver对象,并设置照片参数 let imageReceiver = await image.createImageReceiver(640, 480, 4, 8); @@ -2999,6 +3000,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { let photoSurfaceId = await imageReceiver.getReceivingSurfaceId(); // 创建拍照输出流 let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId)); + // 向会话中添加预览输入流 + await CaptureSessionPromise.addOutput(previewOutput); // 向会话中添加拍照输出流 await CaptureSessionPromise.addOutput(photoOutput); diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets index d17c75a4da489fb8f97ed691fda485bc6423b43f..49ab3077bc362b68473c5eb82448c9c3bdaf2052 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets @@ -1101,6 +1101,37 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + /** + * @tc.number : VA_COMMIT_CONFIG_CALLBACK_0100 + * @tc.name : CommitConfig async api + * @tc.desc : CommitConfig async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('VA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') + } else { + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 to operate') + await sleep(1) + captureSession.commitConfig(async (err, data) => { + if (!err) { + console.info(TAG + 'Entering CommitConfig data is not null || undefined') + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 success') + } else { + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 err: ' + err.message) + } + expect(true).assertTrue(); + console.info(TAG + 'Entering VA_COMMIT_CONFIG_CALLBACK_0100 ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + } + }) + //framerate /** * @tc.number : GET_FRAME_RATE_RANGE