From 5c3eb9ddc27642e996de42eee87a80b7a4edc95f Mon Sep 17 00:00:00 2001 From: yygxr Date: Tue, 1 Nov 2022 03:54:43 -0700 Subject: [PATCH] fix xts case error for musl Signed-off-by: yygxr --- .../MainAbility/test/CameraInputTest.test.ets | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets index 7a2e8128b..0ef5b28a6 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets @@ -262,23 +262,32 @@ export default function CameraInputTest(surfaceId) { async function createOutput(idx:any) { console.info('Enter createOutput'); - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { - mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); - if (!isEmpty(mPreviewOutput)) { - break; - } - } + let cameraOutputCap = null; + await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => { + console.info('getSupportedOutputCapability success'); + cameraOutputCap = result; + }).catch((err) => { + console.info('getSupportedOutputCapability failed, err = ' + err.message); + }); - if (isEmpty(mPreviewOutput)) { - console.info(TAG + "createPreviewOutput FAILED"); + if (!isEmpty(cameraOutputCap)) { + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; + } + } + + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); + } + + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); } - - console.info(TAG + "createPreviewOutput: " + mPreviewOutput); } - + console.info('Exit createOutputs'); return true; -- GitLab