diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets index 5ea47b0c698c6d9b9e374b8ae68c348b93db6ec2..0c1ee3df54ca31db2d0e9f88221cb5e9b45375a8 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraEnumTest.test.ets @@ -96,7 +96,7 @@ export default function cameraEnumTest() { */ it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------"); - expect(camera.CameraType.CAMERA_TYPE_UNSPECIFIED == 0).assertTrue(); + expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue(); @@ -125,28 +125,6 @@ export default function cameraEnumTest() { }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100 - * @tc.name : Camera CameraInputErrorCode Eunm - * @tc.desc : Camera CameraInputErrorCode Eunm - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100--------------"); - expect(camera.CameraInputErrorCode.ERROR_UNKNOWN == -1).assertTrue(); - expect(camera.CameraInputErrorCode.ERROR_NO_PERMISSION == 0).assertTrue(); - expect(camera.CameraInputErrorCode.ERROR_DEVICE_PREEMPTED == 1).assertTrue(); - expect(camera.CameraInputErrorCode.ERROR_DEVICE_DISCONNECTED == 2).assertTrue(); - expect(camera.CameraInputErrorCode.ERROR_DEVICE_IN_USE == 3).assertTrue(); - expect(camera.CameraInputErrorCode.ERROR_DRIVER_ERROR == 4).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAINPUTERRORCODE_0100 ends here"); - done(); - }) - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAFORMAT_0100 * @tc.name : Camera CameraFormat Eunm @@ -260,45 +238,6 @@ export default function cameraEnumTest() { }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100 - * @tc.name : Camera CaptureSessionErrorCode Eunm - * @tc.desc : Camera CaptureSessionErrorCode Eunm - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100--------------"); - expect(camera.CaptureSessionErrorCode.ERROR_UNKNOWN == -1).assertTrue(); - expect(camera.CaptureSessionErrorCode.ERROR_INSUFFICIENT_RESOURCES == 0).assertTrue(); - expect(camera.CaptureSessionErrorCode.ERROR_TIMEOUT == 1).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAPTURESESSIONERRORCODE_0100 ends here"); - done(); - }) - - - - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100 - * @tc.name : Camera PreviewOutputErrorCode Eunm - * @tc.desc : Camera PreviewOutputErrorCode Eunm - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100--------------"); - expect(camera.PreviewOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_PREVIEWOUTPUTERRORCODE_0100 ends here"); - done(); - }) - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_IMAGEROTATION_0100 * @tc.name : Camera ImageRotation Eunm @@ -337,48 +276,6 @@ export default function cameraEnumTest() { }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100 - * @tc.name : Camera PhotoOutputErrorCode Eunm - * @tc.desc : Camera PhotoOutputErrorCode Eunm - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100--------------"); - expect(camera.PhotoOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue(); - expect(camera.PhotoOutputErrorCode.ERROR_DRIVER_ERROR == 0).assertTrue(); - expect(camera.PhotoOutputErrorCode.ERROR_INSUFFICIENT_RESOURCES == 1).assertTrue(); - expect(camera.PhotoOutputErrorCode.ERROR_TIMEOUT == 2).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_PHOTOOUTPUTERRORCODE_0100 ends here"); - done(); - }) - - - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100 - * @tc.name : Camera VideoOutputErrorCode Eunm - * @tc.desc : Camera VideoOutputErrorCode Eunm - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100--------------"); - expect(camera.VideoOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue(); - expect(camera.VideoOutputErrorCode.ERROR_DRIVER_ERROR == 0).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_VIDEOOUTPUTERRORCODE_0100 ends here"); - done(); - }) - - - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOBJECTTYPE_0100 * @tc.name : Camera MetadataObjectType Eunm @@ -394,23 +291,5 @@ export default function cameraEnumTest() { done(); }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100 - * @tc.name : Camera MetadataOutputErrorCode Eunm - * @tc.desc : Camera MetadataOutputErrorCode Eunm - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100--------------"); - expect(camera.MetadataOutputErrorCode.ERROR_UNKNOWN == -1).assertTrue(); - expect(camera.MetadataOutputErrorCode.ERROR_INSUFFICIENT_RESOURCES == 0).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_METADATAOUTPUTERRORCODE_0100 ends here"); - done(); - }) - - }) } \ No newline at end of file diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraInputTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraInputTest.test.ets index dced6f3bcfdee2c8f03bf470b584387d7f45d08d..6f677f454c97475f99431422dd5a0c84dd96cd23 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraInputTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraInputTest.test.ets @@ -121,13 +121,9 @@ export default function CameraInputTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) + console.info(TAG + "Entering beginConfig start"); + mCameraSession.beginConfig(); + console.info(TAG + "Entering beginConfig end"); await sleep(30); @@ -188,13 +184,7 @@ export default function CameraInputTest() { return false; } - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); if (isEmpty(mCameraInput)) { console.info(TAG + "createCameraInput FAILED"); @@ -224,7 +214,6 @@ export default function CameraInputTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -235,14 +224,7 @@ export default function CameraInputTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - }); + let cameraOutputCap = mCameraManager.getSupportedOutputCapability(); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -410,130 +392,100 @@ export default function CameraInputTest() { }); /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 - * @tc.name : open/close/release Camera with cameraInput callback api - * @tc.desc : open/close/release Camera with cameraInput callback api + * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 + * @tc.name : open/close Camera with cameraInput callback api + * @tc.desc : open/close Camera with cameraInput callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100', 0, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100--------------"); if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 cameraManager == null || undefined"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 cameraManager == null || undefined"); expect().assertFail(); } else { let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { let successFlag = false; console.info(TAG + "Entering createCameraInput with camera: " + camerasArray[i].cameraId); - await mCameraManager.createCameraInput(camerasArray[i]).then(async (cameraInput) => { - expect(isEmpty(cameraInput)).assertFalse(); - await cameraInput.open(async (err) => { - if (!err) { - successFlag = true; - console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED open with CameraID :" + camerasArray[i].cameraId); - } else { - successFlag = false; - console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 open FAILED: " + err.message); - } - }); - await sleep(400); - successFlag = false; - await cameraInput.close(async (err) => { - if (!err) { - successFlag = true; - console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED close with CameraID :" + camerasArray[i].cameraId); - } else { - successFlag = false; - console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 close FAILED: " + err.message); - } - }); - await sleep(100); - successFlag = false; - await cameraInput.release(async (err) => { - if (!err) { - successFlag = true; - console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED release with CameraID :" + camerasArray[i].cameraId); - } else { - successFlag = false; - console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 release FAILED: " + err.message); - } - }); - await sleep(100); - expect(successFlag).assertEqual(true); - }).catch((err) => { - expect().assertFail(); - console.info(TAG + " Failed To create cameraInput cameraId: " + camerasArray[i].cameraId + +JSON.stringify(err)); + let cameraInput = mCameraManager.createCameraInput(camerasArray[i]); + expect(isEmpty(cameraInput)).assertFalse(); + await cameraInput.open(async (err) => { + if (!err) { + successFlag = true; + console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 PASSED open with CameraID :" + camerasArray[i].cameraId); + } else { + successFlag = false; + console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 open FAILED: " + err.message); + } }); - } + await sleep(400); + successFlag = false; + await cameraInput.close(async (err) => { + if (!err) { + successFlag = true; + console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 PASSED close with CameraID :" + camerasArray[i].cameraId); + } else { + successFlag = false; + console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 close FAILED: " + err.message); + } + }); + await sleep(100); + expect(successFlag).assertEqual(true); + } } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 ends here"); await sleep(1000); done(); }); /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 - * @tc.name : open/close/release Camera with cameraInput promise api - * @tc.desc : open/close/release Camera with cameraInput promise api + * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 + * @tc.name : open/close Camera with cameraInput promise api + * @tc.desc : open/close Camera with cameraInput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100', 0, async function (done) { - let functionTag = "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100"; + it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100', 0, async function (done) { + let functionTag = "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100"; console.info(functionTag); if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 cameraManager == null || undefined"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 cameraManager == null || undefined"); expect().assertFail(); } else { let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { let successFlag = false; - console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 createCameraInput with camera: " + camerasArray[i].cameraId); - mCameraManager.createCameraInput(camerasArray[i], async (err, cameraInput) => { - if (!err) { - expect(isEmpty(cameraInput)).assertFalse(); - console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 cameraInput open with camera: " + camerasArray[i].cameraId); - await cameraInput.open().then(async () => { - successFlag = true; - console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED open with CameraID :" + camerasArray[i].cameraId); - }).catch((err) => { - successFlag = false; - console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 open FAILED: " + err.message); - }); - await sleep(400); - successFlag = false; - await cameraInput.close().then(async () => { - successFlag = true; - console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED close with CameraID :" + camerasArray[i].cameraId); - }).catch((err) => { - successFlag = false; - console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 close FAILED: " + err.message); - }); - await sleep(100); - successFlag = false; - await cameraInput.release().then(async () => { - successFlag = true; - console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED release with CameraID :" + camerasArray[i].cameraId); - }).catch((err) => { - successFlag = false; - console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 release FAILED: " + err.message); - }); - await sleep(100); - expect(successFlag).assertEqual(true); - } else { - expect().assertFail(); - console.info(TAG + functionTag + " FAILED: " + err.message); - } + console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 createCameraInput with camera: " + camerasArray[i].cameraId); + let cameraInput = mCameraManager.createCameraInput(camerasArray[i]); + + expect(isEmpty(cameraInput)).assertFalse(); + console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 cameraInput open with camera: " + camerasArray[i].cameraId); + await cameraInput.open().then(async () => { + successFlag = true; + console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 PASSED open with CameraID :" + camerasArray[i].cameraId); + }).catch((err) => { + successFlag = false; + console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 open FAILED: " + err.message); }); - + await sleep(400); + successFlag = false; + await cameraInput.close().then(async () => { + successFlag = true; + console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 PASSED close with CameraID :" + camerasArray[i].cameraId); + }).catch((err) => { + successFlag = false; + console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 close FAILED: " + err.message); + }); + await sleep(100); + expect(successFlag).assertEqual(true); await sleep(600); } //await sleep(400 * camerasArray.length); } - console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 ends here"); + console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 ends here"); done(); }); diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets index ee1bed92bd1fe051916ec541b0c70586752b6a03..680b8292c12ca08422d14eb74678c718b48585a4 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraJSUnitOutput.test.ets @@ -159,7 +159,6 @@ export default function cameraJSUnitOutput() { async function release() { console.log(TAG + "start release"); - await cameraInput.release(); await captureSession.release(); console.log(TAG + "release end") } @@ -229,19 +228,7 @@ export default function cameraJSUnitOutput() { console.info(TAG + "Entering GET_CAMERA_MANAGER cameraManager == null || undefined") expect().assertFail(); } else { - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - expect(isEmpty(data)).assertFalse(); - console.info(TAG + "Entering GET_CAMERA_MANAGER success"); - cameraManager = data; - } else { - expect().assertFail(); - console.info(TAG + "Entering GET_CAMERA_MANAGER FAILED: " + err.message); - } - console.info(TAG + "Entering GET_CAMERA_MANAGER ends here"); - await sleep(1000); - done(); - }) + cameraManager = cameraObj.getCameraManager(null); await sleep(1000); done(); } @@ -262,43 +249,33 @@ export default function cameraJSUnitOutput() { console.info(TAG + "Entering GET_CAMERAS cameraManager == null || undefined") expect().assertFail(); } - cameraManager.getSupportedCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GET_CAMERAS success"); - if (isEmpty(data)) { - expect().assertFail(); - console.info(TAG + "Entering GET_CAMERAS FAILED cameraArray is null || undefined"); - } else { - console.info(TAG + "Entering GET_CAMERAS data is not null || undefined"); - cameraDevicesArray = data; - if (cameraDevicesArray != null && cameraDevicesArray.length > 0) { - for (let i = 0; i < cameraDevicesArray.length; i++) { - // Get the variables from camera object - let cameraId = cameraDevicesArray[i].cameraId; - expect(isEmpty(cameraId)).assertFalse(); - console.info(TAG + "Entering GET_CAMERAS camera" + i + "Id: " + cameraId); - let cameraPosition = cameraDevicesArray[i].cameraPosition; - expect(isEmpty(cameraPosition)).assertFalse(); - console.info(TAG + "Entering GET_CAMERAS camera" + i + "Position: " + cameraPosition); - let cameraType = cameraDevicesArray[i].cameraType; - expect(isEmpty(cameraType)).assertFalse(); - console.info(TAG + "Entering GET_CAMERAS camera" + i + "Type: " + cameraType); - let connectionType = cameraDevicesArray[i].connectionType - expect(isEmpty(connectionType)).assertFalse(); - console.info(TAG + "Entering GET_CAMERAS connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering GET_CAMERAS PASSED"); - } + cameraDevicesArray = cameraManager.getSupportedCameras(); + + if (isEmpty(cameraDevicesArray)) { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERAS FAILED cameraArray is null || undefined"); + } else { + console.info(TAG + "Entering GET_CAMERAS data is not null || undefined"); + if (cameraDevicesArray != null && cameraDevicesArray.length > 0) { + for (let i = 0; i < cameraDevicesArray.length; i++) { + // Get the variables from camera object + let cameraId = cameraDevicesArray[i].cameraId; + expect(isEmpty(cameraId)).assertFalse(); + console.info(TAG + "Entering GET_CAMERAS camera" + i + "Id: " + cameraId); + let cameraPosition = cameraDevicesArray[i].cameraPosition; + expect(isEmpty(cameraPosition)).assertFalse(); + console.info(TAG + "Entering GET_CAMERAS camera" + i + "Position: " + cameraPosition); + let cameraType = cameraDevicesArray[i].cameraType; + expect(isEmpty(cameraType)).assertFalse(); + console.info(TAG + "Entering GET_CAMERAS camera" + i + "Type: " + cameraType); + let connectionType = cameraDevicesArray[i].connectionType + expect(isEmpty(connectionType)).assertFalse(); + console.info(TAG + "Entering GET_CAMERAS connection" + i + "Type: " + connectionType); } - } else { - expect().assertFail(); - console.info(TAG + "Entering GET_CAMERAS FAILED: " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERAS PASSED"); } - console.info(TAG + "Entering GET_CAMERAS ends here"); - await sleep(1000); - done(); - }) + } await sleep(1000); done(); }) @@ -313,15 +290,15 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100', 2, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 2, async function (done) { + console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); if (isEmpty(cameraManager)) { console.info(TAG + "Entering CREATE_CAMERA_INPUT cameraManager == null || undefined") expect().assertFail(); } else { cameraInput = await cameraManager.createCameraInput(cameraDevicesArray[0]); if (isEmpty(cameraInput)) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 FAILED"); + console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); } cameraInput.open(async (err) => { if (!err) { @@ -345,7 +322,7 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100--------------"); if (isEmpty(cameraManager)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 cameraManager == null || undefined") @@ -358,20 +335,7 @@ export default function cameraJSUnitOutput() { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined") expect(isEmpty(previewProfilesArray)).assertFalse(); } - cameraManager.createPreviewOutput(previewProfilesArray[0], globalThis.surfaceId, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 is not error"); - expect(isEmpty(data)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 success"); - previewOutput = data; - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + previewOutput = cameraManager.createPreviewOutput(previewProfilesArray[0], globalThis.surfaceId); } await sleep(1000); done(); @@ -419,7 +383,7 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100--------------"); if (isEmpty(cameraManager)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 cameraManager == null || undefined") @@ -431,20 +395,7 @@ export default function cameraJSUnitOutput() { let videoProfilesArray = cameraOutputCap.videoProfiles; expect(isEmpty(videoProfilesArray)).assertFalse(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 start createVideoOutput") - cameraManager.createVideoOutput(videoProfilesArray[0], videoSurfaceId, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 is not error"); - expect(isEmpty(data)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 success"); - videoOutput = data; - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + videoOutput = cameraManager.createVideoOutput(videoProfilesArray[0], videoSurfaceId); } await sleep(1000); done(); @@ -459,7 +410,7 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100--------------"); if (isEmpty(cameraManager)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 cameraManager == null || undefined") @@ -473,24 +424,7 @@ export default function cameraJSUnitOutput() { console.info("SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 end with mMetadataObjectTypeArray is null"); } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 start createMetadataOutput") - cameraManager.createMetadataOutput(mMetadataObjectTypeArray, async (err, data) => { - if (!err) { - if (!isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 success"); - metadataOutput = data; - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100, data == null || undefined"); - expect().assertFail(); - } - - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + metadataOutput = cameraManager.createMetadataOutput(mMetadataObjectTypeArray); } } await sleep(1000); @@ -507,27 +441,14 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_0100', 1, async function (done) { console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100--------------"); if (isEmpty(cameraManager)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 cameraManager == null || undefined") expect().assertFail(); } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100") - cameraManager.createCaptureSession(async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession is not error"); - expect(isEmpty(data)).assertFalse(); - captureSession = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession = cameraManager.createCaptureSession(); } await sleep(1000); done(); @@ -542,24 +463,13 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_CALLBACK_0100--------------"); if (isEmpty(captureSession)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_CALLBACK_0100 captureSession == null || undefined") expect().assertFail(); } else { - captureSession.beginConfig(async (err) => { - if (!err) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_CALLBACK_0100 success"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_BEGIN_CONFIG_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession.beginConfig(); } await sleep(1000); done(); @@ -575,24 +485,13 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_CALLBACK_0100--------------"); if (isEmpty(captureSession)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_CALLBACK_0100 captureSession == null || undefined") expect().assertFail(); } else { - captureSession.addInput(cameraInput, async (err) => { - if (!err) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_CALLBACK_0100 success"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession.addInput(cameraInput) } await sleep(1000); done(); @@ -608,28 +507,17 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100', 1, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_0100', 1, async function (done) { + console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_0100--------------"); if (isEmpty(captureSession)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100 captureSession == null || undefined") + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_0100 captureSession == null || undefined") expect().assertFail(); } else { if (isEmpty(previewOutput)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100 previewOutput == null || undefined") + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_0100 previewOutput == null || undefined") expect().assertFail(); } - captureSession.addOutput(previewOutput, async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100 success"); - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PREVIEW_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession.addOutput(previewOutput) } await sleep(1000); done(); @@ -644,7 +532,7 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_CALLBACK_0100--------------"); if (isEmpty(captureSession)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_CALLBACK_0100 captureSession == null || undefined") @@ -655,18 +543,7 @@ export default function cameraJSUnitOutput() { expect().assertFail(); } console.info(TAG + "captureSession start add photoOutput") - captureSession.addOutput(photoOutput, async (err) => { - if (!err) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_CALLBACK_0100 success"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_PHOTO_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession.addOutput(photoOutput) } await sleep(1000); done(); @@ -681,24 +558,13 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_CALLBACK_0100--------------"); if (isEmpty(captureSession)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_CALLBACK_0100 captureSession == null || undefined") expect().assertFail(); } else { - captureSession.addOutput(videoOutput, async (err) => { - if (!err) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_CALLBACK_0100 success"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_VIDEO_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession.addOutput(videoOutput) } await sleep(1000); done(); @@ -713,25 +579,14 @@ export default function cameraJSUnitOutput() { * @tc.type : Function * @tc.level : Level 1 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100', 1, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_0100', 1, async function (done) { console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100--------------"); if (isEmpty(captureSession)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 captureSession == null || undefined") expect().assertFail(); } else { if (!isEmpty(metadataOutput)) { - captureSession.addOutput(metadataOutput, async (err) => { - if (!err) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 success"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_ADD_METADATA_OUTPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) + captureSession.addOutput(metadataOutput) } } @@ -805,6 +660,38 @@ export default function cameraJSUnitOutput() { }) + /** + * @tc.number : SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 + * @tc.name : metadata output callback on error api + * @tc.desc : metadata output callback on error api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 1 + */ + it('SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100', 1, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------"); + if (isEmpty(metadataOutput)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadataOutput == null || undefined") + expect().assertFail(); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); + metadataOutput.on('error', async (err, data) => { + if (!err) { + expect(true).assertTrue(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 success"); + } else { + expect().assertFail(); + console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + } + await sleep(1000); + done(); + }) + + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 * @tc.name : captureSession start @@ -865,42 +752,6 @@ export default function cameraJSUnitOutput() { done(); }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100 - * @tc.name : Start metadataOutput type async api - * @tc.desc : Start metadataOutput type async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100', 1, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100--------------"); - if (isEmpty(mMetadataObjectArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100 mMetadataObjectArray == null || undefined") - } else { - mMetadataObjectArray[0].getType(async (err, data) => { - if (!err) { - if (!isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100 success, data : " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100 FAILED, data == null || undefined"); - expect().assertFail(); - } - - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - }) - } - await sleep(1000); - done(); - }) - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 * @tc.name : Start metadataOutput type async api @@ -914,12 +765,7 @@ export default function cameraJSUnitOutput() { if (isEmpty(mMetadataObjectArray)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 mMetadataObjectArray == null || undefined") } else { - let type = mMetadataObjectArray[0].getType().then((result) => { - console.info('SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 success :' + result); - }).catch((err) => { - console.info('SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 failed :' + err); - expect().assertFail(); - }); + let type = mMetadataObjectArray[0].type; console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 success, type : " + type); } await sleep(1000); @@ -927,40 +773,6 @@ export default function cameraJSUnitOutput() { }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100 - * @tc.name : Start metadataOutput timestamp async api - * @tc.desc : Start metadataOutput timestamp async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100', 1, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100--------------"); - if (isEmpty(mMetadataObjectArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100 mMetadataObjectArray == null || undefined") - } else { - mMetadataObjectArray[0].getTimestamp(async (err, data) => { - if (!err) { - if (!isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100 success, data : " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100 FAILED, data == null || undefined"); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_CALLBACK_0100 ends here"); - await sleep(1000); - }) - } - await sleep(1000); - done(); - }) - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 * @tc.name : Start metadataOutput timestamp async api @@ -974,12 +786,7 @@ export default function cameraJSUnitOutput() { if (isEmpty(mMetadataObjectArray)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 mMetadataObjectArray == null || undefined") } else { - let timeStamp = mMetadataObjectArray[0].getTimestamp().then((result) => { - console.info('SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 success :' + result); - }).catch((err) => { - console.info('SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 failed :' + err); - expect().assertFail(); - }); + let timeStamp = mMetadataObjectArray[0].timestamp; console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 success, timeStamp : " + timeStamp); } await sleep(1000); @@ -987,42 +794,6 @@ export default function cameraJSUnitOutput() { }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100 - * @tc.name : Start metadataOutput bounding box async api - * @tc.desc : Start metadataOutput bounding box async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100', 1, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100--------------"); - if (isEmpty(mMetadataObjectArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100 mMetadataObjectArray == null || undefined") - } else { - mMetadataObjectArray[0].getBoundingBox(async (err, data) => { - if (!err) { - if (!isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100 success, data : " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100 FAILED, data == null || undefined"); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - - } - await sleep(1000); - done(); - }) - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 * @tc.name : Start metadataOutput bounding box async api @@ -1036,14 +807,13 @@ export default function cameraJSUnitOutput() { if (isEmpty(mMetadataObjectArray)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 mMetadataObjectArray == null || undefined") } else { - let boundingBox = mMetadataObjectArray[0].getBoundingBox().then((result) => { - console.info('SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success :' + result); - }).catch((err) => { - console.info('SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 failed :' + err); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.width + "x" + boundingBox.height); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.topLeftX + "x" + boundingBox.topLeftY); + let boundingBox = mMetadataObjectArray[0].boundingBox; + let w = boundingBox.width; + let h = boundingBox.height; + let tx = boundingBox.topLeftX; + let ty = boundingBox.topLeftY; + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + w + "x" + h); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + tx + "x" + ty); } await sleep(1000); done(); @@ -1312,12 +1082,7 @@ export default function cameraJSUnitOutput() { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_PROMISE_0100 photoOutput == null || undefined") expect().assertFail(); } else { - let isMirrorSupportedFlag = await photoOutput.isMirrorSupported().then((result) => { - console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_PROMISE_0100 success :' + result); - }).catch((err) => { - console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_PROMISE_0100 failed :' + err); - expect().assertFail(); - }); + let isMirrorSupportedFlag = photoOutput.isMirrorSupported(); console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_PROMISE_0100 isMirrorSupportedFlag = ' + isMirrorSupportedFlag); } @@ -1326,44 +1091,6 @@ export default function cameraJSUnitOutput() { }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100 - * @tc.name : check photoOutput is mirror supported with callback mode - * @tc.desc : check photoOutput is mirror supported with callback mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100', 1, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100--------------"); - if (isEmpty(photoOutput)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100 photoOutput == null || undefined") - expect().assertFail(); - } else { - photoOutput.isMirrorSupported(async (err, data) => { - if (!err) { - if (!isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100 success, data = " + data); - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100 FAILED, data == null || undefined"); - expect().assertFail(); - } - - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_IS_MIRROR_SUPPORTED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_DEFAULT_PROMISE_0100 diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets index 7c06bf62e5ca46602452c7462eea03368fa24fe5..bdd90e505be9ffee48da3f4da83224ebbdad66eb 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraManagerTest.test.ets @@ -210,53 +210,22 @@ export default function cameraManagerTest() { return true; } - async function getSupportedOutputCapabilityInCallback(cameraDevice) { + async function getSupportedOutputCapability(cameraDevice) { if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering getSupportedOutputCapabilityInCallback cameraManager == null || undefined") + console.info(TAG + "Entering getSupportedOutputCapability cameraManager == null || undefined") expect().assertFail(); return undefined; } - let outputCapabilityCallback = null; - mCameraManager.getSupportedOutputCapability(cameraDevice, async (err, data) => { - if (!err) { - if (!isEmpty(data)) { - console.info(TAG + "getSupportedOutputCapabilityInCallback data is not null || undefined"); - outputCapabilityCallback = data; - } - else { - console.info(TAG + "getSupportedOutputCapabilityInCallback FAILED"); - } - } else { - console.info(TAG + "getSupportedOutputCapabilityInCallback FAILED: " + err.message); - } - console.info(TAG + "getSupportedOutputCapabilityInCallback ends here"); - }) - await sleep(100); - return outputCapabilityCallback; - } - async function getSupportedOutputCapabilityInPromise(cameraDevice) { - if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering getSupportedOutputCapabilityInPromise cameraManager == null || undefined") - expect().assertFail(); - return undefined; - } + let outputCapability = mCameraManager.getSupportedOutputCapability(cameraDevice); - let outputCapabilityPromise = null; - await mCameraManager.getSupportedOutputCapability(cameraDevice).then((result) => { - console.info('getSupportedOutputCapabilityInPromise success'); - outputCapabilityPromise = result; - }).catch((err) => { - console.info('getSupportedOutputCapabilityInPromise failed, err = ' + err.message); - }); - - if (isEmpty(outputCapabilityPromise)) { - console.info(TAG + "Entering getSupportedOutputCapabilityInPromise outputCapabilityPromise == null || undefined") + if (isEmpty(outputCapability)) { + console.info(TAG + "Entering getSupportedOutputCapability outputCapability == null || undefined") } else { - console.info("CameraUnitTest: getSupportedOutputCapabilityInPromise: " + JSON.stringify(outputCapabilityPromise)); + console.info("CameraUnitTest: getSupportedOutputCapability: " + JSON.stringify(outputCapability)); } - return outputCapabilityPromise; + return outputCapability; } describe('CameraManagerTest', function () { @@ -285,30 +254,7 @@ describe('CameraManagerTest', function () { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 - * @tc.name : Create camera manager instance async api - * @tc.desc : Create camera manager instance async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - expect(isEmpty(data)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 success"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - }) - await sleep(1000); - done(); - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 @@ -327,64 +273,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 - * @tc.name : Get camera from cameramanager to get array of camera async api - * @tc.desc : Get camera from cameramanager to get array of camera async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100--------------"); - if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 cameraManager == null || undefined") - expect().assertFail(); - } - mCameraManager.getSupportedCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 success"); - if (!isEmpty(data)) { - mCameraDevicesArray = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 data is " + mCameraDevicesArray.length); - if (mCameraDevicesArray.length > 0) { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - // Get the variables from camera object - let cameraId = mCameraDevicesArray[i].cameraId; - expect(isEmpty(cameraId)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - let cameraPosition = mCameraDevicesArray[i].cameraPosition; - expect(isEmpty(cameraPosition)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - let cameraType = mCameraDevicesArray[i].cameraType; - expect(isEmpty(cameraType)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - let connectionType = mCameraDevicesArray[i].connectionType - expect(isEmpty(connectionType)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED , err = " + err.message); - } - }) - await sleep(1000); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 * @tc.name : Get camera from cameramanager to get array of camera promise api @@ -443,7 +331,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInCallback(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); await sleep(100); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { @@ -489,7 +377,7 @@ describe('CameraManagerTest', function () { it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100--------------"); for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(mCameraDevicesArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(mCameraDevicesArray[i]); console.info("Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 camera:" + mCameraDevicesArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let previewProfilesArray = cameraOutputCap.previewProfiles; @@ -537,7 +425,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let previewProfilesArray = cameraOutputCap.previewProfiles; @@ -574,7 +462,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let photoProfilesArray = cameraOutputCap.photoProfiles; @@ -611,7 +499,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let videoProfilesArray = cameraOutputCap.videoProfiles; @@ -639,42 +527,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 cameraManager == null || undefined") - expect().assertFail(); - } else { - let camerasArray = mCameraDevicesArray; - for (let i = 0; i < camerasArray.length; i++) { - mCameraManager.createCameraInput(camerasArray[i], async (err, data) => { - if (!err) { - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + mCameraDevicesArray[0].cameraId); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 camera: " + camerasArray[i].cameraId); - }) - } - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 * @tc.name : Create camerainput from camera-0 cameraId promise api @@ -704,42 +556,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100--------------"); - if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 cameraManager == null || undefined") - expect().assertFail(); - } else { - let camerasArray = mCameraDevicesArray; - for (let i = 0; i < camerasArray.length; i++) { - mCameraManager.createCameraInput(camerasArray[i].cameraPosition, camerasArray[i].cameraType, async (err, data) => { - if (!err) { - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 success"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - }) - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera: " + camerasArray[i].cameraId); - } - } - await sleep(1000); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 * @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api @@ -769,46 +585,6 @@ describe('CameraManagerTest', function () { done(); }) - /*CREATE CAMERAOUTPUT*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100--------------"); - let camerasArray = mCameraDevicesArray; - for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); - console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); - - if (!isEmpty(cameraOutputCap)) { - let previewProfilesArray = cameraOutputCap.previewProfiles; - if (isEmpty(previewProfilesArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined") - expect().assertFail(); - } else { - for (let j = 0; j < previewProfilesArray.length; j++) { - mCameraManager.createPreviewOutput(previewProfilesArray[j], globalThis.surfaceId, async (err, data) => { - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } - }) - await sleep(100); - } - } - - } - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 PASS"); - await sleep(1000); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api @@ -821,7 +597,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let previewProfilesArray = cameraOutputCap.previewProfiles; @@ -847,44 +623,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100--------------"); - let camerasArray = mCameraDevicesArray; - for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); - console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); - if (!isEmpty(cameraOutputCap)) { - let photoProfilesArray = cameraOutputCap.photoProfiles; - if (isEmpty(photoProfilesArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 photoProfilesArray == null || undefined") - expect().assertFail(); - } else { - for (let j = 0; j < photoProfilesArray.length; j++) { - mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface, async (err, data) => { - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } - }) - await sleep(100); - } - } - - } - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 PASS"); - await sleep(1000); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api @@ -897,7 +635,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let photoProfilesArray = cameraOutputCap.photoProfiles; @@ -922,57 +660,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100--------------"); - let camerasArray = mCameraDevicesArray; - let createVideoOutputFlag; - for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); - console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); - if (!isEmpty(cameraOutputCap)) { - let videoProfilesArray = cameraOutputCap.videoProfiles; - if (isEmpty(videoProfilesArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoProfilesArray == null || undefined") - expect().assertFail(); - } else { - createVideoOutputFlag = false; - for (let j = 0; j < videoProfilesArray.length; j++) { - mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface, async (err, data) => { - if (!err) { - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data == null || undefined"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data = " + data); - createVideoOutputFlag = true; - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 failed, err = " + err.message); - expect().assertFail(); - } - - }) - await sleep(100); - - if (createVideoOutputFlag == true) { - break; - } - } - } - } - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 PASS"); - await sleep(1000); - done(); - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 @@ -986,7 +673,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let videoProfilesArray = cameraOutputCap.videoProfiles; @@ -1014,49 +701,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100--------------"); - let camerasArray = mCameraDevicesArray; - for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); - console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); - if (!isEmpty(cameraOutputCap)) { - let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; - if (!isEmpty(metadataObjectTypeArray)) { - mCameraManager.createMetadataOutput(metadataObjectTypeArray, async (err, data) => { - if (!err) { - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data = " + data) - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 err = " + err.message) - expect().assertFail(); - } - - }) - await sleep(100); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 metadataObjectTypeArray == null || undefined") - } - await sleep(300); - } - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 PASS"); - await sleep(1000); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api @@ -1069,7 +713,7 @@ describe('CameraManagerTest', function () { console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100--------------"); let camerasArray = mCameraDevicesArray; for (let i = 0; i < camerasArray.length; i++) { - let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); + let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); if (!isEmpty(cameraOutputCap)) { let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; @@ -1092,39 +736,6 @@ describe('CameraManagerTest', function () { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 - * @tc.name : Create CaptureSession instance api - * @tc.desc : Create CaptureSession instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100', 2, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate"); - let cameraSession; - mCameraManager.createCaptureSession(async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession success"); - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } else { - cameraSession = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message); - } - await sleep(300); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"); - }) - await sleep(1000); - await cameraSession.release(); - done(); - }) - /** * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 * @tc.name : Create CaptureSession instance promise api @@ -1145,40 +756,6 @@ describe('CameraManagerTest', function () { await captureSessionPromise.release(); done(); }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 2, async function (done) { - if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") - mCameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 data == null || undefined") - expect().assertFail(); - } - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - }) - } - await sleep(1000); - done(); - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_CAMERA_MUTED_0100 @@ -1206,5 +783,37 @@ describe('CameraManagerTest', function () { done(); }) + + /** + * @tc.number : SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 + * @tc.name : camera manager on cameraStatus api + * @tc.desc : camera manager on cameraStatus api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 1 + */ + it('SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100', 1, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100--------------"); + if (isEmpty(mCameraManager)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 mCameraManager == null || undefined") + expect().assertFail(); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 to operate"); + mCameraManager.on('cameraStatus', async (err, data) => { + if (!err) { + expect(true).assertTrue(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 success"); + } else { + expect().assertFail(); + console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + } + await sleep(1000); + done(); + }) + }) } \ No newline at end of file diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets index 7d7462dbdd097763f138c4c07a1a705a1a33e924..4e9e415503b40bbc433a47e4930f733f51d70061 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionBaseTest.test.ets @@ -223,15 +223,7 @@ export default function cameraSessionTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) - - await sleep(30); + mCameraSession.beginConfig(); console.info('Exit beginCameraSessionConfig'); @@ -289,19 +281,8 @@ export default function cameraSessionTest() { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } - - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); - - if (isEmpty(mCameraInput)) { - console.info(TAG + "createCameraInput FAILED"); - return false; - } + + mCameraInput = mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput.open(async (err) => { console.info(TAG + "Entering mCameraInput open callback"); @@ -326,7 +307,6 @@ export default function cameraSessionTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -337,15 +317,7 @@ export default function cameraSessionTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - mPhotoOutput = null; - }); + let cameraOutputCap = mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -422,7 +394,6 @@ export default function cameraSessionTest() { } if (!isEmpty(mVideoOutput)) { - //await mVideoOutput.stop(); await mVideoOutput.release(); } @@ -559,85 +530,7 @@ export default function cameraSessionTest() { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 - * @tc.name : Check capture session begin and commit config with callback or not - * @tc.desc : Check capture session begin and commit config with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - await createInput(0); - await createOutput(0); - - if (!isEmpty(mCameraInput)) { - console.info(TAG + "Start to addInput"); - try { - await mCameraSession.addInput(mCameraInput); - } - catch { - console.info(TAG + "addInput failed!"); - } - } - - if (!isEmpty(mPreviewOutput)) { - console.info(TAG + "Start to addOutput mPreviewOutput"); - try { - await mCameraSession.addOutput(mPreviewOutput); - } - catch { - console.info(TAG + "addOutput failed!"); - } - } - - await sleep(500); - - mCameraSession.commitConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - if (!isEmpty(mCameraInput)) { - console.info(TAG + "Start to removeInput"); - await mCameraSession.removeInput(mCameraInput); - } - - if (!isEmpty(mPreviewOutput)) { - console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutput); - } - - await releaseInput(); - await releaseOutput(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_PROMISE_0100 @@ -705,47 +598,7 @@ export default function cameraSessionTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 - * @tc.name : Check capture session begin config duplicated with callback or not - * @tc.desc : Check capture session begin config duplicated with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 PASSED : " + err.message); - } - }) - await sleep(500); - - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 PASSED : " + err.message); - } - }) - await sleep(500); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 @@ -765,13 +618,15 @@ export default function cameraSessionTest() { } else { try { - await mCameraSession.beginConfig(); - } catch { + mCameraSession.beginConfig(); + } catch(error) { + expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); } try { - await mCameraSession.beginConfig(); - } catch { + mCameraSession.beginConfig(); + } catch(error) { + expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); } @@ -782,47 +637,7 @@ export default function cameraSessionTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 - * @tc.name : Check capture session begin config duplicated with callback or not - * @tc.desc : Check capture session begin config duplicated with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - mCameraSession.commitConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 PASSED : " + err.message); - } - }) - await sleep(500); - - mCameraSession.commitConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 PASSED : " + err.message); - } - }) - await sleep(500); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 @@ -843,15 +658,16 @@ export default function cameraSessionTest() { else { try { await mCameraSession.commitConfig(); - } catch { + } catch(error) { + expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); } try { await mCameraSession.commitConfig(); - } catch { + } catch(error) { + expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 ends here"); @@ -859,93 +675,41 @@ export default function cameraSessionTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 - * @tc.name : Check capture session start/stop with callback or not - * @tc.desc : Check capture session start/stop with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (!isEmpty(mPreviewOutput)) { - mCameraSession.start(async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(2000); - - mCameraSession.stop(async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } - - await beginCameraSessionConfig(); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 ends here"); - done(); - } - }) + /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 - * @tc.name : Check capture session start/stop output with promise or not - * @tc.desc : Check capture session start/stop output with promise or not + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 + * @tc.name : Check capture session start/stop/release output with promise or not + * @tc.desc : Check capture session start/stop/release output with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100', 0, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100--------------"); if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 FAILED with NoCamera"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); if (!isEmpty(mPreviewOutput)) { await mCameraSession.start(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 start PASSED"); await sleep(2000); await mCameraSession.stop(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 stop PASSED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 stop PASSED"); + await sleep(500); + + await mCameraSession.release(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 release PASSED"); await sleep(500); } @@ -953,80 +717,15 @@ export default function cameraSessionTest() { await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 ends here"); done(); } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 - * @tc.name : Check capture session add/remove input with callback or not - * @tc.desc : Check capture session add/remove input with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 start for camera[" + i + "]"); - await createInput(i); - await createOutput(i); - - if (!isEmpty(mPreviewOutput) && !isEmpty(mPhotoOutput)) { - mCameraSession.addInput(mCameraInput, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await mCameraSession.addOutput(mPreviewOutput); - await mCameraSession.addOutput(mPhotoOutput); - await sleep(500); - - await commitCameraSessionConfig(); - await sleep(1); - await beginCameraSessionConfig(); - await sleep(1); - - mCameraSession.removeInput(mCameraInput, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await mCameraSession.removeOutput(mPreviewOutput); - await mCameraSession.removeOutput(mPhotoOutput); - await sleep(500); - } - - await releaseInput(); - await releaseOutput(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100 @@ -1079,69 +778,7 @@ export default function cameraSessionTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 - * @tc.name : Check capture session add/remove output with callback or not for preview - * @tc.desc : Check capture session add/remove output with callback or not for preview - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - await createInput(0); - await createOutput(0); - - if (!isEmpty(mPreviewOutput) && !isEmpty(mPhotoOutput)) { - mCameraSession.addOutput(mPreviewOutput, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 add callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 add PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 add FAILED : " + err.message); - expect().assertFail(); - } - }) - await mCameraSession.addOutput(mPhotoOutput); - await mCameraSession.addInput(mCameraInput); - await sleep(500); - - await commitCameraSessionConfig(); - await sleep(1); - await beginCameraSessionConfig(); - await sleep(1); - - mCameraSession.removeOutput(mPreviewOutput, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 remove callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 remove PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 remove FAILED : " + err.message); - expect().assertFail(); - } - }) - await mCameraSession.removeOutput(mPhotoOutput); - await mCameraSession.removeInput(mCameraInput); - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 FAILED"); - expect().assertFail(); - } - - await releaseInput(); - await releaseOutput(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 @@ -1195,77 +832,6 @@ export default function cameraSessionTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 - * @tc.name : Check capture session add/remove output with callback or not for photo - * @tc.desc : Check capture session add/remove output with callback or not for photo - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - await createInput(0); - await createOutput(0); - - if (!isEmpty(mPhotoOutput)) { - if (!isEmpty(mPreviewOutput)) { - console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutput); - } - mCameraSession.addOutput(mPhotoOutput, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 add callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 add PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 add FAILED : " + err.message); - expect().assertFail(); - } - }) - await mCameraSession.addInput(mCameraInput); - await sleep(500); - - await commitCameraSessionConfig(); - await sleep(1); - await beginCameraSessionConfig(); - await sleep(1); - - await sleep(500); - - if (!isEmpty(mPreviewOutput)) { - console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutput); - } - mCameraSession.removeOutput(mPhotoOutput, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 remove callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 remove PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 remove FAILED : " + err.message); - expect().assertFail(); - } - }) - await mCameraSession.removeInput(mCameraInput); - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 FAILED"); - expect().assertFail(); - } - - await releaseInput(); - await releaseOutput(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 @@ -1325,78 +891,7 @@ export default function cameraSessionTest() { } }) - /** - * @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 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - await createInput(0); - await createOutput(0); - - if (!isEmpty(mVideoOutput)) { - - 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(); - } - }) - if (!isEmpty(mPreviewOutput)) { - console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutput); - } - await mCameraSession.addInput(mCameraInput); - 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 sleep(100); - if (!isEmpty(mPreviewOutput)) { - console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutput); - } - await mCameraSession.removeInput(mCameraInput); - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 FAILED"); - } - - await releaseInput(); - await releaseOutput(); - - 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 @@ -1456,174 +951,9 @@ export default function cameraSessionTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CaptureSession async api for focusStateChange - * @tc.desc : camera status callback on CaptureSession async api for focusStateChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - let nfyFlag = false; - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (!isEmpty(mPreviewOutput)) { - let focusModeSupportedFlag = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (focusModeSupportedFlag == false) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera[" + i + "], for FOCUS_MODE_AUTO"); - await beginCameraSessionConfig(); - await stopCameraSession(); - continue; - } - - focusModeSupportedFlag = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (focusModeSupportedFlag == false) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 skip camera[" + i + "], for FOCUS_MODE_CONTINUOUS_AUTO"); - await beginCameraSessionConfig(); - await stopCameraSession(); - continue; - } - - mCameraSession.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 callback"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 PASSED: " + data); - nfyFlag = true; - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - }) - - await mCameraSession.start(); - - await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO); - await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - - await sleep(100); - - if (nfyFlag == false) { - //expect().assertFail(); - //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED without any nofity!"); - } - - await mCameraSession.stop(); - } - - await beginCameraSessionConfig(); - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 ends here"); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 - * @tc.name : camera status callback on CaptureSession async api for error - * @tc.desc : camera status callback on CaptureSession async api for error - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - let nfyFlag = false; - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (!isEmpty(mPreviewOutput)) { - mCameraSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 callback"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 PASSED: " + data); - nfyFlag = true; - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED: " + err.message); - } - await sleep(1); - }) - - await mCameraSession.start(); - - await sleep(400); - - if (nfyFlag == false) { - //expect().assertFail(); - //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!"); - } - - await mCameraSession.stop(); - } - await beginCameraSessionConfig(); - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 ends here"); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100 - * @tc.name : Check capture session release with callback or not for preview - * @tc.desc : Check capture session release with callback or not for preview - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100--------------"); - await mCameraSession.release(async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await createCameraSessionInstance(); - await sleep(500); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_CALLBACK_0100 ends here"); - done(); - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_RELEASE_PROMISE_0100 diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets index c23c07678fa133a1f55e5e24db9a29bbda1e7991..3c78f74edcef7001aecb96d5cbd03c796e3e4dbf 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionExposureTest.test.ets @@ -283,13 +283,7 @@ export default function cameraSessionExposureTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) + mCameraSession.beginConfig(); await sleep(30); @@ -349,14 +343,8 @@ export default function cameraSessionExposureTest() { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } - - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); + + mCameraInput = mCameraManager.createCameraInput(mCameraDevicesArray[idx]); if (isEmpty(mCameraInput)) { console.info(TAG + "createCameraInput FAILED"); @@ -386,7 +374,6 @@ export default function cameraSessionExposureTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -397,15 +384,7 @@ export default function cameraSessionExposureTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - mPhotoOutput = null; - }); + let cameraOutputCap = mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -616,55 +595,7 @@ export default function cameraSessionExposureTest() { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 - * @tc.name : Check capture session support exposure locked mode with callback or not - * @tc.desc : Check capture session support exposure locked mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsExposureModeSupportedArray[i] = false; - - mCameraSession.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsExposureModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 PASSED with isExposureModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 FAILED with isExposureModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0100 @@ -708,67 +639,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 - * @tc.name : Check capture session set exposure locked mode with callback - * @tc.desc : Check capture session set exposure locked mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsExposureModeSupportedArray[i] == true) { - mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getExposureMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 callback"); - if (!err) { - if (data == cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 PASSED with ExposureMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 FAILED with ExposureMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100 @@ -820,55 +691,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 - * @tc.name : Check capture session support exposure auto mode with callback or not - * @tc.desc : Check capture session support exposure auto mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsExposureModeSupportedArray[i] = false; - - mCameraSession.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsExposureModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 PASSED with isExposureModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 FAILED with isExposureModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 @@ -912,67 +735,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 - * @tc.name : Check capture session set exposure auto mode with callback - * @tc.desc : Check capture session set exposure auto mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsExposureModeSupportedArray[i] == true) { - mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 callback"); - if (!err) { - if (data == cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 PASSED with ExposureMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED with ExposureMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 @@ -1024,55 +787,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 - * @tc.name : Check capture session support exposure continuous auto mode with callback or not - * @tc.desc : Check capture session support exposure continuous auto mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsExposureModeSupportedArray[i] = false; - - mCameraSession.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsExposureModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 PASSED with isExposureModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 FAILED with isExposureModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102 @@ -1116,67 +831,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 - * @tc.name : Check capture session set exposure continuous auto mode with callback - * @tc.desc : Check capture session set exposure continuous auto mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsExposureModeSupportedArray[i] == true) { - mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 callback"); - if (!err) { - if (data == cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 PASSED with ExposureMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED with ExposureMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 @@ -1228,63 +883,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 - * @tc.name : Check capture session set METERING point with callback - * @tc.desc : Check capture session set METERING point with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPoint, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 PASSED with METERINGPoint is: " + mMETERINGPoint.x + ", " + mMETERINGPoint.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 callback"); - if (!err) { - if ((data.x == mMETERINGPoint.x) && (data.y == mMETERINGPoint.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0100 @@ -1332,88 +931,32 @@ export default function cameraSessionExposureTest() { } }) + + /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 - * @tc.name : Check capture session set METERING point with callback(left-top point) - * @tc.desc : Check capture session set METERING point with callback(left-top point) + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 + * @tc.name : Check capture session set METERING point with promise(left-top point) + * @tc.desc : Check capture session set METERING point with promise(left-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101--------------"); if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED with NoCamera"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 start for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); - mCameraSession.setMeteringPoint(mMETERINGPointLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 callback"); - if (!err) { - if ((data.x == mMETERINGPointLT.x) && (data.y == mMETERINGPointLT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 ends here"); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 - * @tc.name : Check capture session set METERING point with promise(left-top point) - * @tc.desc : Check capture session set METERING point with promise(left-top point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - await mCameraSession.setMeteringPoint(mMETERINGPointLT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); + await mCameraSession.setMeteringPoint(mMETERINGPointLT); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); @@ -1436,63 +979,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 - * @tc.name : Check capture session set METERING point with callback(right-top point) - * @tc.desc : Check capture session set METERING point with callback(right-top point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 PASSED with METERINGPoint is: " + mMETERINGPointRT.x + ", " + mMETERINGPointRT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 callback"); - if (!err) { - if ((data.x == mMETERINGPointRT.x) && (data.y == mMETERINGPointRT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 @@ -1540,63 +1027,6 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 - * @tc.name : Check capture session set METERING point with callback(left-bottom point) - * @tc.desc : Check capture session set METERING point with callback(left-bottom point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 PASSED with METERINGPoint is: " + mMETERINGPointLB.x + ", " + mMETERINGPointRB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 callback"); - if (!err) { - if ((data.x == mMETERINGPointLB.x) && (data.y == mMETERINGPointLB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 @@ -1644,63 +1074,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 - * @tc.name : Check capture session set METERING point with callback(right-bottom point) - * @tc.desc : Check capture session set METERING point with callback(right-bottom point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 PASSED with METERINGPoint is: " + mMETERINGPointRB.x + ", " + mMETERINGPointRB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 callback"); - if (!err) { - if ((data.x == mMETERINGPointRB.x) && (data.y == mMETERINGPointRB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 @@ -1749,63 +1123,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 - * @tc.name : Check capture session set METERING point with callback(left-top invalid point) - * @tc.desc : Check capture session set METERING point with callback(left-top invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointInvalidLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLT.x + ", " + mMETERINGPointInvalidLT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 callback"); - if (!err) { - if (((data.x != mMETERINGPointInvalidLT.x) && (data.y != mMETERINGPointInvalidLT.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 @@ -1853,63 +1171,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 - * @tc.name : Check capture session set METERING point with callback(right-top invalid point) - * @tc.desc : Check capture session set METERING point with callback(right-top invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointInvalidRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRT.x + ", " + mMETERINGPointInvalidRT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 callback"); - if (!err) { - if (((data.x != mMETERINGPointInvalidRT.x) && (data.y != mMETERINGPointInvalidRT.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 @@ -1957,63 +1219,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 - * @tc.name : Check capture session set METERING point with callback(left-bottom invalid point) - * @tc.desc : Check capture session set METERING point with callback(left-bottom invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointInvalidLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLB.x + ", " + mMETERINGPointInvalidRB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 callback"); - if (!err) { - if (((data.x != mMETERINGPointInvalidLB.x) && (data.y != mMETERINGPointInvalidLB.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 @@ -2061,63 +1267,6 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 - * @tc.name : Check capture session set METERING point with callback(right-bottom invalid point) - * @tc.desc : Check capture session set METERING point with callback(right-bottom invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setMeteringPoint(mMETERINGPointInvalidRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRB.x + ", " + mMETERINGPointInvalidRB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 callback"); - if (!err) { - if (((data.x != mMETERINGPointInvalidRB.x) && (data.y != mMETERINGPointInvalidRB.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 PASSED with METERINGPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED with METERINGPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 @@ -2165,66 +1314,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 - * @tc.name : Check capture session get exposure bias range with callback - * @tc.desc : Check capture session get exposure bias range with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.getExposureBiasRange(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 callback"); - if (!err) { - if (data.length > 0) { - mExposureBiasRangeArray[i] = data; - console.info(TAG + i + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 PASSED with ExposureBiasRange length is: " + data.length); - for (let j = 0; j < mExposureBiasRangeArray[i].length; j++) { - console.info(TAG + j + "th, exposure bias is: " + data[j] + ", " + mExposureBiasRangeArray[i][j]); - - if ((mExposureBiasMaxArray[i] == undefined) || (mExposureBiasMaxArray[i] < mExposureBiasRangeArray[i][j])) { - mExposureBiasMaxArray[i] = mExposureBiasRangeArray[i][j] - } - - if ((mExposureBiasMinArray[i] == undefined) || (mExposureBiasMinArray[i] > mExposureBiasRangeArray[i][j])) { - mExposureBiasMinArray[i] = mExposureBiasRangeArray[i][j] - } - } - - console.info(TAG + "Exposure bias max is: " + mExposureBiasMaxArray[i] + ", min is: " + mExposureBiasMinArray[i]); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 FAILED with ExposureBiasRange length is: " + data.length); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_PROMISE_0100 @@ -2272,63 +1362,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 - * @tc.name : Check capture session set exposure bias with callback - * @tc.desc : Check capture session set exposure bias with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setExposureBias(mExposureBiasRangeArray[i][0], async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 PASSED with ExposureBias is: " + mExposureBiasRangeArray[i][0]); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 callback"); - if (!err) { - if (data == mExposureBiasRangeArray[i][0]) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 PASSED with ExposureValue is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 FAILED with ExposureValue is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100 @@ -2376,63 +1410,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 - * @tc.name : Check capture session set exposure bias with callback(invalid value, min - 1) - * @tc.desc : Check capture session set exposure bias with callback(invalid value, min - 1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setExposureBias(mExposureBiasMinArray[i] - 1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 callback"); - if (!err) { - if (data != (mExposureBiasMinArray[i] - 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 PASSED with ExposureValue is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED with ExposureValue is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 @@ -2480,63 +1458,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 - * @tc.name : Check capture session set exposure bias with callback(invalid value, min - 0.1) - * @tc.desc : Check capture session set exposure bias with callback(invalid value, min - 0.1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setExposureBias(mExposureBiasMinArray[i] - 0.1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 0.1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 callback"); - if (!err) { - if (data != (mExposureBiasMinArray[i] - 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 PASSED with ExposureValue is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED with ExposureValue is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 @@ -2584,63 +1506,7 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 - * @tc.name : Check capture session set exposure bias with callback(invalid value, max + 1) - * @tc.desc : Check capture session set exposure bias with callback(invalid value, max + 1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setExposureBias(mExposureBiasMaxArray[i] + 1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 callback"); - if (!err) { - if (data != (mExposureBiasMaxArray[i] + 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 PASSED with ExposureValue is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED with ExposureValue is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 @@ -2688,63 +1554,6 @@ export default function cameraSessionExposureTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 - * @tc.name : Check capture session set exposure bias with callback(invalid value, max + 0.1) - * @tc.desc : Check capture session set exposure bias with callback(invalid value, max + 0.1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setExposureBias(mExposureBiasMaxArray[i] + 0.1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 0.1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 callback"); - if (!err) { - if (data != (mExposureBiasMaxArray[i] + 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 PASSED with ExposureValue is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED with ExposureValue is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets index 84c14cebf8ecebf96a3dd3e5661e9a73753429db..fbafdcaf9d094d73c196da6e9c86cc1d38bcbf20 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFlashTest.test.ets @@ -234,13 +234,7 @@ export default function cameraSessionFlashTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) + mCameraSession.beginConfig(); await sleep(30); @@ -301,13 +295,7 @@ export default function cameraSessionFlashTest() { return false; } - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); + mCameraInput = mCameraManager.createCameraInput(mCameraDevicesArray[idx]); if (isEmpty(mCameraInput)) { console.info(TAG + "createCameraInput FAILED"); @@ -337,7 +325,6 @@ export default function cameraSessionFlashTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -348,15 +335,7 @@ export default function cameraSessionFlashTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - mPhotoOutput = null; - }); + let cameraOutputCap = mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -567,55 +546,7 @@ export default function cameraSessionFlashTest() { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 - * @tc.name : Check capture session has flash with callback or not - * @tc.desc : Check capture session has flash with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } - else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - mHasFlashArray[i] = false; - - mCameraSession.hasFlash(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 callback"); - if (!err) { - if (data != null || data != undefined) { - mHasFlashArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 PASSED with hasFlash is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 FAILED with hasFlash is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 @@ -659,59 +590,6 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 - * @tc.name : Check capture session support flash close mode with callback or not - * @tc.desc : Check capture session support flash close mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFlashModeSupportedArray[i] = false; - - if (mHasFlashArray[i] == true) { - mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 PASSED with isFlashModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 FAILED with isFlashModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 @@ -760,67 +638,7 @@ export default function cameraSessionFlashTest() { }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 - * @tc.name : Check capture session set flash close mode with callback - * @tc.desc : Check capture session set flash close mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { - mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 callback"); - if (!err) { - if (data == cameraObj.FlashMode.FLASH_MODE_CLOSE) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 PASSED with FlaseMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 FAILED with FlaseMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 @@ -872,59 +690,7 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 - * @tc.name : Check capture session support flash open mode with callback or not - * @tc.desc : Check capture session support flash open mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFlashModeSupportedArray[i] = false; - - if (mHasFlashArray[i] == true) { - mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 PASSED with isFlashModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 FAILED with isFlashModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 @@ -972,67 +738,7 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 - * @tc.name : Check capture session set flash open mode with callback - * @tc.desc : Check capture session set flash open mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { - mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 callback"); - if (!err) { - if (data == cameraObj.FlashMode.FLASH_MODE_OPEN) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 PASSED with FlaseMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED with FlaseMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 @@ -1084,59 +790,7 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 - * @tc.name : Check capture session support flash auto mode with callback or not - * @tc.desc : Check capture session support flash auto mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFlashModeSupportedArray[i] = false; - - if (mHasFlashArray[i] == true) { - mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 PASSED with isFlashModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 FAILED with isFlashModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 @@ -1184,67 +838,7 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 - * @tc.name : Check capture session set flash auto mode with callback - * @tc.desc : Check capture session set flash auto mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { - mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 callback"); - if (!err) { - if (data == cameraObj.FlashMode.FLASH_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 PASSED with FlaseMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED with FlaseMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 @@ -1296,59 +890,6 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 - * @tc.name : Check capture session support flash always open mode with callback or not - * @tc.desc : Check capture session support flash always open mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFlashModeSupportedArray[i] = false; - - if (mHasFlashArray[i] == true) { - mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 PASSED with isFlashModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 FAILED with isFlashModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 @@ -1396,67 +937,7 @@ export default function cameraSessionFlashTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 - * @tc.name : Check capture session set flash always open mode with callback - * @tc.desc : Check capture session set flash always open mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { - mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 callback"); - if (!err) { - if (data == cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 PASSED with FlaseMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED with FlaseMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets index 2accf72e34f13c28b0cd5895f30ecb5e50670425..a9760665307e475943c6c2358281babb53e710a2 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionFocusTest.test.ets @@ -279,13 +279,7 @@ export default function cameraSessionFocusTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) + mCameraSession.beginConfig(); await sleep(30); @@ -345,15 +339,9 @@ export default function cameraSessionFocusTest() { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } - - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); - + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { console.info(TAG + "createCameraInput FAILED"); return false; @@ -382,7 +370,6 @@ export default function cameraSessionFocusTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -393,15 +380,7 @@ export default function cameraSessionFocusTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - mPhotoOutput = null; - }); + let cameraOutputCap = mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -612,55 +591,7 @@ export default function cameraSessionFocusTest() { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 - * @tc.name : Check capture session support focus manual mode with callback or not - * @tc.desc : Check capture session support focus manual mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFocusModeSupportedArray[i] = false; - - mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 PASSED with isFocusModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 FAILED with isFocusModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0100 @@ -704,67 +635,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 - * @tc.name : Check capture session set focus manual mode with callback - * @tc.desc : Check capture session set focus manual mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsFocusModeSupportedArray[i] == true) { - mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 callback"); - if (!err) { - if (data == cameraObj.FocusMode.FOCUS_MODE_MANUAL) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 PASSED with FocusMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 FAILED with FocusMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100 @@ -816,55 +687,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 - * @tc.name : Check capture session support focus continuous auto mode with callback or not - * @tc.desc : Check capture session support focus continuous auto mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFocusModeSupportedArray[i] = false; - - mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 PASSED with isFocusModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 FAILED with isFocusModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 @@ -908,67 +731,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 - * @tc.name : Check capture session set focus continuous auto mode with callback - * @tc.desc : Check capture session set focus continuous auto mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsFocusModeSupportedArray[i] == true) { - mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 callback"); - if (!err) { - if (data == cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 PASSED with FocusMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED with FocusMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 @@ -1020,55 +783,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 - * @tc.name : Check capture session support focus auto mode with callback or not - * @tc.desc : Check capture session support focus auto mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFocusModeSupportedArray[i] = false; - - mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 PASSED with isFocusModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 FAILED with isFocusModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 @@ -1112,67 +827,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 - * @tc.name : Check capture session set focus auto mode with callback - * @tc.desc : Check capture session set focus auto mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsFocusModeSupportedArray[i] == true) { - mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 callback"); - if (!err) { - if (data == cameraObj.FocusMode.FOCUS_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 PASSED with FocusMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED with FocusMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 @@ -1224,55 +879,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 - * @tc.name : Check capture session support focus locked mode with callback or not - * @tc.desc : Check capture session support focus locked mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsFocusModeSupportedArray[i] = false; - - mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 PASSED with isFocusModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 FAILED with isFocusModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 @@ -1316,106 +923,46 @@ export default function cameraSessionFocusTest() { } }) + + /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 - * @tc.name : Check capture session set focus locked mode with callback - * @tc.desc : Check capture session set focus locked mode with callback + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 + * @tc.name : Check capture session set focus locked mode with promise + * @tc.desc : Check capture session set focus locked mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103--------------"); if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED with NoCamera"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 start for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { - mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) + await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); await sleep(500); - mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 callback"); - if (!err) { - if (data == cameraObj.FocusMode.FOCUS_MODE_LOCKED) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 PASSED with FocusMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED with FocusMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); + let focusMode = await mCameraSession.getFocusMode(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 finish"); + if (focusMode == cameraObj.FocusMode.FOCUS_MODE_LOCKED) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 PASSED with FocusMode is: " + focusMode); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with FocusMode is: " + focusMode); + expect().assertFail(); + } + await sleep(100); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 not support"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 ends here"); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 - * @tc.name : Check capture session set focus locked mode with promise - * @tc.desc : Check capture session set focus locked mode with promise - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsFocusModeSupportedArray[i] == true) { - await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - await sleep(500); - - let focusMode = await mCameraSession.getFocusMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 finish"); - if (focusMode == cameraObj.FocusMode.FOCUS_MODE_LOCKED) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 PASSED with FocusMode is: " + focusMode); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with FocusMode is: " + focusMode); - expect().assertFail(); - } - await sleep(100); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 not support"); } await stopCameraSession(); @@ -1428,63 +975,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : Check capture session set focus point with callback - * @tc.desc : Check capture session set focus point with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPoint, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 PASSED with FocusPoint is: " + mFocusPoint.x + ", " + mFocusPoint.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 callback"); - if (!err) { - if ((data.x == mFocusPoint.x) && (data.y == mFocusPoint.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0100 @@ -1532,63 +1023,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 - * @tc.name : Check capture session set focus point with callback(left-top point) - * @tc.desc : Check capture session set focus point with callback(left-top point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 PASSED with FocusPoint is: " + mFocusPointLT.x + ", " + mFocusPointLT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 callback"); - if (!err) { - if ((data.x == mFocusPointLT.x) && (data.y == mFocusPointLT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 @@ -1636,63 +1071,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 - * @tc.name : Check capture session set focus point with callback(right-top point) - * @tc.desc : Check capture session set focus point with callback(right-top point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 PASSED with FocusPoint is: " + mFocusPointRT.x + ", " + mFocusPointRT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 callback"); - if (!err) { - if ((data.x == mFocusPointRT.x) && (data.y == mFocusPointRT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 @@ -1740,63 +1119,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 - * @tc.name : Check capture session set focus point with callback(left-bottom point) - * @tc.desc : Check capture session set focus point with callback(left-bottom point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 PASSED with FocusPoint is: " + mFocusPointLB.x + ", " + mFocusPointLB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 callback"); - if (!err) { - if ((data.x == mFocusPointLB.x) && (data.y == mFocusPointLB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 @@ -1844,63 +1167,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 - * @tc.name : Check capture session set focus point with callback(right-bottom point) - * @tc.desc : Check capture session set focus point with callback(right-bottom point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 PASSED with FocusPoint is: " + mFocusPointRB.x + ", " + mFocusPointRB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 callback"); - if (!err) { - if ((data.x == mFocusPointRB.x) && (data.y == mFocusPointRB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 @@ -1948,63 +1215,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 - * @tc.name : Check capture session set focus point with callback(left-top invalid point) - * @tc.desc : Check capture session set focus point with callback(left-top invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointInvalidLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 PASSED with FocusPoint is: " + mFocusPointInvalidLT.x + ", " + mFocusPointInvalidLT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 callback"); - if (!err) { - if (((data.x != mFocusPointInvalidLT.x) && (data.y != mFocusPointInvalidLT.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 @@ -2052,63 +1263,6 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 - * @tc.name : Check capture session set focus point with callback(right-top invalid point) - * @tc.desc : Check capture session set focus point with callback(right-top invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointInvalidRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 PASSED with FocusPoint is: " + mFocusPointInvalidRT.x + ", " + mFocusPointInvalidRT.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 callback"); - if (!err) { - if (((data.x != mFocusPointInvalidRT.x) && (data.y != mFocusPointInvalidRT.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 @@ -2156,63 +1310,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 - * @tc.name : Check capture session set focus point with callback(left-bottom invalid point) - * @tc.desc : Check capture session set focus point with callback(left-bottom invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointInvalidLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 PASSED with FocusPoint is: " + mFocusPointInvalidLB.x + ", " + mFocusPointInvalidLB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 callback"); - if (!err) { - if (((data.x != mFocusPointInvalidLB.x) && (data.y != mFocusPointInvalidLB.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 @@ -2260,63 +1358,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 - * @tc.name : Check capture session set focus point with callback(right-bottom invalid point) - * @tc.desc : Check capture session set focus point with callback(right-bottom invalid point) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.setFocusPoint(mFocusPointInvalidRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 PASSED with FocusPoint is: " + mFocusPointInvalidRB.x + ", " + mFocusPointInvalidRB.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 callback"); - if (!err) { - if (((data.x != mFocusPointInvalidRB.x) && (data.y != mFocusPointInvalidRB.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 PASSED with FocusPoint is: " + data.x + ", " + data.y); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED with FocusPoint is: " + data.x + ", " + data.y); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 @@ -2364,47 +1406,7 @@ export default function cameraSessionFocusTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 - * @tc.name : Check capture session get focal length with callback - * @tc.desc : Check capture session get focal length with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.getFocalLength(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 PASSED with FocalLength is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 @@ -2441,7 +1443,71 @@ export default function cameraSessionFocusTest() { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); done(); } - }) + }) + + + /** + * @tc.number : SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 + * @tc.name : camera session focusstatechange api + * @tc.desc : camera session focusstatechange api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 1 + */ + it('SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100', 1, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100--------------"); + if (isEmpty(mCameraSession)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 mCameraSession == null || undefined") + expect().assertFail(); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 to operate"); + mCameraSession.on('focusStateChange', async (err, data) => { + if (!err) { + expect(true).assertTrue(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 success"); + } else { + expect().assertFail(); + console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + } + await sleep(1000); + done(); + }) + + + /** + * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 + * @tc.name : camera session callback on error + * @tc.desc : camera session callback on error + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 1 + */ + it('SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100', 1, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100--------------"); + if (isEmpty(mCameraSession)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 previewOutput == null || undefined") + expect().assertFail(); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 to operate"); + mCameraSession.on('error', async (err, data) => { + if (!err) { + expect(true).assertTrue(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 success"); + } else { + expect().assertFail(); + console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + } + await sleep(1000); + done(); + }) }) } \ No newline at end of file diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets index 89b9c06831e393572cbacb7c88207a406cfa1b3f..34b2bc2037bb96304b00f0bba0250dfb68f405a3 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionVideoStabilizationTest.test.ets @@ -232,13 +232,7 @@ export default function cameraSessionVideoStabilizationTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) + mCameraSession.beginConfig(); await sleep(30); @@ -299,13 +293,7 @@ export default function cameraSessionVideoStabilizationTest() { return false; } - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); if (isEmpty(mCameraInput)) { console.info(TAG + "createCameraInput FAILED"); @@ -335,7 +323,6 @@ export default function cameraSessionVideoStabilizationTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -346,15 +333,7 @@ export default function cameraSessionVideoStabilizationTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - mPhotoOutput = null; - }); + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -386,7 +365,7 @@ export default function cameraSessionVideoStabilizationTest() { if (isEmpty(mPhotoOutput)) { console.info(TAG + "createPhotoOutput FAILED"); } - + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); } /* @@ -565,55 +544,7 @@ export default function cameraSessionVideoStabilizationTest() { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 - * @tc.name : Check capture session support video stabilization off mode with callback or not - * @tc.desc : Check capture session support video stabilization off mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUmCameraNumPPORT_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsVideoStabilizationModeSupportedArray[i] = false; - - mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsVideoStabilizationModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 PASSED with isVideoStabilizationModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 FAILED with isVideoStabilizationModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 @@ -657,67 +588,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 - * @tc.name : Check capture session set video stabilization off mode with callback - * @tc.desc : Check capture session set video stabilization off mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsVideoStabilizationModeSupportedArray[i] == true) { - mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.OFF, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.OFF); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 callback"); - if (!err) { - if (data == cameraObj.VideoStabilizationMode.OFF) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 PASSED with VideoStabilizationMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 FAILED with VideoStabilizationMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 PASSED"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 @@ -769,56 +640,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 - * @tc.name : Check capture session support video stabilization low mode with callback or not - * @tc.desc : Check capture session support video stabilization low mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsVideoStabilizationModeSupportedArray[i] = false; - - mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsVideoStabilizationModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 PASSED with isVideoStabilizationModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with isVideoStabilizationModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 ends here"); - done(); - } - }) - + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 * @tc.name : Check capture session support video stabilization low mode with promise or not @@ -861,67 +683,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 - * @tc.name : Check capture session set video stabilization low mode with callback - * @tc.desc : Check capture session set video stabilization low mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsVideoStabilizationModeSupportedArray[i] == true) { - mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.LOW); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 callback"); - if (!err) { - if (data == cameraObj.VideoStabilizationMode.LOW) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 PASSED with VideoStabilizationMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 FAILED with VideoStabilizationMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 PASSED"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 @@ -973,55 +735,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 - * @tc.name : Check capture session support video stabilization middle mode with callback or not - * @tc.desc : Check capture session support video stabilization middle mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsVideoStabilizationModeSupportedArray[i] = false; - - mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsVideoStabilizationModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 PASSED with isVideoStabilizationModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with isVideoStabilizationModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 @@ -1065,67 +779,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 - * @tc.name : Check capture session set video stabilization middle mode with callback - * @tc.desc : Check capture session set video stabilization middle mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsVideoStabilizationModeSupportedArray[i] == true) { - mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.MIDDLE); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 callback"); - if (!err) { - if (data == cameraObj.VideoStabilizationMode.MIDDLE) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 PASSED with VideoStabilizationMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED with VideoStabilizationMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 PASSED"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 @@ -1177,55 +831,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 - * @tc.name : Check capture session support video stabilization high mode with callback or not - * @tc.desc : Check capture session support video stabilization high mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsVideoStabilizationModeSupportedArray[i] = false; - - mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsVideoStabilizationModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 PASSED with isVideoStabilizationModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with isVideoStabilizationModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 @@ -1269,67 +875,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 - * @tc.name : Check capture session set video stabilization high mode with callback - * @tc.desc : Check capture session set video stabilization high mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsVideoStabilizationModeSupportedArray[i] == true) { - mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.HIGH); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 callback"); - if (!err) { - if (data == cameraObj.VideoStabilizationMode.HIGH) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 PASSED with VideoStabilizationMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED with VideoStabilizationMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 PASSED"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 @@ -1381,55 +927,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 - * @tc.name : Check capture session support video stabilization auto mode with callback or not - * @tc.desc : Check capture session support video stabilization auto mode with callback or not - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 start for camera[" + i + "]"); - - await startCameraSession(i); - - mIsVideoStabilizationModeSupportedArray[i] = false; - - mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 callback"); - if (!err) { - if (data != null || data != undefined) { - mIsVideoStabilizationModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 PASSED with isVideoStabilizationModeSupported is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with isVideoStabilizationModeSupported is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 @@ -1473,68 +971,7 @@ export default function cameraSessionVideoStabilizationTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 - * @tc.name : Check capture session set video stabilization auto mode with callback - * @tc.desc : Check capture session set video stabilization auto mode with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 start for camera[" + i + "]"); - - await startCameraSession(i); - - if (mIsVideoStabilizationModeSupportedArray[i] == true) { - mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.AUTO); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 callback"); - if (!err) { - if (data == cameraObj.VideoStabilizationMode.AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 PASSED with VideoStabilizationMode is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED with VideoStabilizationMode is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 PASSED"); - } - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 ends here"); - done(); - } - }) - + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 * @tc.name : Check capture session set video stabilization auto mode with promise diff --git a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets index e46bd9f52ae6df26ab1db8ee1fe34bc0e7bc5dfe..e2ec5aaf30e22c137b638073f18a215456848ece 100644 --- a/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets +++ b/multimedia/camera/camera_js_standard/entry/src/main/ets/test/CameraSessionZoomRatioTest.test.ets @@ -236,13 +236,7 @@ export default function cameraSessionZoomRatioTest() { async function beginCameraSessionConfig() { console.info('Enter beginCameraSessionConfig'); - mCameraSession.beginConfig(async (err) => { - if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); - } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); - } - }) + mCameraSession.beginConfig(); await sleep(30); @@ -284,7 +278,7 @@ export default function cameraSessionZoomRatioTest() { return false; } - await beginCameraSessionConfig(); + // await beginCameraSessionConfig(); console.info('Exit createCameraSessionInstance'); @@ -303,13 +297,7 @@ export default function cameraSessionZoomRatioTest() { return false; } - mCameraInput = null; - await mCameraManager.createCameraInput(mCameraDevicesArray[idx]).then((result) => { - console.info('createCameraInput success'); - mCameraInput = result; - }).catch((err) => { - console.info('createCameraInput failed, err = ' + err.message); - }); + mCameraInput = mCameraManager.createCameraInput(mCameraDevicesArray[idx]); if (isEmpty(mCameraInput)) { console.info(TAG + "createCameraInput FAILED"); @@ -339,7 +327,6 @@ export default function cameraSessionZoomRatioTest() { if (!isEmpty(mCameraInput)) { await mCameraInput.close(); - await mCameraInput.release(); } console.info('Exit releaseInput'); @@ -350,15 +337,7 @@ export default function cameraSessionZoomRatioTest() { async function createOutput(idx:any) { console.info('Enter createOutput'); - 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); - mPreviewOutput = null; - mPhotoOutput = null; - }); + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap.previewProfiles)) { @@ -450,6 +429,11 @@ export default function cameraSessionZoomRatioTest() { await createInput(idx); await createOutput(idx); + await beginCameraSessionConfig(); + + console.info(TAG + "Start to addInput"); + + await sleep(1); if (!isEmpty(mCameraInput)) { @@ -475,7 +459,12 @@ export default function cameraSessionZoomRatioTest() { await sleep(1); await commitCameraSessionConfig(); - await beginCameraSessionConfig(); + + console.info(TAG + "Entering startCameraSession start session begin"); + + await mCameraSession.start(); + + console.info(TAG + "Entering startCameraSession start session end"); /* await mCameraSession.start(async (err) => { @@ -569,65 +558,7 @@ export default function cameraSessionZoomRatioTest() { console.info('afterAll case'); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 - * @tc.name : Check capture session get zoom ratio range with callback - * @tc.desc : Check capture session get zoom ratio range with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 start for camera[" + i + "]"); - - await startCameraSession(i); - - mCameraSession.getZoomRatioRange(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 callback"); - if (!err) { - if (data.length > 0) { - mZoomRatioRangeArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED with ZoomRatioRange length is: " + data.length); - for (let j = 0; j < mZoomRatioRangeArray[i].length; j++) { - console.info(TAG + j + "th, zoom ratio is: " + data[j] + ", " + mZoomRatioRangeArray[i][j]); - - if ((mZoomRatioMaxArray[i] == undefined) || (mZoomRatioMaxArray[i] < mZoomRatioRangeArray[i][j])) { - mZoomRatioMaxArray[i] = mZoomRatioRangeArray[i][j] - } - - if ((mZoomRatioMinArray[i] == undefined) || (mZoomRatioMinArray[i] > mZoomRatioRangeArray[i][j])) { - mZoomRatioMinArray[i] = mZoomRatioRangeArray[i][j] - } - } - - console.info(TAG + "Zoom ratio max is: " + mZoomRatioMaxArray[i] + ", min is: " + mZoomRatioMinArray[i]); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 FAILED with ZoomRatioRange length is: " + data.length); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED : " + err.message); - } - }) - await sleep(100); - - await stopCameraSession(); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 @@ -680,65 +611,7 @@ export default function cameraSessionZoomRatioTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 - * @tc.name : Check capture session zoom ratio with callback - * @tc.desc : Check capture session zoom ratio with callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 start for camera[" + i + "]"); - - if (!isEmpty(mZoomRatioRangeArray[i])) { - await startCameraSession(i); - - mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0], async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 callback"); - if (!err) { - if (data == mZoomRatioRangeArray[i][0]) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 PASSED with ZoomRatioRange is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED with ZoomRatioRange is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 @@ -788,66 +661,7 @@ export default function cameraSessionZoomRatioTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 - * @tc.name : Check capture session zoom ratio with callback(invalid value, max + 1) - * @tc.desc : Check capture session zoom ratio with callback(invalid value, max + 1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 start for camera[" + i + "]"); - - if (!isEmpty(mZoomRatioRangeArray[i])) { - await startCameraSession(i); - - mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 callback"); - if (!err) { - if (data != (mZoomRatioMaxArray[i] + 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 PASSED with ZoomRatio is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED with ZoomRatio is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 ends here"); - done(); - } - }) - + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 * @tc.name : Check capture session set zoom ratio with promise(invalid value, max + 1) @@ -896,65 +710,7 @@ export default function cameraSessionZoomRatioTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 - * @tc.name : Check capture session zoom ratio with callback(invalid value, max + 0.1) - * @tc.desc : Check capture session zoom ratio with callback(invalid value, max + 0.1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102--------------"); - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 start for camera[" + i + "]"); - - if (!isEmpty(mZoomRatioRangeArray[i])) { - await startCameraSession(i); - - mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 callback"); - if (!err) { - if (data != (mZoomRatioMaxArray[i] + 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 PASSED with ZoomRatio is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED with ZoomRatio is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 @@ -1004,65 +760,7 @@ export default function cameraSessionZoomRatioTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 - * @tc.name : Check capture session zoom ratio with callback(invalid value, min - 1) - * @tc.desc : Check capture session zoom ratio with callback(invalid value, min - 1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 start for camera[" + i + "]"); - - if (!isEmpty(mZoomRatioRangeArray[i])) { - await startCameraSession(i); - - mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 callback"); - if (!err) { - if (data != (mZoomRatioMinArray[i] - 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 PASSED with ZoomRatio is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED with ZoomRatio is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 ends here"); - done(); - } - }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 @@ -1112,65 +810,7 @@ export default function cameraSessionZoomRatioTest() { } }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 - * @tc.name : Check capture session zoom ratio with callback(invalid value, min - 0.1) - * @tc.desc : Check capture session zoom ratio with callback(invalid value, min - 0.1) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104--------------"); - - if (mCameraNum == 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED with NoCamera"); - expect().assertFail(); - done(); - } else { - for (let i = 0; i < mCameraNum; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 start for camera[" + i + "]"); - - if (!isEmpty(mZoomRatioRangeArray[i])) { - await startCameraSession(i); - - mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] - 0.1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 callback"); - if (!err) { - if (data != (mZoomRatioMaxArray[i] - 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 PASSED with ZoomRatio is: " + data); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED with ZoomRatio is: " + data); - expect().assertFail(); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 end for camera[" + i + "]"); - } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 ends here"); - done(); - } - }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104