diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets index c103f34f88109af0ac7a05fb7b32a245048a1a5d..ff85c291b20ae014c24bf348c69ad92be3864253 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets @@ -386,7 +386,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { if (!err) { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 success"); - if (data != null || data.length > 0) { + if (data != null && data.length > 0) { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 data is not null || undefined"); for (var i = 0; i < data.length; i++) { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 cameraFormat: " + data[i]); @@ -396,6 +396,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 ends here"); await sleep(1000); @@ -426,6 +427,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 ends here"); await sleep(1000); @@ -445,7 +447,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { camera0InputPromise.getSupportedVideoFormats(async (err, data) => { if (!err) { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 success"); - if (data != null || data.length > 0) { + if (data != null && data.length > 0) { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 data is not null || undefined"); for (var i = 0; i < data.length; i++) { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 cameraFormat: " + data[i]); @@ -455,6 +457,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 ends here"); await sleep(1000); @@ -485,6 +488,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 ends here"); await sleep(1000); @@ -492,30 +496,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015--------------"); - camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015--------------"); + camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 PASSED"); } } else { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 FAILED: " + err.message); + expect().assertFail(); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_015 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 ends here"); await sleep(1000); done(); }) @@ -524,28 +529,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016--------------"); - var sizeArrayPromise = await camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 sizeArrayPromise"); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016--------------"); + var sizeArrayPromise = await camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 sizeArrayPromise"); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 PASSED"); } else { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 FAILED"); + expect().assertFail(); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_016 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 ends here"); await sleep(1000); done(); }) @@ -573,6 +579,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 ends here"); await sleep(1000); @@ -603,6 +610,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 ends here"); await sleep(1000); @@ -753,6 +761,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 ends here"); await sleep(1000); @@ -783,6 +792,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 ends here"); await sleep(1000); @@ -790,31 +800,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025--------------"); - camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025--------------"); + camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_025 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 ends here"); await sleep(1000); done(); }) @@ -823,29 +833,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026--------------"); - var sizeArrayPromise = await camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026--------------"); + var sizeArrayPromise = await camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_026 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 ends here"); await sleep(1000); done(); }) @@ -873,6 +883,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 ends here"); await sleep(1000); @@ -903,6 +914,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 ends here"); await sleep(1000); @@ -1052,6 +1064,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 ends here"); await sleep(1000); @@ -1082,6 +1095,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 ends here"); await sleep(1000); @@ -1089,31 +1103,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035--------------"); - camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035--------------"); + camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_035 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 ends here"); await sleep(1000); done(); }) @@ -1122,29 +1136,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036--------------"); - var sizeArrayPromise = await camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036--------------"); + var sizeArrayPromise = await camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_036 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 ends here"); await sleep(1000); done(); }) @@ -1172,6 +1186,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 ends here"); await sleep(1000); @@ -1202,6 +1217,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 ends here"); await sleep(1000); @@ -1483,6 +1499,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 ends here"); await sleep(1000); @@ -1513,6 +1530,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 ends here"); await sleep(1000); @@ -1542,6 +1560,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 ends here"); await sleep(1000); @@ -1572,6 +1591,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 ends here"); await sleep(1000); @@ -1579,31 +1599,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051--------------"); - camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051--------------"); + camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_051 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 ends here"); await sleep(1000); done(); }) @@ -1612,29 +1632,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052--------------"); - var sizeArrayPromise = await camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052--------------"); + var sizeArrayPromise = await camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_052 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 ends here"); await sleep(1000); done(); }) @@ -1662,6 +1682,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 ends here"); await sleep(1000); @@ -1692,6 +1713,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 ends here"); await sleep(1000); @@ -1840,6 +1862,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 ends here"); await sleep(1000); @@ -1870,6 +1893,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 ends here"); await sleep(1000); @@ -1877,31 +1901,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061--------------"); - camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061--------------"); + camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_061 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 ends here"); await sleep(1000); done(); }) @@ -1910,29 +1934,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062--------------"); - var sizeArrayPromise = await camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062--------------"); + var sizeArrayPromise = await camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_062 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 ends here"); await sleep(1000); done(); }) @@ -1960,6 +1984,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 ends here"); await sleep(1000); @@ -1990,6 +2015,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 ends here"); await sleep(1000); @@ -2138,6 +2164,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 ends here"); await sleep(1000); @@ -2168,6 +2195,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 ends here"); await sleep(1000); @@ -2175,31 +2203,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071--------------"); - camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071--------------"); + camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_071 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 ends here"); await sleep(1000); done(); }) @@ -2208,29 +2236,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072--------------"); - var sizeArrayPromise = await camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072--------------"); + var sizeArrayPromise = await camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_072 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 ends here"); await sleep(1000); done(); }) @@ -2258,6 +2286,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 ends here"); await sleep(1000); @@ -2288,6 +2317,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 ends here"); await sleep(1000); @@ -2545,6 +2575,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 ends here"); await sleep(1000); @@ -2575,6 +2606,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 ends here"); await sleep(1000); @@ -2604,6 +2636,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 ends here"); await sleep(1000); @@ -2634,6 +2667,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 ends here"); await sleep(1000); @@ -2641,31 +2675,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087--------------"); - camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087--------------"); + camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_087 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 ends here"); await sleep(1000); done(); }) @@ -2674,29 +2708,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088--------------"); - var sizeArrayPromise = await camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088--------------"); + var sizeArrayPromise = await camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_088 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 ends here"); await sleep(1000); done(); }) @@ -2724,6 +2758,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 ends here"); await sleep(1000); @@ -2754,6 +2789,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 ends here"); await sleep(1000); @@ -2902,6 +2938,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 ends here"); await sleep(1000); @@ -2932,6 +2969,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 ends here"); await sleep(1000); @@ -2939,31 +2977,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097--------------"); - camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097--------------"); + camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_097 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 ends here"); await sleep(1000); done(); }) @@ -2972,29 +3010,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098--------------"); - var sizeArrayPromise = await camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098--------------"); + var sizeArrayPromise = await camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_098 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 ends here"); await sleep(1000); done(); }) @@ -3022,6 +3060,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 ends here"); await sleep(1000); @@ -3052,6 +3091,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 ends here"); await sleep(1000); @@ -3200,6 +3240,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 ends here"); await sleep(1000); @@ -3230,6 +3271,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 ends here"); await sleep(1000); @@ -3237,31 +3279,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107--------------"); - camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107--------------"); + camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_107 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 ends here"); await sleep(1000); done(); }) @@ -3270,29 +3312,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108--------------"); - var sizeArrayPromise = await camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108--------------"); + var sizeArrayPromise = await camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_108 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 ends here"); await sleep(1000); done(); }) @@ -3320,6 +3362,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 ends here"); await sleep(1000); @@ -3350,6 +3393,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 ends here"); await sleep(1000); @@ -3607,6 +3651,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 ends here"); await sleep(1000); @@ -3637,6 +3682,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 ends here"); await sleep(1000); @@ -3644,31 +3690,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121--------------"); - camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121--------------"); + camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 ends here"); await sleep(1000); done(); }) @@ -3699,6 +3745,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 ends here"); await sleep(1000); @@ -3729,6 +3776,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 ends here"); await sleep(1000); @@ -3736,31 +3784,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121--------------"); - camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121--------------"); + camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_121 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 ends here"); await sleep(1000); done(); }) @@ -3769,29 +3817,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125--------------"); - var sizeArrayPromise = await camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125--------------"); + var sizeArrayPromise = await camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_125 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 ends here"); await sleep(1000); done(); }) @@ -3819,6 +3867,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 ends here"); await sleep(1000); @@ -3849,6 +3898,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 ends here"); await sleep(1000); @@ -3997,6 +4047,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 ends here"); await sleep(1000); @@ -4027,6 +4078,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 ends here"); await sleep(1000); @@ -4034,31 +4086,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134--------------"); - camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134--------------"); + camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_134 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 ends here"); await sleep(1000); done(); }) @@ -4067,29 +4119,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135--------------"); - var sizeArrayPromise = await camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135--------------"); + var sizeArrayPromise = await camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_135 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 ends here"); await sleep(1000); done(); }) @@ -4117,6 +4169,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 ends here"); await sleep(1000); @@ -4147,6 +4200,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 ends here"); await sleep(1000); @@ -4295,6 +4349,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 ends here"); await sleep(1000); @@ -4325,6 +4380,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 FAILED"); + expect().assertFail(); } console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 ends here"); await sleep(1000); @@ -4332,31 +4388,31 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144--------------"); - camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP, async (err, data) => { + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144--------------"); + camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 success"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 success"); if (data != null || data.length > 0) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 data is not null || undefined"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 data is not null || undefined"); for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 sizeArray: width * height - " + data[i].width + " * " + data[i].height); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 PASSED"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 FAILED: " + err.message); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 FAILED: " + err.message); } - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_TC_144 ends here"); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 ends here"); await sleep(1000); done(); }) @@ -4365,29 +4421,29 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { }) /** - * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput promise api * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145', 0, async function (done) { - console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145--------------"); - var sizeArrayPromise = await camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 sizeArrayPromise: "); + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145--------------"); + var sizeArrayPromise = await camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 sizeArrayPromise: "); if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 size0ArrayPromise is not null || undefined"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 size0ArrayPromise is not null || undefined"); for (var i = 0; i < sizeArrayPromise.length; i++) { - console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); } expect(true).assertTrue(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 PASSED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 PASSED"); } else { expect().assertFail(); - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 FAILED"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 FAILED"); } - console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YCRCb_420_SP_PROMISE_TC_145 ends here"); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 ends here"); await sleep(1000); done(); }) @@ -4415,6 +4471,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 FAILED: " + err.message); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 ends here"); await sleep(1000); @@ -4445,6 +4502,7 @@ export default function cameraJSUnitCameraFormat(surfaceId: any) { } } else { console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 FAILED"); + expect().assertFail(); } console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 ends here"); await sleep(1000); diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets index 63bff15d5bd1827cdddf11d6554b45381ea9b388..1cdbfe82b01347a3ab63d3d626a97a86cf5a4962 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets @@ -155,45 +155,45 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : GET_CAMERAS_TC_003 + * @tc.number : GET_CAMERAS_TC_002 * @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 0 */ - it('GET_CAMERAS_TC_003', 0, async function (done) { - console.info("--------------GET_CAMERAS_TC_003--------------"); + it('GET_CAMERAS_TC_002', 0, async function (done) { + console.info("--------------GET_CAMERAS_TC_002--------------"); cameraManager.getCameras(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_CAMERAS_TC_003 success"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 success"); if (data != null || data != undefined) { - console.info(TAG + "Entering GET_CAMERAS_TC_003 data is not null || undefined"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 data is not null || undefined"); camerasArray = data; if (camerasArray != null && camerasArray.length > 0) { for (var i = 0; i < camerasArray.length; i++) { // Get the variables from camera object var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GET_CAMERAS_TC_003 camera" + i + "Id: " + cameraId); + console.info(TAG + "Entering GET_CAMERAS_TC_002 camera" + i + "Id: " + cameraId); var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GET_CAMERAS_TC_003 camera" + i + "Position: " + cameraPosition); + console.info(TAG + "Entering GET_CAMERAS_TC_002 camera" + i + "Position: " + cameraPosition); var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GET_CAMERAS_TC_003 camera" + i + "Type: " + cameraType); + console.info(TAG + "Entering GET_CAMERAS_TC_002 camera" + i + "Type: " + cameraType); var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GET_CAMERAS_TC_003 connection" + i + "Type: " + connectionType); + console.info(TAG + "Entering GET_CAMERAS_TC_002 connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); - console.info(TAG + "Entering GET_CAMERAS_TC_003 PASSED"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering GET_CAMERAS_TC_003 FAILED cameraArray is null || undefined"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 FAILED cameraArray is null || undefined"); } } } else { expect().assertFail(); - console.info(TAG + "Entering GET_CAMERAS_TC_003 FAILED: " + err.message); + console.info(TAG + "Entering GET_CAMERAS_TC_002 FAILED: " + err.message); } - console.info(TAG + "Entering GET_CAMERAS_TC_003 ends here"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 ends here"); await sleep(1000); done(); }) @@ -203,29 +203,29 @@ export default function cameraJSUnitEnum(surfaceId: any) { /*CAMERA-0 Scripts*/ /** - * @tc.number : CREATE_CAMERA_INPUT_TC_005 + * @tc.number : CREATE_CAMERA_INPUT_TC_003 * @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 0 */ - it('CREATE_CAMERA_INPUT_TC_005', 0, async function (done) { + it('CREATE_CAMERA_INPUT_TC_003', 0, async function (done) { console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------CREATE_CAMERA_INPUT_TC_005--------------"); + console.info("--------------CREATE_CAMERA_INPUT_TC_003--------------"); cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { if (!err) { if (data != null && data != undefined) { - console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 data is not null || undefined"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 data is not null || undefined"); camera0Input = data; expect(true).assertTrue(); - console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 PASSED with CameraID :" + camerasArray[0].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 PASSED with CameraID :" + camerasArray[0].cameraId); } } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 FAILED: " + err.message); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 FAILED: " + err.message); } - console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 ends here"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 ends here"); camera0Input.release(); await sleep(1000); done(); @@ -330,8 +330,8 @@ export default function cameraJSUnitEnum(surfaceId: any) { */ it('CAMERA_FORMAT', 0, async function (done) { console.info(TAG + "--------------CameraFormat ------------") - console.info(TAG + "CameraFormat CAMERA_FORMAT_YCRCb_420_SP : " + cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP); - expect(cameraObj.CameraFormat.CAMERA_FORMAT_YCRCb_420_SP).assertEqual(1003); + console.info(TAG + "CameraFormat CAMERA_FORMAT_YUV_420_SP : " + cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + expect(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP).assertEqual(1003); console.info(TAG + "CameraFormat CAMERA_FORMAT_JPEG : " + cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); expect(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG).assertEqual(2000); await sleep(1000); @@ -402,6 +402,44 @@ export default function cameraJSUnitEnum(surfaceId: any) { done(); }) + /** + * @tc.number : EXPOSUREMODE + * @tc.name : Exposure Mode ENAME + * @tc.desc : Exposure Mode ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('EXPOSUREMODE', 0, async function (done) { + console.info(TAG + "--------------ExposureMode ------------") + console.info(TAG + "ExposureMode EXPOSURE_MODE_LOCKED : " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED).assertEqual(0); + console.info(TAG + "ExposureMode EXPOSURE_MODE_AUTO : " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + console.info(TAG + "ExposureMode EXPOSURE_MODE_CONTINUOUS_AUTO : " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO).assertEqual(2); + await sleep(1000); + done(); + }) + + /** + * @tc.number : ExposureState + * @tc.name : Exposure State ENAME + * @tc.desc : Exposure State ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ExposureState', 0, async function (done) { + console.info(TAG + "--------------ExposureState ------------") + console.info(TAG + "ExposureState EXPOSURE_STATE_SCAN : " + cameraObj.ExposureState.EXPOSURE_STATE_SCAN); + expect(cameraObj.ExposureState.EXPOSURE_STATE_SCAN).assertEqual(0); + console.info(TAG + "ExposureState EXPOSURE_STATE_CONVERGED : " + cameraObj.ExposureState.EXPOSURE_STATE_CONVERGED); + expect(cameraObj.ExposureState.EXPOSURE_STATE_CONVERGED).assertEqual(1); + await sleep(1000); + done(); + }) + /** * @tc.number : ImageRotation * @tc.name : Image Rotation ENAME diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets index 6f7b2e078ba2b0b70bcae156c02eb2f69a7c33fe..ea9cd68aad6a63ea53858122c243d0895c1bfd89 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets @@ -24,6 +24,7 @@ const TAG = "CameraModuleTest: "; // Define global variables var camera0Input; +var camera1Input; var cameraManager; var previewOutputAsync; var photoOutputAsync; @@ -31,20 +32,44 @@ var captureSession; var surfaceId1; var camerasArray; +var Point1 = { x: 1, y: 1 } +var Point2 = { x: 2, y: 2 } +var Point3 = { x: 3, y: 3 } + var photosettings1 = { rotation: 0, quality: 0, + location: { + latitude: 12.9705, + longitude: 77.7329, + altitude: 920.0000, + }, } var photosettings2 = { rotation: 90, quality: 1, + location: { + latitude: 20, + longitude: 78, + altitude: 8586, + }, } + var photosettings3 = { - rotation: 180, quality: 2, + location: { + latitude: 0, + longitude: 0, + altitude: 0, + }, } var photosettings4 = { - rotation: 270 + rotation: 180, + location: { + latitude: -1, + longitude: -1, + altitude: -1, + }, } export default function cameraJSUnitPhotoAsync(surfaceId: any) { @@ -129,7 +154,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info('afterAll case'); }) - console.info(TAG + "----------Camera-PhotoMode-Async-------------"); + console.info(TAG + "----------Camera-Precision Control-Async-------------"); /** * @tc.number : GET_CAMERA_MANAGER * @tc.name : Create camera manager instance async api @@ -142,9 +167,9 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info("--------------GET_CAMERA_MANAGER--------------"); cameraObj.getCameraManager(null, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_CAMERA_MANAGER success"); + console.info(TAG + "Entering Camera Manager success"); if (data != null || data != undefined) { - console.info(TAG + "Entering GET_CAMERA_MANAGER data is not null || undefined"); + console.info(TAG + "Entering Camera Manager data is not null || undefined"); cameraManager = data; expect(true).assertTrue(); console.info(TAG + "Entering GET_CAMERA_MANAGER PASSED"); @@ -174,7 +199,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering CAMERA_STATUS_CALLBACK cameraManager == null || undefined") } else { console.info(TAG + "Entering CAMERA_STATUS_CALLBACK to operate") - cameraManager.on("cameraStatus", async (err, data) => { + cameraManager.on('cameraStatus', async (err, data) => { if (!err) { console.info(TAG + "Camera status Callback on cameraManager is success"); if (data != null || data != undefined) { @@ -184,7 +209,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); + console.info(TAG + "CAMERA_STATUS_CALLBACK FAILED: " + err.message); } await sleep(1000); done(); @@ -206,21 +231,21 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info("--------------GET_CAMERAS--------------"); cameraManager.getCameras(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_CAMERAS success"); + console.info(TAG + "Entering GetCameras success"); if (data != null || data != undefined) { - console.info(TAG + "Entering GET_CAMERAS data is not null || undefined"); + console.info(TAG + "Entering GetCameras data is not null || undefined"); camerasArray = data; if (camerasArray != null && camerasArray.length > 0) { for (var i = 0; i < camerasArray.length; i++) { // Get the variables from camera object var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GET_CAMERAS camera" + i + "Id: " + cameraId); + console.info(TAG + "Entering GetCameras camera" + i + "Id: " + cameraId); var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GET_CAMERAS camera" + i + "Position: " + cameraPosition); + console.info(TAG + "Entering GetCameras camera" + i + "Position: " + cameraPosition); var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GET_CAMERAS camera" + i + "Type: " + cameraType); + console.info(TAG + "Entering GetCameras camera" + i + "Type: " + cameraType); var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GET_CAMERAS connection" + i + "Type: " + connectionType); + console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); console.info(TAG + "Entering GET_CAMERAS PASSED"); @@ -271,6 +296,35 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { done(); }) + /** + * @tc.number : CREATE_CAMERA_INPUT + * @tc.name : Create camerainput from camera-1 cameraId async api + * @tc.desc : Create camerainput from camera-1 cameraId async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT', 0, async function (done) { + cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT data is not null || undefined"); + camera1Input = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT PASSED with CameraID :" + camerasArray[1].cameraId); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT FAILED: " + err.message); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + /** * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -281,19 +335,19 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { */ it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR cameraInput == null || undefined"); + console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); } else { console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); - camera0Input.on("error", async (err, data) => { + camera0Input.on('error', async (err, data) => { if (!err) { console.info(TAG + "cameraInput error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during cameraInput with ErrorCode: " + data.code); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Error in CameraInputCallback FAILED: " + err.message); + console.info(TAG + "Error in CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -325,7 +379,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS FAILED" + err.message); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS FAILED : " + err.message); } console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS ends here"); await sleep(1000); @@ -345,19 +399,19 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined"); + console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate"); - previewOutputAsync.on("error", async (err, data) => { + previewOutputAsync.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during PreviewOutput with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -392,7 +446,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS FAILED"); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS FAILED : " + err.message); console.info(TAG + "Entering createPhotoOutput ends here"); } await sleep(1000); @@ -402,6 +456,35 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { done(); }) + /** + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + photoOutputAsync.isMirrorSupported(async (err, data) => { + if (!err) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + } else { + expect().assertFail(); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + /** * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -415,7 +498,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); - photoOutputAsync.on("error", async (err, data) => { + photoOutputAsync.on('error', async (err, data) => { if (!err) { console.info(TAG + "PhotoOutputError callback is success"); if (data != null || data != undefined) { @@ -452,12 +535,12 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering createCaptureSession data is not null || undefined"); captureSession = data; expect(true).assertTrue(); - console.info(TAG + "Entering createCaptureSession PASSED"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS FAILED" + err.message); - console.info(TAG + "Entering createCaptureSession ends here"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS ends here"); } await sleep(1000); done(); @@ -477,19 +560,19 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { */ it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); + console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); } else { console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR to operate"); - captureSession.on("error", async (err, data) => { + captureSession.on('error', async (err, data) => { if (!err) { - console.info(TAG + " captureSession errorcallback is success"); + console.info(TAG + " captureSession error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error in CaptureSessioncallback with ErrorCode: " + data.code); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Error in CaptureSessioncallback FAILED: " + err.message); + console.info(TAG + "Error in CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -501,30 +584,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : CREATE_BEGIN_CONFIG_SUCCESS + * @tc.number : BEGIN_CONFIG_SUCCESS * @tc.name : CaptureSession_Begin config api * @tc.desc : CaptureSession_Begin config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CREATE_BEGIN_CONFIG_SUCCESS', 0, async function (done) { + it('BEGIN_CONFIG_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS to operate"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS to operate"); captureSession.beginConfig(async (err, data) => { if (!err) { console.info(TAG + "Entering beginConfig success"); if (data != null || data != undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG beginConfig data is not null || undefined"); + console.info(TAG + "Entering BeginConfig data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS beginConfig PASSED"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS FAILED" + err.message); - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS ends here"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS ends here"); } await sleep(1000); done(); @@ -536,22 +619,22 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /** * @tc.number : ADD_INPUT_SUCCESS - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api + * @tc.name : Add Input with camera1Input api + * @tc.desc : Add Input with camera1Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ it('ADD_INPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering Addinput captureSession == null || undefined"); } else { console.info(TAG + "Entering ADD_INPUT_SUCCESS to operate"); - captureSession.addInput(camera0Input, async (err, data) => { + captureSession.addInput(camera1Input, async (err, data) => { if (!err) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput success"); + console.info(TAG + "Entering AddInput success"); if (data != null || data != undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput data is not null || undefined"); + console.info(TAG + "Entering AddInput data is not null || undefined"); expect(true).assertTrue(); console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput PASSED"); } @@ -578,20 +661,20 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { */ it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); } else { console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS to operate"); captureSession.addOutput(previewOutputAsync, async (err, data) => { if (!err) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS : Success"); + console.info(TAG + "Entering AddOutput_Preview : Success"); if (data != null || data != undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS data is not null || undefined"); + console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); expect(true).assertTrue(); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS FAILED" + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS FAILED : " + err.message); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS ends here"); } await sleep(1000); @@ -600,72 +683,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } }) - /** - * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); - } - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : REMOVE_INPUT_SUCCESS - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('REMOVE_INPUT_SUCCESS', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); - captureSession.removeInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - /** * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS * @tc.name : Remove preview Output api @@ -699,62 +716,62 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api + * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS + * @tc.name : Add output with camera0Input api + * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); } else { - console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS to operate"); + captureSession.addOutput(previewOutputAsync, async (err, data) => { if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS PASSED"); - } - else { + console.info(TAG + "Entering AddOutput_Preview : Success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS PASSED"); + } + } else { expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS ends here"); } await sleep(1000); done(); }) - await sleep(1000); } - done(); }) /** - * @tc.number : ADD_INPUT_SUCCESS - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api + * @tc.number : COMMIT_CONFIG_SUCCESS + * @tc.name : commit config api + * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_INPUT_SUCCESS', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering ADD_INPUT_SUCCESS to operate"); - captureSession.addInput(camera0Input, async (err, data) => { + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); + captureSession.commitConfig(async (err, data) => { if (!err) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput success"); + console.info(TAG + "Entering commitConfig success"); if (data != null || data != undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput data is not null || undefined"); + console.info(TAG + "Entering CommitConfig data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering ADD_INPUT_SUCCESS FAILED: " + err.message); - console.info(TAG + "Entering ADD_INPUT_SUCCESS ends here"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS ends here"); } await sleep(1000); done(); @@ -765,63 +782,55 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS captureSession == null || undefined"); + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + photoOutputAsync.isMirrorSupported(async (err, data) => { if (!err) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS PASSED"); - } + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS FAILED" + err.message); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS ends here"); } await sleep(1000); done(); }) + await sleep(1000); + done(); } }) /** - * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api + * @tc.number : setMirror_true + * @tc.name : setMirror true + * @tc.desc : setMirror true * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); + it('setMirror_true', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { + console.info(TAG + "Entering setMirror_true to operate"); + photoOutputAsync.setMirror(true, async (err, data) => { if (!err) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); - } + console.info(TAG + "Entering setMirror_true is success:"); + console.info(TAG + "setMirror is : " + 'True'); + expect(true).assertTrue(); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); } - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1000); done(); }) @@ -831,30 +840,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : COMMIT_CONFIG_SUCCESS - * @tc.name : commit config api - * @tc.desc : commit config api + * @tc.number : setMirror_false + * @tc.name : setMirror false + * @tc.desc : setMirror false * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined"); + it('setMirror_false', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); - captureSession.commitConfig(async (err, data) => { + console.info(TAG + "Entering setMirror_false to operate"); + photoOutputAsync.setMirror(false, async (err, data) => { if (!err) { - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); - } + console.info(TAG + "Entering setMirror_false is success"); + console.info(TAG + "setMirror is : " + 'false'); + expect(true).assertTrue(); } else { expect().assertFail(); - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED" + err.message); - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } await sleep(1000); done(); @@ -864,30 +868,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } }) - //preview callback /** - * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api + * @tc.number : setMirror_1 + * @tc.name : setMirror 1 + * @tc.desc : setMirror 1 * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); + it('setMirror_1', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); - previewOutputAsync.on("frameStart", async (err, data) => { + console.info(TAG + "Entering setMirror_1 to operate"); + photoOutputAsync.setMirror(1, async (err, data) => { if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PreviewOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } + console.info(TAG + "Entering setMirror_1 is success:"); + console.info(TAG + "setMirror is : " + '1'); + expect(true).assertTrue(); } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1000); done(); @@ -898,27 +898,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api + * @tc.number : setMirror_0 + * @tc.name : setMirror 0 + * @tc.desc : setMirror 0 * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined"); + it('setMirror_0', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); - previewOutputAsync.on("frameEnd", async (err, data) => { + console.info(TAG + "Entering setMirror_0 to operate"); + photoOutputAsync.setMirror(0, async (err, data) => { if (!err) { - console.info(TAG + "PreviewStop frameEnd Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } + console.info(TAG + "Entering setMirror_0 is success:"); + console.info(TAG + "setMirror is : " + '0'); + expect(true).assertTrue(); } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message"); } await sleep(1000); done(); @@ -928,30 +926,32 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } }) - //Capture callback + /*CaptureSession APIs*/ /** - * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api + * @tc.number : BEGIN_CONFIG_SUCCESS + * @tc.name : CaptureSession_Begin config api + * @tc.desc : CaptureSession_Begin config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START photoOutput == null || undefined"); + it('BEGIN_CONFIG_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); - photoOutputAsync.on("captureStart", async (err, data) => { + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS to operate"); + captureSession.beginConfig(async (err, data) => { if (!err) { - console.info(TAG + "CaptureStart Callback is success"); + console.info(TAG + "Entering beginConfig success"); if (data != null || data != undefined) { - console.info(TAG + "captureStart success with captureId: " + data); + console.info(TAG + "Entering BeginConfig data is not null || undefined"); expect(true).assertTrue(); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED"); } } else { expect().assertFail(); - console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS ends here"); } await sleep(1000); done(); @@ -962,62 +962,1536 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api + * @tc.number : REMOVE_INPUT_SUCCESS + * @tc.name : remove input api + * @tc.desc : remove input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); + it('REMOVE_INPUT_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); - photoOutputAsync.on("captureEnd", async (err, data) => { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); + captureSession.removeInput(camera1Input, async (err, data) => { if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); + console.info(TAG + "Entering remove input success"); + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering Remove Input FAILED" + err.message); + console.info(TAG + "Entering Remove Input ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + } + done(); + }) + + /** + * @tc.number : ADD_INPUT_SUCCESS + * @tc.name : Add Input with camera0Input api + * @tc.desc : Add Input with camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_INPUT_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering Addinput captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_INPUT_SUCCESS to operate"); + captureSession.addInput(camera0Input, async (err, data) => { + if (!err) { + console.info(TAG + "Entering AddInput success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddInput data is not null || undefined"); expect(true).assertTrue(); + console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput PASSED"); } } else { expect().assertFail(); - console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); + console.info(TAG + "Entering ADD_INPUT_SUCCESS FAILED: " + err.message); + console.info(TAG + "Entering ADD_INPUT_SUCCESS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); + captureSession.addOutput(photoOutputAsync, async (err, data) => { + if (!err) { + console.info(TAG + "Entering AddOutput_Photo success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS + * @tc.name : Remove photo Output api + * @tc.desc : Remove photo Output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS to operate"); + captureSession.removeOutput(photoOutputAsync, async (err, data) => { + if (!err) { + console.info(TAG + "Entering remove photo Output success"); + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering Remove photo Output FAILED" + err.message); + console.info(TAG + "Entering Remove photo Output ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + } + done(); + }) + + /** + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); + captureSession.addOutput(photoOutputAsync, async (err, data) => { + if (!err) { + console.info(TAG + "Entering AddOutput_Photo success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : COMMIT_CONFIG_SUCCESS + * @tc.name : commit config api + * @tc.desc : commit config api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); + } else { + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); + captureSession.commitConfig(async (err, data) => { + if (!err) { + console.info(TAG + "Entering commitConfig success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CommitConfig data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : FocusStateChange callback api + * @tc.desc : FocusStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0Input == null || camera0Input == undefined) { + console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0Input.on('focusStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "FocusState callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current FocusState is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : ExposureStateChange callback api + * @tc.desc : ExposureStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0Input == null || camera0Input == undefined) { + console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0Input.on('exposureStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "ExposureStateChange callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current ExposureStateChange is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + //preview callback + /** + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START + * @tc.name : Preview output callback on frame start api + * @tc.desc : Preview output callback on frame start api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { + if (previewOutputAsync == null || previewOutputAsync == undefined) { + console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); + previewOutputAsync.on("frameStart", async (err, data) => { + if (!err) { + console.info(TAG + "PreviewStart frameStart Callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START with ErrorCode: " + data.code); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1000); done(); }) await sleep(1000); done(); - } + } + }) + + /** + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END + * @tc.name : Preview capture callback on frame end api + * @tc.desc : Preview capture callback on frame end api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { + if (previewOutputAsync == null || previewOutputAsync == undefined) { + console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); + previewOutputAsync.on('frameEnd', async (err, data) => { + if (!err) { + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END Callback is success"); + if (data != null || data != undefined) { + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + //Capture callback + /** + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START + * @tc.name : Photo capture callback on capture start api + * @tc.desc : Photo capture callback on capture start api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); + photoOutputAsync.on('captureStart', async (err, data) => { + if (!err) { + console.info(TAG + "Photo Capture Callback on CaptureStart is success"); + if (data != null || data != undefined) { + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END + * @tc.name : Photo capture callback on capture end api + * @tc.desc : Photo capture callback on capture end api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); + photoOutputAsync.on('captureEnd', async (err, data) => { + if (!err) { + console.info(TAG + "captureEnd callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "captureEnd callback with captureId: " + data.captureId); + console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER + * @tc.name : Photo capture callback on frame shutter api + * @tc.desc : Photo capture callback on frame shutter api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); + photoOutputAsync.on('frameShutter', async (err, data) => { + if (!err) { + console.info(TAG + "frameShutter callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "frameShutter callback with captureId: " + data.captureId); + console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : CAPTURE_SESSION_START + * @tc.name : capture session start api + * @tc.desc : capture session start api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CAPTURE_SESSION_START', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); + } else { + console.info(TAG + "Entering CAPTURE_SESSION_START to operate"); + captureSession.start(async (err, data) => { + if (!err) { + console.info(TAG + "Entering captureSession.start success"); + expect(true).assertTrue(); + console.info(TAG + "Entering CAPTURE_SESSION_START PASSED"); + } + else { + console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message) + expect().assertFail(); + } + console.info(TAG + "Entering CAPTURE_SESSION_START ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + //Location + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputAsync.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); + photoOutputAsync.capture(photosettings1, async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture with photosettings1"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 + * @tc.name : Photo output capture with photosettings2 api + * @tc.desc : Photo output capture with photosettings2 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate"); + photoOutputAsync.capture(photosettings2, async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture with photosettings2 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 to operate"); + photoOutputAsync.capture(photosettings3, async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture with photosettings3 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 ends here"); + } + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 to operate"); + photoOutputAsync.capture(photosettings4, async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture with photosettings4 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 ends here"); + } + }) + await sleep(1000); + done(); + } + }) + + //FLASH Function API scripts + /** + * @tc.number : HAS_FLASH + * @tc.name : check if has flash-camera0Input api + * @tc.desc : check if has flash-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('HAS_FLASH', 0, async function (done) { + console.info(TAG + "hasFlash called.") + camera0Input.hasFlash(async (err, data) => { + if (!err) { + console.info(TAG + "Entering HAS_FLASH success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); + expect(data).assertEqual(true); + } + } else { + console.info(TAG + "Entering HAS_FLASH FAILED : " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering HAS_FLASH ends here"); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED + * @tc.name : check if flash mode open is supported-camera0Input api + * @tc.desc : check if flash mode open is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); + camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { + if (!err) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); + console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); + } + } else { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FLASH_MODE_OPEN + * @tc.name : set flash mode open camera0 api + * @tc.desc : set flash mode open camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); + camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); + } + else { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FLASH_MODE_OPEN + * @tc.name : get flash mode open camera0 api + * @tc.desc : get flash mode open camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate"); + camera0Input.getFlashMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FLASH_MODE_OPEN success"); + if (data == 1) { + console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: "); + console.info(TAG + "Current FlashMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_FLASH_MODE_OPEN PASSED"); + } + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : " + err.message); + console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED + * @tc.name : check if flash mode always open is supported-camera0Input api + * @tc.desc : check if flash mode always open is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); + camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { + if (!err) { + console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined"); + console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); + } + } else { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FLASH_MODE_ALWAYS_OPEN + * @tc.name : set flash mode always open camera0 api + * @tc.desc : set flash mode always open camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate"); + camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); + } + else { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FLASH_MODE_ALWAYS_OPEN + * @tc.name : get flash mode always open camera0 api + * @tc.desc : get flash mode always open camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate"); + camera0Input.getFlashMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success"); + if (data == 3) { + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: "); + expect(true).assertTrue(); + console.info(TAG + "Current FlashMode is: " + data); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED"); + } + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED + * @tc.name : check if flash mode auto is supported-camera0Input api + * @tc.desc : check if flash mode auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED data is not null || undefined"); + console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); + } + } else { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED :" + err.message); + expect().assertFail(); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FLASH_MODE_AUTO + * @tc.name : set flash mode auto camera0 api + * @tc.desc : set flash mode auto open camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); + camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); + } + else { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FLASH_MODE_AUTO + * @tc.name : get flash mode auto camera0 api + * @tc.desc : get flash mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); + camera0Input.getFlashMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); + if (data == 2) { + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); + expect(true).assertTrue(); + console.info(TAG + "Current FlashMode is: " + data); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); + } + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED + * @tc.name : check if flash mode close is supported-camera0Input api + * @tc.desc : check if flash mode close is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); + camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); + console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); + } + } else { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED :" + err.message); + expect().assertFail(); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FLASH_MODE_CLOSE + * @tc.name : set flash mode close camera0 api + * @tc.desc : set flash mode close open camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate"); + camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); + } + else { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FLASH_MODE_CLOSE + * @tc.name : get flash mode auto camera0 api + * @tc.desc : get flash mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); + camera0Input.getFlashMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); + if (data == 0) { + console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); + expect(true).assertTrue(); + console.info(TAG + "Current FlashMode is: " + data); + console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); + } + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_ZOOM_RATIO + * @tc.name : get zoom ratio camera-0 cameraId api + * @tc.desc : get zoom ratio camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_ZOOM_RATIO', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO--------------"); + camera0Input.getZoomRatioRange(async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data) + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message); + } + console.info(TAG + "Entering GET_ZOOM_RATIO ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_1_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(1, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 1"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(1); + console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_2_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(2, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 2"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(2); + console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED "); + } + else { + expect().assertFail(); + console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); + } + }) + } else { + expect().assertFail(); + console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); + } + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_3_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(3, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 3"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(3); + console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_4_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(4, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 4"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(4); + console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_5_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(5, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 5"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(5); + console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_6_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(6, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 6"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(6); + console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED + * @tc.name : check if focus mode locked is supported-camera0Input api + * @tc.desc : check if focus mode locked is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED :" + err.message); + expect().assertFail() + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_LOCKED + * @tc.name : set focus mode locked camera0 api + * @tc.desc : set focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); + camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") + expect().assertFail(); + } else { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_LOCKED + * @tc.name : get focus mode locked camera0 api + * @tc.desc : get focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); + camera0Input.getFocusMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); + console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(0); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCAL_LENGTH + * @tc.name : get focal length camera0 api + * @tc.desc : get focal length camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCAL_LENGTH', 0, async function (done) { + console.info(TAG + "Entering GET_FOCAL_LENGTH to operate"); + camera0Input.getFocalLength(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); + expect(data).assertEqual(3.4600000381469727); + console.info(TAG + "GET_FOCAL_LENGTH PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCAL_LENGTH FAILED : " + err.message); + console.info(TAG + "GET_FOCAL_LENGTH ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT_focus mode manual + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT_focus mode manual', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); + camera0Input.setFocusPoint(Point1, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT_focus mode manual + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT_focus mode manual', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + camera0Input.getFocusPoint(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focus Point is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED + * @tc.name : check if focus mode manual is supported-camera0Input api + * @tc.desc : check if focus mode manual is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { + if (!err) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED " + err.message); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_MANUAL + * @tc.name : set focus mode manual camera0 api + * @tc.desc : set focus mode manual camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); + camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) + } + else { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_MANUAL + * @tc.name : get focus mode manual camera0 api + * @tc.desc : get focus mode manual camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); + camera0Input.getFocusMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(0); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); }) /** - * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api + * @tc.number : PHOTOOUTPUT_CAPTURE + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); + console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); } else { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); - photoOutputAsync.on("frameShutter", async (err, data) => { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); + photoOutputAsync.capture(async (err, data) => { if (!err) { - console.info(TAG + "frameShutter callback is success"); + console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); + console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } await sleep(1000); done(); @@ -1028,86 +2502,84 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : CAPTURE_SESSION_START_SUCCESS - * @tc.name : capture session start api - * @tc.desc : capture session start api + * @tc.number : SET_FOCUS_POINT_focus mode continuous + * @tc.name : set focus Point locked camera0 api + * @tc.desc : set focus Point locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate"); - captureSession.start(async (err, data) => { - console.info(TAG + "Entering captureSession.start success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED"); - } - console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here"); - await sleep(1000); - done(); - }) + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); + camera0Input.setFocusPoint(Point2, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + } await sleep(1000); done(); - } + }) + await sleep(1000); + done(); }) - //FLASH Function API scripts /** - * @tc.number : HAS_FLASH - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api + * @tc.number : GET_FOCUS_POINT_focus mode continuous + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('HAS_FLASH', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + camera0Input.getFocusPoint(async (err, data) => { if (!err) { - console.info(TAG + "Entering HAS_FLASH success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); - console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering HAS_FLASH FAILED" + err.message); + console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focus Point is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + } + else { expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } - console.info(TAG + "Entering HAS_FLASH ends here"); + await sleep(1000); + done(); }) await sleep(1000); done(); }) /** - * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED + * @tc.name : check if focus mode continuous is supported-camera0Input api + * @tc.desc : check if focus mode continuous is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); } } else { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED" + err.message); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1117,25 +2589,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FLASH_MODE_OPEN - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api + * @tc.number : SET_FOCUS_MODE_CONTINUOUS + * @tc.name : set focus mode continuous camera0 api + * @tc.desc : set focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FLASH_MODE_OPEN', 0, async function (done) { - console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); + camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED"); } else { - console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED" + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); } await sleep(1000); done(); @@ -1145,29 +2617,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FLASH_MODE_OPEN - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api + * @tc.number : GET_FOCUS_MODE_CONTINUOUS + * @tc.name : get focus mode continuous camera0 api + * @tc.desc : get focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FLASH_MODE_OPEN', 0, async function (done) { - console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate"); - camera0Input.getFlashMode(async (err, data) => { + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); + camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FLASH_MODE_OPEN success"); - if (data == 1) { - console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FLASH_MODE_OPEN PASSED"); - } + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_OPEN FAILED" + err.message); - console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); } await sleep(1000); done(); @@ -1177,28 +2647,58 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api + * @tc.number : PHOTOOUTPUT_CAPTURE + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); + photoOutputAsync.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : SET_FOCUS_POINT_focus mode auto + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); + camera0Input.setFocusPoint(Point3, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); } await sleep(1000); done(); @@ -1208,25 +2708,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FLASH_MODE_ALWAYS_OPEN - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api + * @tc.number : GET_FOCUS_POINT_focus mode auto + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + camera0Input.getFocusPoint(async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); + console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); } else { - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } await sleep(1000); done(); @@ -1236,29 +2737,87 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FLASH_MODE_ALWAYS_OPEN - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED + * @tc.name : check if focus mode auto is supported-camera0Input api + * @tc.desc : check if focus mode auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { - console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate"); - camera0Input.getFlashMode(async (err, data) => { + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_AUTO + * @tc.name : set focus mode auto camera0 api + * @tc.desc : set focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); + camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + if (data != null || data != undefined) { + expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") + } + } else { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_AUTO + * @tc.name : get focus mode auto camera0 api + * @tc.desc : get focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); + camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success"); - if (data == 3) { - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED"); - } + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(2); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message); - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -1268,30 +2827,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.number : PHOTOOUTPUT_CAPTURE * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); photoOutputAsync.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED" + err.message); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } await sleep(1000); done(); @@ -1302,28 +2861,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check if exposure mode locked is supported-camera0Input api + * @tc.desc : check if exposure mode locked is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS "); + console.info(TAG + "Entering Is Exposure Mode Locked supported SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); + console.info(TAG + "Entering Is Exposure Mode Locked supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Locked_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: "); } } else { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED" + err.message); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1333,25 +2892,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FLASH_MODE_CLOSE - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FLASH_MODE_CLOSE', 0, async function (done) { - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); + console.info(TAG + "Entering Set Exposure Mode Locked, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED FAILED") + expect().AssertFail(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); } await sleep(1000); done(); @@ -1361,60 +2919,56 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FLASH_MODE_CLOSE - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api + * @tc.number : GET_EXPOSURE_MODE_LOCKED + * @tc.name : get exposure mode locked camera0 api + * @tc.desc : get exposure mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FLASH_MODE_CLOSE', 0, async function (done) { - console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); - camera0Input.getFlashMode(async (err, data) => { + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); + camera0Input.getExposureMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); - if (data == 0) { - console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); - } + console.info(TAG + "Current ExposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED" + err.message); - console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); } - await sleep(1000) + await sleep(1000); done(); }) - await sleep(1000) - done() + await sleep(1000); + done(); }) /** - * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED + * @tc.name : check if exposure mode continuous auto is supported-camera0Input api + * @tc.desc : check if exposure mode continuous auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED SUCCESS "); + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED data is not null || undefined"); - console.info(TAG + "IS_FLASH_MODE_AUTO_SUPPORTED supported is: " + data); + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_continuous_Auto_Supported is: " + data); expect(data).assertEqual(false); - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: "); } } else { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED" + err.message); - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1424,24 +2978,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FLASH_MODE_AUTO - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FLASH_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS which is not supported: "); - console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED") - expect().assertFail(); + console.info(TAG + "Entering Set Exposure Mode continuous auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().AssertFail(); } else { - expect(true).assertTrue() - console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED: " + err.message); - console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } await sleep(1000); done(); @@ -1451,28 +3005,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : get exposure mode continuous auto camera0 api + * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + camera0Input.getExposureMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); - } - } else { - console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED" + err.message); + console.info(TAG + "Current ExposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); + } + else { expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } await sleep(1000); done(); @@ -1482,24 +3033,53 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FOCUS_MODE_LOCKED - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api + * @tc.number : GET_EXPOSURE_BIASRANGE + * @tc.name : get exposure bias range camera0 api + * @tc.desc : get exposure bias range camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + it('GET_EXPOSURE_BIASRANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASRANGE to operate"); + camera0Input.getExposureBiasRange(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Exposure bias range SUCCESS"); + console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_BIASRANGE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASRANGE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASRANGE ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_BIAS_exposure -4 + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(-4, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); + console.info(TAG + "Entering Set Exposure bias is: " + "-4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -1509,29 +3089,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FOCUS_MODE_LOCKED - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode locked + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); - camera0Input.getFocusMode(async (err, data) => { + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED SUCCESS: " + data); - if (data == 0) { - console.info(TAG + "GET_FOCUS_MODE_LOCKED data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); - } + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(-4); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -1541,28 +3118,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api + * @tc.number : SET_EXPOSURE_POINT_exposure mode auto + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + camera0Input.setExposurePoint(Point1, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); - } + console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -1572,25 +3145,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FOCUS_MODE_MANUAL - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api + * @tc.number : GET_EXPOSURE_POINT_exposure mode auto + * @tc.name : get exposure point camera0 api + * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + camera0Input.getExposurePoint(async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) + console.info(TAG + "Entering Get Exposure point SUCCESS"); + console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED" + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -1600,29 +3174,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FOCUS_MODE_MANUAL - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check if exposure mode auto is supported-camera0Input api + * @tc.desc : check if exposure mode auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); - camera0Input.getFocusMode(async (err, data) => { + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); - if (data == 0) { - console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); + console.info(TAG + "Entering Is Exposure Mode Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Auto_Supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: "); } - } - else { + } else { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1632,28 +3205,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED SUCCESS "); + console.info(TAG + "Entering Set Exposure Mode auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") } } else { - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -1663,25 +3234,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FOCUS_MODE_CONTINUOUS - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api + * @tc.number : GET_EXPOSURE_MODE_AUTO + * @tc.name : get exposure mode auto camera0 api + * @tc.desc : get exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); + camera0Input.getExposureMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") + console.info(TAG + "Entering Get Exposure Mode SUCCESS"); + console.info(TAG + "Get Exposure Mode data is not null || undefined: "); + console.info(TAG + "Current ExposureMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED" + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -1691,29 +3264,58 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FOCUS_MODE_CONTINUOUS - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api + * @tc.number : PHOTOOUTPUT_CAPTURE + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); - if (data == 1) { - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); + photoOutputAsync.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } - } - else { + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(1, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure bias is: " + "1"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -1723,28 +3325,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode auto + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); - } - } else { - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); + } + else { expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -1754,26 +3354,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FOCUS_MODE_AUTO - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api + * @tc.number : SET_EXPOSURE_POINT_exposure + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + camera0Input.setExposurePoint(Point2, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") - } + console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -1783,29 +3381,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FOCUS_MODE_AUTO - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api + * @tc.number : GET_EXPOSURE_POINT_ + * @tc.name : get exposure point camera0 api + * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); - camera0Input.getFocusMode(async (err, data) => { + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + camera0Input.getExposurePoint(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); - if (data == 2) { - console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); - } + console.info(TAG + "Entering Get Exposure point SUCCESS"); + console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -1815,64 +3410,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); photoOutputAsync.capture(photosettings1, async (err, data) => { if (!err) { - console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 FAILED" + err.message); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-90 & Quality-1 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with Rotation-90 & Quality-1 success"); + console.info(TAG + "Entering photoOutput capture with photosettings1"); if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-90 & Quality-1 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-90 & Quality-1 FAILED" + err.message); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-90 & Quality-1 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here"); } await sleep(1000); done(); @@ -1883,59 +3443,54 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-180 & Quality-2 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with Rotation-180 & Quality-2 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-180 & Quality-2 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-180 & Quality-2 FAILED" + err.message); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-180 & Quality-2 ends here"); - } - }) + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(4, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure bias is: " + "4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); + } await sleep(1000); done(); - } + }) + await sleep(1000); + done(); }) /** - * @tc.number : GET_ZOOM_RATIO - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode continuous auto + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_ZOOM_RATIO', 0, async function (done) { - console.info("--------------GET_ZOOM_RATIO--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data) - } - } else { + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(4); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); + } + else { expect().assertFail(); - console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } - console.info(TAG + "Entering GET_ZOOM_RATIO ends here"); await sleep(1000); done(); }) @@ -1944,233 +3499,203 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SET_GET_ZOOM_1_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_POINT + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + camera0Input.setExposurePoint(Point3, async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) + console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } + await sleep(1000); + done(); }) await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_2_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_POINT + * @tc.name : get exposure point camera0 api + * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + camera0Input.getExposurePoint(async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { + console.info(TAG + "Entering Get Exposure point SUCCESS"); + console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + } + else { expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } + await sleep(1000); + done(); }) await sleep(1000); done(); }) - /** - * @tc.number : SET_GET_ZOOM_3_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate"); + photoOutputAsync.capture(photosettings2, async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture with photosettings2"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); + expect(true).assertTrue(); } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } }) /** - * @tc.number : SET_GET_ZOOM_4_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_BIAS_exposure -5 + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(-5, async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) + console.info(TAG + "Entering Set Exposure bias is: " + "-4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } + await sleep(1000); + done(); }) await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_5_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode locked + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(-4); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); + } + else { expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } + await sleep(1000); + done(); }) await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_6_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_BIAS_exposure 6 + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(6, async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) + console.info(TAG + "Entering Set Exposure bias is: " + "4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } + await sleep(1000); + done(); }) await sleep(1000); done(); }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api + * @tc.number : GET_EXPOSURE_BIASVALUE + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with Rotation-270 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-270 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-270 FAILED" + err.message); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-270 ends here"); - } - }) + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(4); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); + } await sleep(1000); done(); - } + }) + await sleep(1000); + done(); }) /*CaptureSession APIs test script*/ @@ -2197,7 +3722,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Entering CAPTURE_SESSION_STOP FAILED" + err.message); + console.info(TAG + "Entering CAPTURE_SESSION_STOP FAILED : " + err.message); console.info(TAG + "Entering CAPTURE_SESSION_STOP ends here"); } await sleep(1000); diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets index 8c633f8239a0ee6fbe5be9d10ad8bc4bfa72ee0e..30a1e8f5e77c9fda3f92d58c2227b91458e98379 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets @@ -30,21 +30,46 @@ var photoOutputPromise; var CaptureSessionPromise; var surfaceId1; var camerasArrayPromise +var camera1InputPromise; + +var Point1 = { x: 1, y: 1 } +var Point2 = { x: 2, y: 2 } +var Point3 = { x: 3, y: 3 } var photosettings1 = { rotation: 0, quality: 0, + location: { + latitude: 12.9705, + longitude: 77.7329, + altitude: 920.0000, + }, } var photosettings2 = { rotation: 90, quality: 1, + location: { + latitude: 20, + longitude: 78, + altitude: 8586, + }, } + var photosettings3 = { - rotation: 180, quality: 2, + location: { + latitude: 0, + longitude: 0, + altitude: 0, + }, } var photosettings4 = { - rotation: 270 + rotation: 180, + location: { + latitude: -1, + longitude: -1, + altitude: -1, + }, } export default function cameraJSUnitPhotoPromise(surfaceId: any) { @@ -141,13 +166,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { it('GET_CAMERA_MANAGER_PROMISE', 0, async function (done) { console.info("--------------GET_CAMERA_MANAGER_PROMISE--------------"); cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); + console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); if (cameraManagerPromise != null && cameraManagerPromise != undefined) { expect(true).assertTrue(); console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE FAILED"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE FAILED : "); } console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE ends here"); await sleep(1000); @@ -164,12 +189,12 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('CAMERA_STATUS_CALLBACK', 0, async function (done) { if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK cameraManagerPromise == null || undefined') + console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') } else { console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK to operate') - cameraManagerPromise.on("cameraStatus", async (err, data) => { + cameraManagerPromise.on('cameraStatus', async (err, data) => { if (!err) { - console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); + console.info(TAG + "CAMERA_STATUS_CALLBACK cameraManagerPromise is success"); if (data != null || data != undefined) { console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); @@ -177,7 +202,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); + console.info(TAG + "CAMERA_STATUS_CALLBACK FAILED: " + err.message); } await sleep(1000); done(); @@ -198,25 +223,25 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { it('GET_CAMERAS_PROMISE', 0, async function (done) { console.info("--------------GET_CAMERAS_PROMISE--------------"); camerasArrayPromise = await cameraManagerPromise.getCameras(); - console.info(TAG + "Entering GET_CAMERAS_PROMISE: " + JSON.stringify(camerasArrayPromise)); + console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering GET_CAMERAS_PROMISE success"); + console.info(TAG + "Entering Get Cameras success"); for (var i = 0; i < camerasArrayPromise.length; i++) { // Get the variables from camera object var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering GET_CAMERAS_PROMISE camera" + i + "Id: " + cameraId); + console.info(TAG + "Entering Get Cameras camera" + i + "Id: " + cameraId); var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering GET_CAMERAS_PROMISE camera" + i + "Position: " + cameraPosition); + console.info(TAG + "Entering Get Cameras camera" + i + "Position: " + cameraPosition); var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering GET_CAMERAS_PROMISE camera" + i + "Type: " + cameraType); + console.info(TAG + "Entering Get Cameras camera" + i + "Type: " + cameraType); var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering GET_CAMERAS_PROMISE connection" + i + "Type: " + connectionType); + console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); console.info(TAG + "Entering GET_CAMERAS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering GET_CAMERAS_PROMISE FAILED"); + console.info(TAG + "Entering GET_CAMERAS_PROMISE FAILED : "); } console.info(TAG + "Entering GET_CAMERAS_PROMISE ends here"); await sleep(1000); @@ -236,14 +261,39 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info("--------------CAMERA-0 STARTS HERE--------------"); console.info("--------------CREATE_CAMERA_INPUT_PROMISE--------------"); camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); - console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE camera0InputPromise: " + JSON.stringify(camera0InputPromise)); + console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE camera0InputPromise is not null || undefined"); + console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE FAILED : "); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_PROMISE_Camera1 + * @tc.name : Create camerainput from camera-1 cameraId promise api + * @tc.desc : Create camerainput from camera-1 cameraId promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_PROMISE_Camera1', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_PROMISE--------------"); + camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); + console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); + if (camera1InputPromise != null && camera1InputPromise != undefined) { + console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); expect(true).assertTrue(); console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE FAILED"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE FAILED : "); } console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE ends here"); await sleep(1000); @@ -263,7 +313,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined"); } else { console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); - camera0InputPromise.on("error", async (err, data) => { + camera0InputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "camera0InputPromise error callback is success"); if (data != null || data != undefined) { @@ -272,7 +322,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "CAMERA_INPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -301,8 +351,8 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "Entering createPreviewOutput FAILED"); - console.info(TAG + "Entering createPreviewOutput ends here"); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE FAILED : "); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE ends here"); } await sleep(1000); done(); @@ -318,19 +368,19 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined"); + console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate"); - previewOutputPromise.on("error", async (err, data) => { + previewOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during PreviewOutput with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -362,13 +412,43 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE FAILED"); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE FAILED : "); console.info(TAG + "Entering createPhotoOutput ends here"); } await sleep(1000); done(); }) + /** + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + await photoOutputPromise.isMirrorSupported() + .then(function (data) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); + }); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + /** * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api @@ -379,14 +459,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); + console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); - photoOutputPromise.on("error", async (err, data) => { + photoOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "PhotoOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { @@ -403,26 +483,26 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { /*CaptureSession APIs test script*/ /** - * @tc.number : CREATE_CAPTURE_SESSION_SUCCESS_PROMISE + * @tc.number : CREATE_CAPTURE_SESSION_PROMISE * @tc.name : Create CaptureSession instance promise api * @tc.desc : Create Capturesession instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CREATE_CAPTURE_SESSION_SUCCESS_PROMISE', 0, async function (done) { - console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS_PROMISE to operate"); + it('CREATE_CAPTURE_SESSION_PROMISE', 0, async function (done) { + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE to operate"); CaptureSessionPromise = await cameraObj.createCaptureSession(null); console.info(TAG + "Entering createCaptureSession success"); if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { console.info(TAG + "Entering createCaptureSession data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering createCaptureSession PASSED"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS_PROMISE FAILED"); - console.info(TAG + "Entering createCaptureSession ends here"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE FAILED : "); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE ends here"); } await sleep(1000); done(); @@ -439,10 +519,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); + console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); } else { console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR to operate"); - CaptureSessionPromise.on("error", async (err, data) => { + CaptureSessionPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + " captureSession errorcallback is success"); if (data != null || data != undefined) { @@ -463,58 +543,58 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : CREATE_BEGIN_CONFIG_SUCCESS_PROMISE + * @tc.number : CREATE_BEGIN_CONFIG_PROMISE * @tc.name : CaptureSession_Begin config promise api * @tc.desc : CaptureSession_Begin config promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CREATE_BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { + it('CREATE_BEGIN_CONFIG_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); } else { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE to operate"); const promise = await CaptureSessionPromise.beginConfig(); console.info(TAG + "Entering beginConfig success:"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE beginConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE FAILED : "); } - console.info(TAG + "Entering beginConfig ends here"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE ends here"); } await sleep(1000); done(); }) /** - * @tc.number : ADD_INPUT_SUCCESS_PROMISE + * @tc.number : ADD_INPUT_PROMISE * @tc.name : Add Input with camera0Input api * @tc.desc : Add Input with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { + it('ADD_INPUT_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering Add Input captureSession == null || undefined"); } else { - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); - const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success"); + console.info(TAG + "Entering ADD_INPUT_PROMISE to operate"); + const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); + console.info(TAG + "Entering Add Input addInput success"); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); + console.info(TAG + "Entering ADD_INPUT_PROMISE addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE FAILED: "); + console.info(TAG + "Entering ADD_INPUT_PROMISE FAILED: "); } - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE ends here"); + console.info(TAG + "Entering ADD_INPUT_PROMISE ends here"); await sleep(1000); done(); } @@ -523,29 +603,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE + * @tc.number : ADD_OUTPUT_PREVIEW_PROMISE * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); } else { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE to operate"); const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); + console.info(TAG + "Entering Add preview Output : Success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE FAILED : "); } - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE ends here"); await sleep(1000); done(); } @@ -554,29 +634,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api + * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS + * @tc.name : Remove preview Output api + * @tc.desc : Remove preview Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { + it('REMOVE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); } else { - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); - if (promise == undefined) { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); + const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); + console.info(TAG + "Entering Remove preview Output success " + Promise); + if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1000); done(); } @@ -585,29 +665,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : REMOVE_INPUT_SUCCESS - * @tc.name : remove input api - * @tc.desc : remove input api + * @tc.number : ADD_OUTPUT_PREVIEW_PROMISE + * @tc.name : Add output with camera0Input api + * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('REMOVE_INPUT_SUCCESS', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); } else { - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); - const Promise = await CaptureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise); - if (Promise == undefined) { + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE to operate"); + const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); + console.info(TAG + "Entering Add preview Output : Success"); + if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE FAILED : "); } - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE ends here"); await sleep(1000); done(); } @@ -616,29 +696,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api + * @tc.number : COMMIT_CONFIG_SUCCESS + * @tc.name : commit config api + * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('REMOVE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering commit config captureSession == null || undefined"); } else { - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); - const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); - if (Promise == undefined) { + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); + const promise = await CaptureSessionPromise.commitConfig(); + console.info(TAG + "Entering commit config commitConfig success"); + if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1000); done(); } @@ -647,23 +727,201 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + await photoOutputPromise.isMirrorSupported() + .then(function (data) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); + }); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : setMirror_true + * @tc.name : setMirror true + * @tc.desc : setMirror true + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('setMirror_true', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering setMirror_true to operate"); + await photoOutputPromise.setMirror(true).then(function (data) { + console.info(TAG + "Entering setMirror_true is success:"); + console.info(TAG + "setMirror is : " + 'True'); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "setMirror_true FAILED : " + err.message); + }); + await sleep(2000); + done(); + } + await sleep(2000); + done(); + }) + + /** + * @tc.number : setMirror_false + * @tc.name : setMirror false + * @tc.desc : setMirror false + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('setMirror_false', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering setMirror_false to operate"); + await photoOutputPromise.setMirror(false) + .then(function (data) { + console.info(TAG + "Entering setMirror_false is success:"); + console.info(TAG + "setMirror is : " + 'false'); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "setMirror_false FAILED : " + err.message); + }); + await sleep(2000); + done(); + } + await sleep(2000); + done(); + }) + + /** + * @tc.number : setMirror_1 + * @tc.name : setMirror 1 + * @tc.desc : setMirror 1 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('setMirror_1', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering setMirror_1 to operate"); + await photoOutputPromise.setMirror(1) + .then(function (data) { + console.info(TAG + "Entering setMirror_1 is success:"); + console.info(TAG + "setMirror is : " + '1'); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "setMirror_1 FAILED : " + err.message); + }); + await sleep(2000); + done(); + } + await sleep(2000); + done(); + }) + + /** + * @tc.number : setMirror_0 + * @tc.name : setMirror 0 + * @tc.desc : setMirror 0 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('setMirror_0', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering setMirror_0 to operate"); + await photoOutputPromise.setMirror(0) + .then(function (data) { + console.info(TAG + "Entering setMirror_0 is success:"); + console.info(TAG + "setMirror is : " + '0'); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "setMirror_0 FAILED : " + err.message); + }); + await sleep(2000); + done(); + } + await sleep(2000); + done(); + }) + + /** + * @tc.number : CREATE_BEGIN_CONFIG_SUCCESS_PROMISE + * @tc.name : CaptureSession_Begin config promise api + * @tc.desc : CaptureSession_Begin config promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { + if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"); + const promise = await CaptureSessionPromise.beginConfig(); + console.info(TAG + "Entering beginConfig success:"); + if (promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering beginConfig FAILED"); + } + console.info(TAG + "Entering beginConfig ends here"); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : REMOVE_INPUT_SUCCESS + * @tc.name : remove input api + * @tc.desc : remove input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_INPUT_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); } else { console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); - const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); + const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); } else { expect().assertFail(); @@ -678,29 +936,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : ADD_INPUT_SUCCESS_PROMISE + * @tc.number : ADD_INPUT_PROMISE * @tc.name : Add Input with camera0Input api * @tc.desc : Add Input with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { + it('ADD_INPUT_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering Add Input captureSession == null || undefined"); } else { - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); + console.info(TAG + "Entering ADD_INPUT_PROMISE to operate"); const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success"); + console.info(TAG + "Entering Add Input addInput success"); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); + console.info(TAG + "Entering ADD_INPUT_PROMISE addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE FAILED: "); + console.info(TAG + "Entering ADD_INPUT_PROMISE FAILED: "); } - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE ends here"); + console.info(TAG + "Entering ADD_INPUT_PROMISE ends here"); await sleep(1000); done(); } @@ -709,29 +967,60 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); } else { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); + const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); + console.info(TAG + "Entering Add output with photo output success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS + * @tc.name : Remove photo Output api + * @tc.desc : Remove photo Output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); + const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); + if (Promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1000); done(); } @@ -760,7 +1049,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: "); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); } console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1000); @@ -780,18 +1069,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering commit config captureSession == null || undefined"); } else { console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig success"); + console.info(TAG + "Entering commit config commitConfig success"); if (promise == undefined) { expect(true).assertTrue(); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } await sleep(1000); @@ -801,6 +1090,70 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { done(); }) + /** + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : FocusStateChange callback api + * @tc.desc : FocusStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0InputPromise == null || camera0InputPromise == undefined) { + console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0InputPromise.on('focusStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "FocusState callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current FocusState is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : ExposureStateChange callback api + * @tc.desc : ExposureStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0InputPromise == null || camera0InputPromise == undefined) { + console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0InputPromise.on('exposureStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "ExposureStateChange callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current ExposureStateChange is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + // callback related API //preview callback /** @@ -813,10 +1166,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); + console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); - previewOutputPromise.on("frameStart", async (err, data) => { + previewOutputPromise.on('frameStart', async (err, data) => { if (!err) { console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { @@ -824,7 +1177,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED :" + err.message); } await sleep(1000); done(); @@ -844,10 +1197,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined"); + console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); - previewOutputPromise.on("frameEnd", async (err, data) => { + previewOutputPromise.on('frameEnd', async (err, data) => { if (!err) { console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END is success"); if (data != null || data != undefined) { @@ -876,14 +1229,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START photoOutput == null || undefined"); + console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); - photoOutputPromise.on("captureStart", async (err, data) => { + photoOutputPromise.on('captureStart', async (err, data) => { if (!err) { console.info(TAG + "CaptureStart Callback is success"); if (data != null || data != undefined) { - console.info(TAG + "captureStart success with captureId: " + data); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); expect(true).assertTrue(); } } else { @@ -908,10 +1261,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); + console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); - photoOutputPromise.on("captureEnd", async (err, data) => { + photoOutputPromise.on('captureEnd', async (err, data) => { if (!err) { console.info(TAG + "captureEnd callback is success"); if (data != null || data != undefined) { @@ -941,10 +1294,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); + console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); - photoOutputPromise.on("frameShutter", async (err, data) => { + photoOutputPromise.on('frameShutter', async (err, data) => { if (!err) { console.info(TAG + "frameShutter callback is success"); if (data != null || data != undefined) { @@ -974,7 +1327,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering capture session start captureSession == null || undefined"); } else { console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate"); await CaptureSessionPromise.start(); @@ -989,6 +1342,176 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { done(); }) + //Location + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputPromise.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); + await photoOutputPromise.capture(photosettings1) + .then(function (data) { + console.info(TAG + "Entering photoOutput capture with settings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED"); + expect(true).assertTrue(); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED:" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here"); + }); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate"); + await photoOutputPromise.capture(photosettings2) + .then(function (data) { + console.info(TAG + "Entering photoOutput capture with settings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); + expect(true).assertTrue(); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED:" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); + }); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 to operate"); + await photoOutputPromise.capture(photosettings3) + .then(function (data) { + console.info(TAG + "Entering photoOutput capture with settings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 PASSED"); + expect(true).assertTrue(); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 :" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 ends here"); + }); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 to operate"); + await photoOutputPromise.capture(photosettings4) + .then(function (data) { + console.info(TAG + "Entering photoOutput capture with settings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 PASSED"); + expect(true).assertTrue(); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 ends here"); + }); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + //FLASH Function API scripts /** * @tc.number : HAS_FLASH @@ -1009,7 +1532,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { expect(hasFlashPromise).assertEqual(true); } else { - console.info(TAG + "Entering HAS_FLASH FAILED"); + console.info(TAG + "Entering HAS_FLASH FAILED : "); expect().assertFail(); } console.info(TAG + "Entering HAS_FLASH ends here"); @@ -1036,7 +1559,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : "); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); } @@ -1059,9 +1582,9 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { if (SetFMOpen == undefined) { console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1) + expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED"); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : "); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } @@ -1089,7 +1612,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_OPEN FAILED"); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : "); console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1000); @@ -1115,7 +1638,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : "); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } @@ -1140,7 +1663,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) } else { - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED"); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : "); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } @@ -1168,7 +1691,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : "); console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1000); @@ -1190,11 +1713,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { if (isFMAutoSupported != null || isFMAutoSupported != undefined) { console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(false); + expect(isFMAutoSupported).assertEqual(true); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED : "); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } @@ -1203,32 +1726,52 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api + * @tc.number : SET_FLASH_MODE_AUTO + * @tc.name : set flash mode auto camera0 api + * @tc.desc : set flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); + var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) + if (SetFMAlwaysAuto == undefined) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - const promise = photoOutputPromise.capture(photosettings1); - console.info(TAG + "Entering photoOutput capture with photosettings1 success"); - if (promise != null || promise != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering photoOutput capture with photosettings1 PASSED"); - expect(true).assertTrue(); - } - else { - expect().assertFail(); - console.info(TAG + "Entering photoOutput capture with photosettings1 FAILED"); - console.info(TAG + "Entering photoOutput capture with photosettings1 ends here"); - } - await sleep(1000); - done(); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : "); + expect().assertFail(); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FLASH_MODE_AUTO + * @tc.name : get flash mode auto camera0 api + * @tc.desc : get flash mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); + var GetFMAuto = await camera0InputPromise.getFlashMode(); + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); + if (GetFMAuto == 2) { + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); + console.info(TAG + "Current FlashMode is: " + GetFMAuto); + expect(true).assertTrue(); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -1253,7 +1796,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED : "); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } @@ -1278,7 +1821,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) } else { - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED"); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : "); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } @@ -1306,383 +1849,1308 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED"); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED : "); console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } await sleep(1000); done(); }) - // FOCUS promise API's + //ZOOM Function /** - * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api + * @tc.number : GET_ZOOM_RATIO_PROMISE + * @tc.name : get zoom ratio camera-0 cameraId api promise api + * @tc.desc : get zoom ratio camera-0 cameraId api promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); - console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED: " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); - } - else { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED"); + it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO_PROMISE--------------"); + var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); + if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise)); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED"); + } else { expect().assertFail(); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED"); } + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_FOCUS_MODE_LOCKED - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api + * @tc.number : SET_GET_ZOOM_1_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); - var SetFMLocked = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "SetFMLocked: " + JSON.stringify(SetFMLocked)) - if (SetFMLocked == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - } else { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED"); + it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(1); + console.info(TAG + "setZoomRatio success: 1"); + console.info(TAG + "getZoomRatio called") + var getpromise1 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise1); + if (getpromise1 != null && getpromise1 != undefined) { + expect(getpromise1).assertEqual(1); + console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED "); + } + else { + console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : GET_FOCUS_MODE_LOCKED - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api + * @tc.number : SET_GET_ZOOM_2_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); - var GetFMLocked = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED success: " + GetFMLocked); - if (GetFMLocked == 0) { - console.info(TAG + "Current focusmode is: " + GetFMLocked); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); + it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(2); + console.info(TAG + "setZoomRatio success: 2"); + console.info(TAG + "getZoomRatio called") + var getpromise2 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise2); + if (getpromise2 != null && getpromise2 != undefined) { + expect(getpromise2).assertEqual(2); + console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED "); } else { + console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED"); - console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported + * @tc.number : SET_GET_ZOOM_3_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); + it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(3); + console.info(TAG + "setZoomRatio success: 3"); + console.info(TAG + "getZoomRatio called") + var getpromise3 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise3); + if (getpromise3 != null && getpromise3 != undefined) { + expect(getpromise3).assertEqual(3); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED "); } else { - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED"); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SET_FOCUS_MODE_MANUAL - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api + * @tc.number : SET_GET_ZOOM_4_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); - var setFocusManual = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "setFocusManual: " + JSON.stringify(setFocusManual)) - if (setFocusManual == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) + it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(4); + console.info(TAG + "setZoomRatio success: 4"); + console.info(TAG + "getZoomRatio called") + var getpromise4 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise4); + if (getpromise4 != null && getpromise4 != undefined) { + expect(getpromise4).assertEqual(4); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED "); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED"); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); } await sleep(1000); done(); }) /** - * @tc.number : GET_FOCUS_MODE_MANUAL - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api + * @tc.number : SET_GET_ZOOM_5_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); - if (getfocusmodepromise == 0) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); + it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(5); + console.info(TAG + "setZoomRatio success: 5"); + console.info(TAG + "getZoomRatio called") + var getpromise5 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise5); + if (getpromise5 != null && getpromise5 != undefined) { + expect(getpromise5).assertEqual(5); + console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED "); } else { + console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED"); - console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); } await sleep(1000); done(); }) /** - * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api + * @tc.number : SET_GET_ZOOM_6_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); + it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(6); + console.info(TAG + "setZoomRatio success: 6"); + console.info(TAG + "getZoomRatio called") + var getpromise6 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise6); + if (getpromise6 != null && getpromise6 != undefined) { + expect(getpromise6).assertEqual(6); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED "); } else { - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED"); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1000); done(); }) + // FOCUS promise API's /** - * @tc.number : SET_FOCUS_MODE_CONTINUOUS - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED + * @tc.name : check is focus mode locked supported-camera0Input api + * @tc.desc : check is focus mode locked supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); - var setFocusCont = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "setFocusCont: " + JSON.stringify(setFocusCont)) - if (setFocusCont == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); + var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering is focus mode locked supported SUCCESS "); + if (isFMLockedSupported != null || isFMLockedSupported != undefined) { + console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); + console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); + expect(isFMLockedSupported).assertEqual(false); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED"); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : GET_FOCUS_MODE_CONTINUOUS - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api + * @tc.number : SET_FOCUS_MODE_LOCKED + * @tc.name : set focus mode locked camera0 api + * @tc.desc : set focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); - if (getfocusmodepromise == 1) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) + .then(function (data) { + console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) + console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); + }); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_LOCKED + * @tc.name : get focus mode locked camera0 api + * @tc.desc : get focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode locked success: "); + if (data == 0) { + console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); + }); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCAL_LENGTH + * @tc.name : get focal length camera0 api + * @tc.desc : get focal length camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCAL_LENGTH', 0, async function (done) { + console.info(TAG + "Entering GET_FOCAL_LENGTH to operate"); + await camera0InputPromise.getFocalLength() + .then(function (data) { + console.info(TAG + "Current focallength is: " + JSON.stringify(data)); + expect(data).assertEqual(3.4600000381469727); + console.info(TAG + "GET_FOCAL_LENGTH PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCAL_LENGTH FAILED : " + err.message); + }); + console.info(TAG + "GET_FOCAL_LENGTH ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusPoint(Point1) + .then(function (data) { + console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + await camera0InputPromise.getFocusPoint() + .then(function (data) { + console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED: " + err.message); + }); + console.info(TAG + "GET_FOCUS_POINT ends here"); + await sleep(1000); + done(); + }) + + + /** + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED + * @tc.name : is focusmode manual supported + * @tc.desc : is focusmode manual supported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); + var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); + if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { + console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); + expect(isFMmanualSupportedpromise).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); } else { + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED"); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_MANUAL + * @tc.name : set focus mode manual camera0 api + * @tc.desc : set focus mode manual camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); + await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) + .then(function (data) { + console.info(TAG + "setFocusManual: " + JSON.stringify(data)) + console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_MANUAL + * @tc.name : get focus mode manual camera0 api + * @tc.desc : get focus mode manual camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode manual SUCCESS"); + if (data == 0) { + console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); + }); + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputPromise.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : SET_FOCUS_POINT + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusPoint(Point2) + .then(function (data) { + console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + await camera0InputPromise.getFocusPoint() + .then(function (data) { + console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED " + err.message); + }); + console.info(TAG + "GET_FOCUS_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED + * @tc.name : check is focus mode continuous supported-camera0Input api + * @tc.desc : check is focus mode continuous supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); + var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { + console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); + expect(isFMContinuousSupportedpromise).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); + } + else { + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_CONTINUOUS + * @tc.name : set focus mode continuous camera0 api + * @tc.desc : set focus mode continuous camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); + await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) + .then(function (data) { + console.info(TAG + "setFocusCont: " + JSON.stringify(data)) + console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_CONTINUOUS + * @tc.name : get focus mode continuous camera0 api + * @tc.desc : get focus mode continuous camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode continuous SUCCESS"); + if (data == 1) { + console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED: " + err.message); + }); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputPromise.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : SET_FOCUS_POINT + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusPoint(Point3) + .then(function (data) { + console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + await camera0InputPromise.getFocusPoint() + .then(function (data) { + console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED: " + err.message); + }); + console.info(TAG + "GET_FOCUS_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED + * @tc.name : check is focus mode auto supported-camera0Input api + * @tc.desc : check is focus mode auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); + var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); + if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { + console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); + console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); + expect(isFMAutoSupportedpromise).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); + } + else { + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_AUTO + * @tc.name : set focus mode auto camera0 api + * @tc.desc : set focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); + var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) + .then(function () { + console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) + console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_AUTO + * @tc.name : get focus mode auto camera0 api + * @tc.desc : get focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); + if (data == 2) { + console.info(TAG + "Current FocusMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); + } + }) + .catch((err) => { + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); + }); + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputPromise.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check is exposure mode locked supported-camera0Input api + * @tc.desc : check is exposure mode locked supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: " + data); + expect(data).assertEqual(false); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked FAILED") + expect().assertFail() + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED + * @tc.name : get exposure mode locked camera0 api + * @tc.desc : get exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); + await camera0InputPromise.getExposureMode() + .then(function (data) { + console.info(TAG + "Entering get exposure mode locked SUCCESS"); + console.info(TAG + "Current ExposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED + * @tc.name : check is exposure mode continuous auto supported-camera0Input api + * @tc.desc : check is exposure mode continuous auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: " + data); + expect(data).assertEqual(false); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : get exposure mode continuous auto camera0 api + * @tc.desc : get exposure mode continuous auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.getExposureMode() + .then(function (data) { + console.info(TAG + "Entering get exposure mode auto SUCCESS"); + console.info(TAG + "Current exposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_BIAS_RANGE + * @tc.name : get exposure bias range camera0 api + * @tc.desc : get exposure bias range camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_BIAS_RANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_RANGE to operate"); + await camera0InputPromise.getExposureBiasRange() + .then(function (data) { + console.info(TAG + "Entering getExposureBiasRange SUCCESS"); + console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_BIAS_RANGE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIAS_RANGE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIAS_RANGE ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_BIAS_-4 + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(-4) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_BIAS_VALUE + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(-4); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_POINT + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + await camera0InputPromise.setExposurePoint(Point1) + .then(function (data) { + console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED: " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_POINT + * @tc.name : get exposure Point camera0 api + * @tc.desc : get exposure Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + await camera0InputPromise.getExposurePoint() + .then(function (data) { + console.info(TAG + "Entering getExposurePoint SUCCESS"); + console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED: " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check is exposure mode auto supported-camera0Input api + * @tc.desc : check is exposure mode auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: " + data); + expect(data).assertEqual(true); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED: " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_MODE_AUTO + * @tc.name : get exposure mode auto camera0 api + * @tc.desc : get exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); + await camera0InputPromise.getExposureMode() + .then(function (data) { + console.info(TAG + "Entering get exposure mode auto SUCCESS"); + console.info(TAG + "Current exposureMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED: " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputPromise.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); } - await sleep(1000); - done(); }) /** - * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api + * @tc.number : SET_EXPOSURE_BIAS + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); - } - else { - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED"); - expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); - } + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(1) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_FOCUS_MODE_AUTO - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api + * @tc.number : GET_EXPOSURE_BIAS_VALUE + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - if (setFocusAuto == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - } - else { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED"); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); - } + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : GET_FOCUS_MODE_AUTO - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api + * @tc.number : SET_EXPOSURE_POINT + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED"); - console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); - } + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + await camera0InputPromise.setExposurePoint(Point2) + .then(function (data) { + console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-90 & Quality-1 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api + * @tc.number : GET_EXPOSURE_POINT + * @tc.name : get exposure Point camera0 api + * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - const promise = photoOutputPromise.capture(photosettings2); - console.info(TAG + "Entering photoOutput capture with photosettings2 success"); - if (promise != null || promise != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering photoOutput capture with photosettings2 PASSED"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + await camera0InputPromise.getExposurePoint() + .then(function (data) { + console.info(TAG + "Entering getExposurePoint SUCCESS"); + console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - } - else { + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + }) + .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering photoOutput capture with photosettings2 FAILED"); - console.info(TAG + "Entering photoOutput capture with photosettings2 ends here"); - } - await sleep(1000); - done(); - } + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-180 & Quality-2 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - const promise = photoOutputPromise.capture(photosettings3); - console.info(TAG + "Entering photoOutput capture with photosettings3 success"); - if (promise != null || promise != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering photoOutput capture with photosettings3 PASSED"); - expect(true).assertTrue(); - } - else { - expect().assertFail(); - console.info(TAG + "Entering photoOutput capture with photosettings3 FAILED"); - console.info(TAG + "Entering photoOutput capture with photosettings3 ends here"); - } + await photoOutputPromise.capture(photosettings1) + .then(function (data) { + console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 PASSED"); + expect(true).assertTrue(); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 FAILED:" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 ends here"); + }); await sleep(1000); done(); } @@ -1691,248 +3159,239 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api + * @tc.number : SET_EXPOSURE_BIAS + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - const promise = photoOutputPromise.capture(photosettings4); - console.info(TAG + "Entering photoOutput capture with photosettings4 success"); - if (promise != null || promise != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering photoOutput capture with photosettings4 PASSED"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(4) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); - } - else { + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering photoOutput capture with photosettings4 FAILED"); - console.info(TAG + "Entering photoOutput capture with photosettings4 ends here"); - } - await sleep(1000); - done(); - } + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) - //ZOOM Function /** - * @tc.number : GET_ZOOM_RATIO_PROMISE - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api + * @tc.number : GET_EXPOSURE_BIAS_VALUE + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) { - console.info("--------------GET_ZOOM_RATIO_PROMISE--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED"); - } - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here"); + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(4); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_1_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_POINT + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED"); - expect().assertFail(); - } + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + await camera0InputPromise.setExposurePoint(Point3) + .then(function (data) { + console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_2_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_POINT + * @tc.name : get exposure Point camera0 api + * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED"); - expect().assertFail(); - } + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + await camera0InputPromise.getExposurePoint() + .then(function (data) { + console.info(TAG + "Entering getExposurePoint SUCCESS"); + console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_3_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 + * @tc.name : Photo output capture with photosettings api + * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED"); - expect().assertFail(); + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); + await photoOutputPromise.capture(photosettings2) + .then(function (data) { + console.info(TAG + "Entering photoOutput capture with location settings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); + expect(true).assertTrue(); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); + }); + await sleep(1000); + done(); } await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_4_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_BIAS_-5 + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED"); - expect().assertFail(); - } + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(-5) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_5_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_BIAS_VALUE + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED"); - expect().assertFail(); - } + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(-4); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SET_GET_ZOOM_6_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_BIAS_6 + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED"); - expect().assertFail(); - } + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(6) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api + * @tc.number : GET_EXPOSURE_BIAS_VALUE + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - const promise = photoOutputPromise.capture(photosettings1); - console.info(TAG + "Entering photoOutput capture with photosettings1 success"); - if (promise != null || promise != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering photoOutput capture with photosettings1 PASSED"); - expect(true).assertTrue(); - } - else { + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(4); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); + }) + .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering photoOutput capture with photosettings1 FAILED"); - } - console.info(TAG + "Entering photoOutput capture with photosettings1 ends here"); - await sleep(1000); - done(); - } + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) @@ -1948,11 +3407,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('CAPTURE_SESSION_STOP_SUCCESS_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering capture session stop captureSession == null || undefined"); } else { console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE to operate"); - const Promise = await CaptureSessionPromise.stop(); - console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop promise: " + JSON.stringify(Promise)); + await CaptureSessionPromise.stop(); expect(true).assertTrue(); console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop PASSED"); console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop ends here"); @@ -1973,16 +3431,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering capture session release captureSession == null || undefined"); } else { console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await CaptureSessionPromise.release(); - console.info(TAG + "Entering captureSession.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering captureSession.release PASSED"); - } - console.info(TAG + "Entering captureSession.release ends here"); + await CaptureSessionPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } @@ -2000,16 +3455,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined"); + console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); } else { console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await previewOutputPromise.release(); - console.info(TAG + "Entering previewOutputPromise.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutputPromise.release PASSED"); - } - console.info(TAG + "Entering previewOutputPromise.release ends here"); + await previewOutputPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } @@ -2027,16 +3479,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE photoOutputPromise == null || undefined"); + console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); } else { console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await photoOutputPromise.release(); - console.info(TAG + "Entering photoOutputPromise.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering photoOutputPromise.release PASSED"); - } - console.info(TAG + "Entering photoOutputPromise.release ends here"); + await photoOutputPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } @@ -2054,16 +3503,13 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { */ it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE camera0InputPromise == null || undefined"); + console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); } else { console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await camera0InputPromise.release(); - console.info(TAG + "Entering camera0InputPromise.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering camera0InputPromise.release PASSED"); - } - console.info(TAG + "Entering camera0InputPromise.release ends here"); + await camera0InputPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISEPASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets index 183c91a45837accd2252927622a6a29e1749c090..2b635d2d613955eb77aa9642718bc08e0698730a 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets @@ -13,8 +13,9 @@ * limitations under the License. */ -import cameraObj from '@ohos.multimedia.camera' +import cameraObj from '@ohos.multimedia.camera'; import media from '@ohos.multimedia.media' +import image from '@ohos.multimedia.image'; import mediaLibrary from '@ohos.multimedia.mediaLibrary' import fileio from '@ohos.fileio'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl' @@ -23,12 +24,51 @@ import bundle from '@ohos.bundle' // @ts-nocheck import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; -let TAG = 'CameraModuleTest: ' +let TAG = "CameraModuleTest: "; var cameraManager var camerasArray var camera0Input var previewOutput +var photoOutputAsync var videoRecorder +var surfaceId1 +var Point = { x: 1, y: 1 } +var photosettings1 = { + rotation: 0, + quality: 0, + location: { + latitude: 12.9705, + longitude: 77.7329, + altitude: 920.0000, + }, +} +var photosettings2 = { + rotation: 90, + quality: 1, + location: { + latitude: 20, + longitude: 78, + altitude: 8586, + }, +} + +var photosettings3 = { + quality: 2, + location: { + latitude: 0, + longitude: 0, + altitude: 0, + }, +} +var photosettings4 = { + rotation: 180, + location: { + latitude: -1, + longitude: -1, + altitude: -1, + }, +} + let fdPath; let fileAsset; let fdNumber; @@ -50,7 +90,7 @@ let videoConfig = { audioSourceType: 1, videoSourceType: 0, profile: configFile, - url: 'file:///data/media/01.mp4', + url: 'file:///data/media/02.mp4', orientationHint: 0, location: { latitude: 30, longitude: 130 }, maxSize: 100, @@ -61,6 +101,20 @@ var videoOutput var captureSession export default function cameraJSUnitVideoAsync(surfaceId: any) { + + async function getImageReceiverSurfaceId() { + console.log(TAG + 'Entering create Image receiver') + var receiver = image.createImageReceiver(640, 480, 4, 8) + console.log(TAG + 'before receiver check') + if (receiver !== undefined) { + console.log(TAG + 'Receiver is ok') + surfaceId1 = await receiver.getReceivingSurfaceId() + console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) + } else { + console.log(TAG + 'Receiver is not ok') + } + } + function sleep(time) { return new Promise((resolve, reject) => { setTimeout(() => { @@ -198,9 +252,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1) cameraObj.getCameraManager(null, (err, data) => { if (!err) { - console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC success') + console.info(TAG + 'Entering Get Camera manager success') if (data != null || data != undefined) { - console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC data is not null || undefined') + console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') cameraManager = data expect(true).assertTrue() console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC PASSED') @@ -229,7 +283,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK cameraManager == null || undefined') } else { console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK to operate') - cameraManager.on("cameraStatus", async (err, data) => { + cameraManager.on('cameraStatus', async (err, data) => { if (!err) { console.info(TAG + "Camera status Callback on cameraManager is success"); if (data != null || data != undefined) { @@ -262,21 +316,21 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1) cameraManager.getCameras((err, data) => { if (!err) { - console.info(TAG + 'Entering GET_CAMERAS success') + console.info(TAG + 'Entering Get Cameras success') if (data != null || data != undefined) { - console.info(TAG + 'Entering GET_CAMERAS data is not null || undefined') + console.info(TAG + 'Entering Get Cameras data is not null || undefined') camerasArray = data if (camerasArray != null && camerasArray.length > 0) { for (var i = 0; i < camerasArray.length; i++) { // Get the variables from camera object var cameraId = camerasArray[i].cameraId - console.info(TAG + 'Entering GET_CAMERAS camera' + i + 'Id: ' + cameraId) + console.info(TAG + 'Entering Get Cameras camera' + i + 'Id: ' + cameraId) var cameraPosition = camerasArray[i].cameraPosition - console.info(TAG + 'Entering GET_CAMERAS camera' + i + 'Position: ' + cameraPosition) + console.info(TAG + 'Entering Get Cameras camera' + i + 'Position: ' + cameraPosition) var cameraType = camerasArray[i].cameraType - console.info(TAG + 'Entering GET_CAMERAS camera' + i + 'Type: ' + cameraType) + console.info(TAG + 'Entering Get Cameras camera' + i + 'Type: ' + cameraType) var connectionType = camerasArray[i].connectionType - console.info(TAG + 'Entering GET_CAMERAS connection' + i + 'Type: ' + connectionType) + console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) } expect(true).assertTrue() console.info(TAG + 'Entering GET_CAMERAS PASSED') @@ -312,7 +366,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { if (!err) { if (data != null && data != undefined) { - console.info(TAG + 'Entering CREATE_CAMERA_INPUT data is not null || undefined') + console.info(TAG + 'Entering Create camera input data is not null || undefined') camera0Input = data expect(true).assertTrue() console.info(TAG + 'Entering CREATE_CAMERA_INPUT PASSED with CameraID :' + camerasArray[0].cameraId) @@ -338,19 +392,19 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0Input == null || undefined"); + console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); } else { console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); - camera0Input.on("error", async (err, data) => { + camera0Input.on('error', async (err, data) => { if (!err) { console.info(TAG + "camera0Input error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during camera0Input with ErrorCode: " + data.code); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "CAMERA_INPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -373,9 +427,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1) cameraObj.createPreviewOutput(surfaceId, (err, data) => { if (!err) { - console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT success') + console.info(TAG + 'Entering Create preview output success') if (data != null || data != undefined) { - console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT data is not null || undefined') + console.info(TAG + 'Entering Create preview output data is not null || undefined') previewOutput = data expect(true).assertTrue() console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT PASSED') @@ -401,19 +455,115 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutput == null || undefined"); + console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate"); - previewOutput.on("error", async (err, data) => { + previewOutput.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during PreviewOutput with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /*PhotoOutput APIs test script*/ + /** + * @tc.number : CREATE_PHOTO_OUTPUT_SUCCESS + * @tc.name : Create PhotoOutput instance api + * @tc.desc : Create PhotoOutput instance api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS to operate"); + console.info(TAG + 'Entering getImageReceiverSurfaceId') + await getImageReceiverSurfaceId() + await sleep(1) + cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { + if (!err) { + console.info(TAG + "Entering createPhotoOutput success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); + photoOutputAsync = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering createPhotoOutput ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + photoOutputAsync.isMirrorSupported(async (err, data) => { + if (!err) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + } else { + expect().assertFail(); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR + * @tc.name : Photo output callback on error api + * @tc.desc : Photo output callback on error api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); + photoOutputAsync.on('error', async (err, data) => { + if (!err) { + console.info(TAG + "PhotoOutputError callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -437,9 +587,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(2) cameraObj.createVideoOutput(videoId, (err, data) => { if (!err) { - console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT success') + console.info(TAG + 'Entering Create videooutput success') if (data != null || data != undefined) { - console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT data is not null || undefined') + console.info(TAG + 'Entering Create videooutput data is not null || undefined') videoOutput = data expect(true).assertTrue() console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT PASSED') @@ -473,7 +623,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "VideoOutput Errorcallback is success") if (data != null || data != undefined) { - console.info(TAG + "Error during videoOutput with ErrorCode: " + data.code); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue() } } else { @@ -501,9 +651,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1) cameraObj.createCaptureSession(null, async (err, data) => { if (!err) { - console.info(TAG + 'Entering CREATE_CAPTURE_SESSION success') + console.info(TAG + 'Entering Create capturesession success') if (data != null || data != undefined) { - console.info(TAG + 'Entering CREATE_CAPTURE_SESSION data is not null || undefined') + console.info(TAG + 'Entering Create capturesession data is not null || undefined') captureSession = data expect(true).assertTrue() console.info(TAG + 'Entering CREATE_CAPTURE_SESSION PASSED') @@ -533,16 +683,16 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); } else { console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR to operate"); - captureSession.on("error", async (err, data) => { + captureSession.on('error', async (err, data) => { if (!err) { console.info(TAG + " captureSession errorcallback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error in CaptureSessioncallback with ErrorCode: " + data.code); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Error in CaptureSessioncallback FAILED: " + err.message); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -554,21 +704,21 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { /** * @tc.number : BEGIN_CONFIG - * @tc.name : Create capturesession async api - * @tc.desc : Create capturesession async api + * @tc.name : Begin Config async api + * @tc.desc : Begin Config async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ it('BEGIN_CONFIG', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering BEGIN_CONFIG captureSession == null || undefined') + console.info(TAG + 'Entering Begin Config captureSession == null || undefined') } else { console.info(TAG + 'Entering BEGIN_CONFIG to operate') await sleep(1) captureSession.beginConfig((err, data) => { if (!err) { - console.info(TAG + 'Entering BEGIN_CONFIG success') + console.info(TAG + 'Entering Begin Config success') expect(true).assertTrue() console.info(TAG + 'Entering BEGIN_CONFIG PASSED') } else { @@ -593,13 +743,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('ADD_INPUT', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering ADD_INPUT captureSession == null || undefined') + console.info(TAG + 'Entering AddInput captureSession == null || undefined') } else { console.info(TAG + 'Entering ADD_INPUT to operate') await sleep(1) captureSession.addInput(camera0Input, (err, data) => { if (!err) { - console.info(TAG + 'Entering ADD_INPUT success') + console.info(TAG + 'Entering AddInput success') expect(true).assertTrue() console.info(TAG + 'Entering ADD_INPUT PASSED') } else { @@ -624,13 +774,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('ADD_OUTPUT_PREVIEW', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW captureSession == null || undefined') + console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') } else { console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW to operate') await sleep(1) captureSession.addOutput(previewOutput, (err, data) => { if (!err) { - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW success') + console.info(TAG + 'Entering AddOutput preview success') expect(true).assertTrue() console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW PASSED') } else { @@ -645,6 +795,40 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + /** + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); + captureSession.addOutput(photoOutputAsync, async (err, data) => { + if (!err) { + console.info(TAG + "Entering AddOutput_Photo success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + /** * @tc.number : ADD_OUTPUT_VIDEO * @tc.name : AddOutput video async api @@ -655,13 +839,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('ADD_OUTPUT_VIDEO', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO captureSession == null || undefined') + console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') } else { console.info(TAG + 'Entering ADD_OUTPUT_VIDEO to operate') await sleep(1) captureSession.addOutput(videoOutput, async (err, data) => { if (!err) { - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO success') + console.info(TAG + 'Entering AddOutput video success') expect(true).assertTrue() console.info(TAG + 'Entering ADD_OUTPUT_VIDEO PASSED') } else { @@ -676,7 +860,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done() } }) - /** * @tc.number : REMOVE_INPUT_SUCCESS * @tc.name : remove input api @@ -739,6 +922,38 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + /** + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS + * @tc.name : Remove photo Output api + * @tc.desc : Remove photo Output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS to operate"); + captureSession.removeOutput(photoOutputAsync, async (err, data) => { + if (!err) { + console.info(TAG + "Entering remove photo Output success"); + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering Remove photo Output FAILED" + err.message); + console.info(TAG + "Entering Remove photo Output ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + } + done(); + }) + /** * @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS * @tc.name : Remove video Output api @@ -771,29 +986,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : ADD_INPUT1 + * @tc.number : ADD_INPUT * @tc.name : AddInput async api * @tc.desc : AddInput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_INPUT1', 0, async function (done) { + it('ADD_INPUT', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering ADD_INPUT1 captureSession == null || undefined') + console.info(TAG + 'Entering AddInput captureSession == null || undefined') } else { - console.info(TAG + 'Entering ADD_INPUT1 to operate') + console.info(TAG + 'Entering ADD_INPUT to operate') await sleep(1) captureSession.addInput(camera0Input, (err, data) => { if (!err) { - console.info(TAG + 'Entering ADD_INPUT1 success') + console.info(TAG + 'Entering AddInput success') expect(true).assertTrue() - console.info(TAG + 'Entering ADD_INPUT1 PASSED') + console.info(TAG + 'Entering ADD_INPUT PASSED') } else { - console.info(TAG + 'Entering ADD_INPUT1 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_INPUT FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering ADD_INPUT1 ends here') + console.info(TAG + 'Entering ADD_INPUT ends here') done() }) await sleep(1) @@ -802,30 +1017,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : ADD_OUTPUT_PREVIEW1 + * @tc.number : ADD_OUTPUT_PREVIEW * @tc.name : AddOutput preview async api * @tc.desc : AddOutput preview async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_PREVIEW1', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 captureSession == null || undefined') + console.info(TAG + 'Entering AddOutput captureSession == null || undefined') } else { - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 to operate') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW to operate') await sleep(1) captureSession.addOutput(previewOutput, (err, data) => { if (!err) { - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 success') - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 data is not null || undefined') + console.info(TAG + 'Entering AddOutput success') + console.info(TAG + 'Entering AddOutput data is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 PASSED') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW PASSED') } else { - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW1 ends here') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW ends here') done() }) await sleep(1) @@ -834,30 +1049,64 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : ADD_OUTPUT_VIDEO1 + * @tc.number : ADD_OUTPUT_PHOTO + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_OUTPUT_PHOTO', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO to operate"); + captureSession.addOutput(photoOutputAsync, async (err, data) => { + if (!err) { + console.info(TAG + "Entering AddOutput_Photo success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO FAILED: " + err.message); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO ends here"); + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : ADD_OUTPUT_VIDEO * @tc.name : AddOutput video async api * @tc.desc : AddOutput video async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('ADD_OUTPUT_VIDEO1', 0, async function (done) { + it('ADD_OUTPUT_VIDEO', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 captureSession == null || undefined') + console.info(TAG + 'Entering AddOutput captureSession == null || undefined') } else { - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 to operate') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO to operate') await sleep(1) captureSession.addOutput(videoOutput, (err, data) => { if (!err) { - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 success') - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 data is not null || undefined') + console.info(TAG + 'Entering AddOutput success') + console.info(TAG + 'Entering AddOutput data is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 PASSED') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO PASSED') } else { - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 ends here') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO ends here') done() }) await sleep(1) @@ -875,14 +1124,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('COMMIT_CONFIG', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering COMMIT_CONFIG captureSession == null || undefined') + console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') } else { console.info(TAG + 'Entering COMMIT_CONFIG to operate') await sleep(1) captureSession.commitConfig(async (err, data) => { if (!err) { - console.info(TAG + 'Entering COMMIT_CONFIG success') - console.info(TAG + 'Entering COMMIT_CONFIG data is not null || undefined') + console.info(TAG + 'Entering CommitConfig success') + console.info(TAG + 'Entering CommitConfig data is not null || undefined') expect(true).assertTrue() console.info(TAG + 'Entering COMMIT_CONFIG PASSED') } else { @@ -898,6 +1147,70 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + /** + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : FocusStateChange callback api + * @tc.desc : FocusStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0Input == null || camera0Input == undefined) { + console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0Input.on('focusStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "FocusState callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current FocusState is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : ExposureStateChange callback api + * @tc.desc : ExposureStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0Input == null || camera0Input == undefined) { + console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0Input.on('exposureStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "ExposureStateChange callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current ExposureStateChange is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + //callback API /** * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START @@ -909,18 +1222,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); + console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); - previewOutput.on("frameStart", async (err, data) => { + previewOutput.on('frameStart', async (err, data) => { if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "PreviewStart frameStart Callback FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1); done(); @@ -940,10 +1253,10 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutput == null || undefined"); + console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); - previewOutput.on("frameEnd", async (err, data) => { + previewOutput.on('frameEnd', async (err, data) => { if (!err) { console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END is success"); if (data != null || data != undefined) { @@ -961,28 +1274,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + //Capture callback /** - * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START + * @tc.name : Photo capture callback on capture start api + * @tc.desc : Photo capture callback on capture start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START videoOutput == null || undefined"); + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); } else { - console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate"); - videoOutput.on("frameStart", async (err, data) => { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); + photoOutputAsync.on('captureStart', async (err, data) => { if (!err) { - console.info(TAG + "Video frameStart Callback is success"); + console.info(TAG + "Photo Capture Callback on CaptureStart is success"); if (data != null || data != undefined) { + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Video frameStart Callback is FAILED" + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); } await sleep(1); done(); @@ -993,28 +1308,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END + * @tc.name : Photo capture callback on capture end api + * @tc.desc : Photo capture callback on capture end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END videoOutput == null || undefined') + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); } else { - console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate') - await sleep(1) - videoOutput.on('frameEnd', async (err, data) => { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); + photoOutputAsync.on('captureEnd', async (err, data) => { if (!err) { - console.info(TAG + 'Video frameEnd callback is success'); + console.info(TAG + "captureEnd callback is success"); if (data != null || data != undefined) { - expect(true).assertTrue() + console.info(TAG + "captureEnd callback with captureId: " + data.captureId); + console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); + expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + 'Video frameEnd callback FAILED' + err.message); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); } await sleep(1); done(); @@ -1025,59 +1341,188 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : CAPTURE_SESSION_START - * @tc.name : CaptureSession start async api - * @tc.desc : CaptureSession start async api + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER + * @tc.name : Photo capture callback on frame shutter api + * @tc.desc : Photo capture callback on frame shutter api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CAPTURE_SESSION_START', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CAPTURE_SESSION_START captureSession == null || undefined") + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); } else { - console.info(TAG + "Entering CAPTURE_SESSION_START to operate") - await sleep(1) - captureSession.start(async (err, data) => { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); + photoOutputAsync.on('frameShutter', async (err, data) => { if (!err) { - console.info(TAG + "Entering CAPTURE_SESSION_START success") - expect(true).assertTrue() - console.info(TAG + "Entering CAPTURE_SESSION_START PASSED") + console.info(TAG + "frameShutter callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "frameShutter callback with captureId: " + data.captureId); + console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); + expect(true).assertTrue(); + } } else { - console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message) expect().assertFail(); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); } - console.info(TAG + 'Entering CAPTURE_SESSION_START ends here') - await sleep(1) - done() + await sleep(1); + done(); }) - await sleep(1) - done() + await sleep(1); + done(); } }) - //FLASH Function API scripts /** - * @tc.number : HAS_FLASH - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START + * @tc.name : VideoOutput callback onframestart async api + * @tc.desc : VideoOutput callback onframestart async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('HAS_FLASH', 0, async function (done) { - console.info("--------------HAS_FLASH--------------"); - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering HAS_FLASH success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); - console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); + it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { + if (videoOutput == null || videoOutput == undefined) { + console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); + } else { + console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate"); + videoOutput.on('frameStart', async (err, data) => { + if (!err) { + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_FRAME_START is success"); + if (data != null || data != undefined) { + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_FRAME_START is FAILED : " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END + * @tc.name : VideoOutput callback onframeend async api + * @tc.desc : VideoOutput callback onframeend async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { + if (videoOutput == null || videoOutput == undefined) { + console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') + } else { + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate') + await sleep(1) + videoOutput.on('frameEnd', async (err, data) => { + if (!err) { + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END is success'); + if (data != null || data != undefined) { + expect(true).assertTrue() + } + } else { + expect().assertFail(); + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END FAILED' + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : CAPTURE_SESSION_START + * @tc.name : CaptureSession start async api + * @tc.desc : CaptureSession start async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CAPTURE_SESSION_START', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") + } else { + console.info(TAG + "Entering CAPTURE_SESSION_START to operate") + await sleep(1) + captureSession.start(async (err, data) => { + if (!err) { + console.info(TAG + "Entering CaptureSession start success") + expect(true).assertTrue() + console.info(TAG + "Entering CAPTURE_SESSION_START PASSED") + } else { + console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message) + expect().assertFail(); + } + console.info(TAG + 'Entering CAPTURE_SESSION_START ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + } + }) + + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); + photoOutputAsync.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + //FLASH Function API scripts + /** + * @tc.number : HAS_FLASH + * @tc.name : check if has flash-camera0Input api + * @tc.desc : check if has flash-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('HAS_FLASH', 0, async function (done) { + console.info(TAG + "hasFlash called.") + camera0Input.hasFlash(async (err, data) => { + if (!err) { + console.info(TAG + "Entering HAS_FLASH success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); expect(data).assertEqual(true); } } else { - console.info(TAG + "Entering HAS_FLASH FAILED" + err.message); + console.info(TAG + "Entering HAS_FLASH FAILED : " + err.message); expect().assertFail(); } console.info(TAG + "Entering HAS_FLASH ends here"); @@ -1106,7 +1551,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : " + err.message); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); } @@ -1131,10 +1576,10 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1) + expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED" + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : " + err.message); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } @@ -1167,7 +1612,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_OPEN FAILED" + err.message); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : " + err.message); console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1); @@ -1197,7 +1642,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : " + err.message); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } @@ -1222,10 +1667,10 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) + expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); } else { - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } @@ -1258,7 +1703,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1); @@ -1267,7 +1712,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) - /** * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.name : check if flash mode auto is supported-camera0Input api @@ -1280,15 +1724,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED SUCCESS "); + console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); if (data != null || data != undefined) { console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED data is not null || undefined"); - console.info(TAG + "IS_FLASH_MODE_AUTO_SUPPORTED supported is: " + data); - expect(data).assertEqual(false); + console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); + expect(data).assertEqual(true); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED :" + err.message); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } @@ -1302,7 +1746,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { /** * @tc.number : SET_FLASH_MODE_AUTO * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api + * @tc.desc : set flash mode auto open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 @@ -1311,12 +1755,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS which is not supported: "); - console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED") + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); + } + else { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : " + err.message); expect().assertFail(); - } else { - expect(true).assertTrue() - console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED: " + err.message); console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); } await sleep(1); @@ -1326,6 +1771,37 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done(); }) + /** + * @tc.number : GET_FLASH_MODE_AUTO + * @tc.name : get flash mode auto camera0 api + * @tc.desc : get flash mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); + camera0Input.getFlashMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); + if (data == 2) { + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); + expect(true).assertTrue(); + console.info(TAG + "Current FlashMode is: " + data); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); + } + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) /** * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.name : check if flash mode close is supported-camera0Input api @@ -1338,7 +1814,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS "); + console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); if (data != null || data != undefined) { console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); @@ -1346,7 +1822,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED :" + err.message); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } @@ -1360,7 +1836,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { /** * @tc.number : SET_FLASH_MODE_CLOSE * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api + * @tc.desc : set flash mode close open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 @@ -1371,10 +1847,10 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) + expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); } else { - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED" + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : " + err.message); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } @@ -1387,8 +1863,8 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { /** * @tc.number : GET_FLASH_MODE_CLOSE - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api + * @tc.name : get flash mode auto camera0 api + * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 @@ -1400,47 +1876,44 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); if (data == 0) { console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); expect(true).assertTrue(); + console.info(TAG + "Current FlashMode is: " + data); console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); } } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED" + err.message); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED :" + err.message); console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } - await sleep(1) + await sleep(1); done(); }) - await sleep(1) - done() + await sleep(1); + done(); }) - /** - * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api + * @tc.number : GET_ZOOM_RATIO + * @tc.name : get zoom ratio camera-0 cameraId api + * @tc.desc : get zoom ratio camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + it('GET_ZOOM_RATIO', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO--------------"); + camera0Input.getZoomRatioRange(async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); + if (data != null && data != undefined) { + console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data) } } else { - console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED" + err.message); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); + console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message); } + console.info(TAG + "Entering GET_ZOOM_RATIO ends here"); await sleep(1); done(); }) @@ -1449,86 +1922,313 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FOCUS_MODE_LOCKED - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api + * @tc.number : SET_GET_ZOOM_1_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(1, (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3) + console.info(TAG + "setZoomRatio success: 1"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(1); + console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) } else { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED" + err.message); + console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); } - await sleep(1); - done(); }) await sleep(1); done(); }) /** - * @tc.number : GET_FOCUS_MODE_LOCKED - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api + * @tc.number : SET_GET_ZOOM_2_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); - camera0Input.getFocusMode(async (err, data) => { + it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(2, (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED SUCCESS: " + data); - if (data == 0) { - console.info(TAG + "GET_FOCUS_MODE_LOCKED data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); - } - } - else { + console.info(TAG + "setZoomRatio success: 2"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(2); + console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED "); + } + else { + expect().assertFail(); + console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); + } + }) + } else { expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); + console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); } - await sleep(1); - done(); }) await sleep(1); done(); }) /** - * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api + * @tc.number : SET_GET_ZOOM_3_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { + it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(3, (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); - } - } else { - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED" + err.message); - expect().assertFail(); + console.info(TAG + "setZoomRatio success: 3"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(3); + console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_4_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(4, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 4"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(4); + console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_5_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(5, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 5"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(5); + console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_6_ASYNC + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) { + camera0Input.setZoomRatio(6, (err, data) => { + if (!err) { + console.info(TAG + "setZoomRatio success: 6"); + console.info(TAG + "getZoomRatio called") + camera0Input.getZoomRatio((err, data1) => { + if (!err) { + console.info(TAG + "getZoomRatio success : " + data1); + expect(data1).assertEqual(6); + console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED "); + } + else { + console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + } else { + console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); + expect().assertFail(); + } + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED + * @tc.name : check if focus mode locked is supported-camera0Input api + * @tc.desc : check if focus mode locked is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED :" + err.message); + expect().assertFail() + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_LOCKED + * @tc.name : set focus mode locked camera0 api + * @tc.desc : set focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); + camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") + expect().assertFail(); + } else { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_LOCKED + * @tc.name : get focus mode locked camera0 api + * @tc.desc : get focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); + camera0Input.getFocusMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); + console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(0); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED + * @tc.name : check if focus mode manual is supported-camera0Input api + * @tc.desc : check if focus mode manual is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { + if (!err) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED " + err.message); + expect().assertFail(); console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1); @@ -1555,7 +2255,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) } else { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED" + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); expect().assertFail(); console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); } @@ -1579,16 +2279,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { camera0Input.getFocusMode(async (err, data) => { if (!err) { console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); - if (data == 0) { - console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); - } + console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(0); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED" + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); } await sleep(1); @@ -1598,6 +2296,62 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done(); }) + /** + * @tc.number : SET_FOCUS_POINT_focus mode manual + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT_focus mode manual', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); + camera0Input.setFocusPoint(Point, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT_focus mode manual + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT_focus mode manual', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + camera0Input.getFocusPoint(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focus Point is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + /** * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.name : check if focus mode continuous is supported-camera0Input api @@ -1606,21 +2360,21 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 to operate"); + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); } } else { - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 FAILED" + err.message); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_034 ends here"); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1); done(); @@ -1641,14 +2395,590 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") - } - else { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED" + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED"); + } + else { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_CONTINUOUS + * @tc.name : get focus mode continuous camera0 api + * @tc.desc : get focus mode continuous camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); + camera0Input.getFocusMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT_focus mode continuous + * @tc.name : set focus Point locked camera0 api + * @tc.desc : set focus Point locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); + camera0Input.setFocusPoint(Point, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT_focus mode continuous + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + camera0Input.getFocusPoint(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focus Point is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED + * @tc.name : check if focus mode auto is supported-camera0Input api + * @tc.desc : check if focus mode auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_AUTO + * @tc.name : set focus mode auto camera0 api + * @tc.desc : set focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); + camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + if (data != null || data != undefined) { + expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") + } + } else { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_AUTO + * @tc.name : get focus mode auto camera0 api + * @tc.desc : get focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); + camera0Input.getFocusMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: "); + console.info(TAG + "Current FocusMode is: " + data); + expect(data).assertEqual(2); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT_focus mode auto + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); + camera0Input.setFocusPoint(Point, async (err, data) => { + if (!err) { + console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT_focus mode auto + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + camera0Input.getFocusPoint(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); + console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check if exposure mode locked is supported-camera0Input api + * @tc.desc : check if exposure mode locked is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode Locked supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Locked supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Locked_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode Locked, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED FAILED") + expect().assertFail(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED + * @tc.name : get exposure mode locked camera0 api + * @tc.desc : get exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); + camera0Input.getExposureMode(async (err, data) => { + if (!err) { + console.info(TAG + "Current ExposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_POINT_exposure mode locked + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + camera0Input.setExposurePoint(Point, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_POINT_exposure mode locked + * @tc.name : get exposure point camera0 api + * @tc.desc : get exposure point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + camera0Input.getExposurePoint(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Exposure point SUCCESS"); + console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_BIASRANGE_exposure mode continuous auto + * @tc.name : get exposure bias range camera0 api + * @tc.desc : get exposure bias range camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_BIASRANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASRANGE to operate"); + camera0Input.getExposureBiasRange(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Exposure bias range SUCCESS"); + console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_BIASRANGE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASRANGE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASRANGE ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_BIAS_exposure mode locked + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(-4, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure bias is: " + "-4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode locked + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(-4); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check if exposure mode auto is supported-camera0Input api + * @tc.desc : check if exposure mode auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Auto_Supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + if (data != null || data != undefined) { + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + } + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_MODE_AUTO + * @tc.name : get exposure mode auto camera0 api + * @tc.desc : get exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); + camera0Input.getExposureMode(async (err, data) => { + if (!err) { + console.info(TAG + "Entering Get Exposure Mode SUCCESS"); + console.info(TAG + "Get Exposure Mode data is not null || undefined: "); + console.info(TAG + "Current ExposureMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_POINT_exposure mode auto + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + camera0Input.setExposurePoint(Point, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -1658,29 +2988,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FOCUS_MODE_CONTINUOUS - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api + * @tc.number : GET_EXPOSURE_POINT_exposure mode auto + * @tc.name : get exposure point camera0 api + * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); - camera0Input.getFocusMode(async (err, data) => { + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + camera0Input.getExposurePoint(async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); - if (data == 1) { - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); - } + console.info(TAG + "Entering Get Exposure point SUCCESS"); + console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -1690,28 +3017,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(1, async (err, data) => { if (!err) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); - } + console.info(TAG + "Entering Set Exposure bias is: " + "1"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1); done(); @@ -1721,25 +3044,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SET_FOCUS_MODE_AUTO - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode auto + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { if (!err) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED" + err.message); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1); done(); @@ -1749,29 +3073,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : GET_FOCUS_MODE_AUTO - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED + * @tc.name : check if exposure mode continuous auto is supported-camera0Input api + * @tc.desc : check if exposure mode continuous auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); - camera0Input.getFocusMode(async (err, data) => { + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); - if (data == 2) { - console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_continuous_Auto_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: "); } - } - else { + } else { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED" + err.message); - console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here"); } await sleep(1); done(); @@ -1781,27 +3104,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : GET_ZOOM_RATIO - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_ZOOM_RATIO', 0, async function (done) { - console.info("--------------GET_ZOOM_RATIO--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering GET_ZOOM_RATIO Success: " + data); - } + console.info(TAG + "Entering Set Exposure Mode continuous auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().AssertFail(); } else { - expect().assertFail(); - console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } - console.info(TAG + "Entering GET_ZOOM_RATIO ends here"); await sleep(1); done(); }) @@ -1810,201 +3131,201 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SET_GET_ZOOM_1_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : get exposure mode continuous auto camera0 api + * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + camera0Input.getExposureMode(async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); + console.info(TAG + "Current ExposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); + } + else { expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } + await sleep(1); + done(); }) await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_2_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_POINT_exposure mode continuous auto + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + camera0Input.setExposurePoint(Point, async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) + console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } + await sleep(1); + done(); }) await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_3_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_POINT_exposure mode continuous auto + * @tc.name : get exposure point camera0 api + * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + camera0Input.getExposurePoint(async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); + console.info(TAG + "Entering Get Exposure point SUCCESS"); + console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + } + else { expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } + await sleep(1); + done(); }) await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_4_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + camera0Input.setExposureBias(4, async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) + console.info(TAG + "Entering Set Exposure bias is: " + "4"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } + await sleep(1); + done(); }) await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_5_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode continuous auto + * @tc.name : get exposure bias value camera0 api + * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); + camera0Input.getExposureValue(async (err, data) => { if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); + console.info(TAG + "Entering Get Exposure bias value SUCCESS"); + console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); + expect(data).assertEqual(4); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); + } + else { expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } + await sleep(1); + done(); }) await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_6_ASYNC - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + photoOutputAsync.isMirrorSupported(async (err, data) => { + if (!err) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + } else { + expect().assertFail(); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : setMirror_true + * @tc.name : setMirror true + * @tc.desc : setMirror true + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('setMirror_true', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering setMirror_true to operate"); + photoOutputAsync.setMirror(true, async (err, data) => { + if (!err) { + console.info(TAG + "Entering setMirror_true is success:"); + console.info(TAG + "setMirror is : " + 'True'); + expect(true).assertTrue(); + } else { + expect().assertFail(); + } + await sleep(2); + done(); + }) + await sleep(2); + done(); + } }) /** @@ -2049,13 +3370,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('VIDEO_RECORDER_START', 0, async function (done) { if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VIDEO_RECORDER_START videoRecorder == null || undefined') + console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') } else { console.info(TAG + 'Entering VIDEO_RECORDER_START to operate') videoRecorder.start() console.info(TAG + 'VIDEO_RECORDER_START called'); sleep(3); - console.info(TAG + 'VIDEO_RECORDER_START done.') + console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') + photoOutputAsync.capture(photosettings1) + console.info(TAG + 'Capture during Video - End.') expect(true).assertTrue() console.info(TAG + 'Entering VIDEO_RECORDER_START PASSED') console.info(TAG + 'Entering VIDEO_RECORDER_START ends here') @@ -2076,7 +3399,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('VIDEO_OUTPUT_STOP', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VIDEO_OUTPUT_STOP videoOutput == null || undefined') + console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') } else { console.info(TAG + 'Entering VIDEO_OUTPUT_STOP to operate') await sleep(1) @@ -2109,11 +3432,11 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('VIDEO_RECORDER_STOP', 0, async function (done) { if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VIDEO_RECORDER_STOP videoRecorder == null || undefined') + console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') } else { console.info(TAG + 'Entering VIDEO_RECORDER_STOP to operate') await videoRecorder.stop() - console.info(TAG + 'VIDEO_RECORDER_STOP stopVideo done.') + console.info(TAG + 'VideoRecorder stop stopVideo done.') console.info(TAG + 'Entering VIDEO_RECORDER_STOP PASSED') expect(true).assertTrue() } @@ -2131,13 +3454,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('CAPTURE_SESSION_STOP', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CAPTURE_SESSION_STOP captureSession == null || undefined') + console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') } else { console.info(TAG + 'Entering CAPTURE_SESSION_STOP to operate') await sleep(1) captureSession.stop((err, data) => { if (!err) { - console.info(TAG + 'Entering CAPTURE_SESSION_STOP success') + console.info(TAG + 'Entering CaptureSession stop success') expect(true).assertTrue() console.info(TAG + 'Entering CAPTURE_SESSION_STOP PASSED') } else { @@ -2162,15 +3485,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('CAPTURE_SESSION_RELEASE', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE captureSession == null || undefined') + console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') } else { console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE to operate') await sleep(1) captureSession.release(async (err, data) => { if (!err) { - console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE success') + console.info(TAG + 'Entering CaptureSession release success') if (data != null || data != undefined) { - console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE data is not null || undefined') + console.info(TAG + 'Entering CaptureSession release data is not null || undefined') expect(true).assertTrue() console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE PASSED') } @@ -2197,7 +3520,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('VIDEOOUPUT_RELEASE_SUCCESS', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS previewOutput == null || undefined"); + console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); } else { console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS to operate"); videoOutput.release(async (err, data) => { @@ -2206,12 +3529,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (data != null || data != undefined) { console.info(TAG + "Entering videooutput.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering videooutput.release PASSED"); + console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS PASSED"); } } else { expect().assertFail(); console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS FAILED: " + err.message); - console.info(TAG + "Entering videooutput.release ends here"); + console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS ends here"); await sleep(1); done(); } @@ -2255,6 +3578,37 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } }) + /** + * @tc.number : PHOTOOUPUT_RELEASE + * @tc.name : photoOutput release api + * @tc.desc : photoOutput release api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUPUT_RELEASE', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUPUT_RELEASE photoOutputAsync == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUPUT_RELEASE to operate"); + photoOutputAsync.release(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutputAsync.release success"); + expect(true).assertTrue(); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE FAILED: " + err.message); + console.info(TAG + "Entering photoOutputAsync.release ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + /** * @tc.number : CAMERAINPUT_RELEASE_SUCCESS * @tc.name : camera Input release api @@ -2265,7 +3619,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { */ it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS camera0Input == null || undefined"); + console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); } else { console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS to operate"); camera0Input.release(async (err, data) => { @@ -2274,12 +3628,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (data != null || data != undefined) { console.info(TAG + "Entering camera0Input.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering camera0Input.release PASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS PASSED"); } } else { expect().assertFail(); console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS FAILED: " + err.message); - console.info(TAG + "Entering camera0Input.release ends here"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS ends here"); await sleep(1); done(); } diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets index affd34e22eaa305d24f40d19eb48c45ac3105fef..c0dffb634da2cfc7b1eabd9fc59cfb07afbcd3f3 100644 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets @@ -15,6 +15,7 @@ import cameraObj from '@ohos.multimedia.camera' import media from '@ohos.multimedia.media' +import image from '@ohos.multimedia.image'; import mediaLibrary from '@ohos.multimedia.mediaLibrary' import fileio from '@ohos.fileio'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl' @@ -29,9 +30,53 @@ var camerasArrayPromise var camera0InputPromise var previewOutputPromise var videoRecorder +var photoOutputPromise let fdPath; let fileAsset; let fdNumber; + +var Point1 = { x: 1, y: 1 } +var Point2 = { x: 2, y: 2 } +var Point3 = { x: 3, y: 3 } +var photosettings1 = { + rotation: 0, + quality: 0, + location: { + latitude: 12.9705, + longitude: 77.7329, + altitude: 920.0000, + }, +} +var photosettings2 = { + rotation: 90, + quality: 1, + location: { + latitude: 20, + longitude: 78, + altitude: 8586, + }, +} + +var photosettings3 = { + quality: 2, + location: { + latitude: 0, + longitude: 0, + altitude: 0, + }, +} +var photosettings4 = { + rotation: 180, + location: { + latitude: -1, + longitude: -1, + altitude: -1, + }, +} + +var photosettings5 = { + rotation: 270, +} let configFile = { audioBitrate: 48000, audioChannels: 2, @@ -56,11 +101,26 @@ let videoConfig = { maxSize: 100, maxDuration: 500 } +var surfaceId1 var videoId var videoOutputPromise var captureSessionPromise export default function cameraJSUnitVideoPromise(surfaceId: any) { + + async function getImageReceiverSurfaceId() { + console.log(TAG + 'Entering create Image receiver') + var receiver = image.createImageReceiver(640, 480, 4, 8) + console.log(TAG + 'before receiver check') + if (receiver !== undefined) { + console.log(TAG + 'Receiver is ok') + surfaceId1 = await receiver.getReceivingSurfaceId() + console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) + } else { + console.log(TAG + 'Receiver is not ok') + } + } + function sleep(time) { return new Promise((resolve, reject) => { setTimeout(() => { @@ -196,7 +256,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { it('GET_CAMERA_MANAGER_PROMISE', 0, async function (done) { console.info('--------------GET_CAMERA_MANAGER_PROMISE--------------') cameraManagerPromise = await cameraObj.getCameraManager(null) - console.info(TAG + 'Entering GET_CAMERA_MANAGER_PROMISE cameraManagerPromise: ' + cameraManagerPromise) + console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) if (cameraManagerPromise != null && cameraManagerPromise != undefined) { expect(true).assertTrue() console.info(TAG + 'Entering GET_CAMERA_MANAGER_PROMISE PASSED') @@ -219,21 +279,21 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('CAMERA_STATUS_CALLBACK', 0, async function (done) { if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK cameraManagerPromise == null || undefined') + console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') } else { console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK to operate') await sleep(1) - cameraManagerPromise.on("cameraStatus", async (err, data) => { + cameraManagerPromise.on('cameraStatus', async (err, data) => { if (!err) { console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); + console.info(TAG + "CAMERA_STATUS_CALLBACK CameraStatusInfo_Camera: " + data.camera); + console.info(TAG + "CAMERA_STATUS_CALLBACK CameraStatusInfo_Status: " + data.status); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); + console.info(TAG + "CAMERA_STATUS_CALLBACK FAILED: " + err.message); } await sleep(1); done(); @@ -254,19 +314,19 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { it('GET_CAMERAS_PROMISE', 0, async function (done) { console.info('--------------GET_CAMERAS_PROMISE--------------') camerasArrayPromise = await cameraManagerPromise.getCameras() - console.info(TAG + 'Entering GET_CAMERAS_PROMISE: ' + JSON.stringify(camerasArrayPromise)) + console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + 'Entering GET_CAMERAS_PROMISE success') + console.info(TAG + 'Entering Get Cameras Promise success') for (var i = 0; i < camerasArrayPromise.length; i++) { // Get the variables from camera object var cameraId = camerasArrayPromise[i].cameraId - console.info(TAG + 'Entering GET_CAMERAS_PROMISE camera' + i + 'Id: ' + cameraId) + console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Id: ' + cameraId) var cameraPosition = camerasArrayPromise[i].cameraPosition - console.info(TAG + 'Entering GET_CAMERAS_PROMISE camera' + i + 'Position: ' + cameraPosition) + console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Position: ' + cameraPosition) var cameraType = camerasArrayPromise[i].cameraType - console.info(TAG + 'Entering GET_CAMERAS_PROMISE camera' + i + 'Type: ' + cameraType) + console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Type: ' + cameraType) var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + 'Entering GET_CAMERAS_PROMISE connection' + i + 'Type: ' + connectionType) + console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) } expect(true).assertTrue() console.info(TAG + 'Entering GET_CAMERAS_PROMISE PASSED') @@ -291,9 +351,9 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { it('CREATE_CAMERA_INPUT_PROMISE', 0, async function (done) { console.info('--------------CREATE_CAMERA_INPUT_PROMISE--------------') camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) - console.info(TAG + 'Entering CREATE_CAMERA_INPUT_PROMISE camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) + console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + 'Entering CREATE_CAMERA_INPUT_PROMISE camera0InputPromise is not null || undefined') + console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') expect(true).assertTrue() console.info(TAG + 'Entering CREATE_CAMERA_INPUT_PROMISE PASSED') } else { @@ -315,19 +375,19 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined"); + console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); } else { console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); - camera0InputPromise.on("error", async (err, data) => { + camera0InputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "camera0InputPromise error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during camera0InputPromise with ErrorCode: " + data.code); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "CAMERA_INPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -348,13 +408,13 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { it('CREATE_PREVIEW_OUTPUT_PROMISE', 0, async function (done) { console.info('--------------CREATE_PREVIEW_OUTPUT_PROMISE--------------') previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) - console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) + console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) if (previewOutputPromise != null && previewOutputPromise != undefined) { - console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE previewOutputPromise is not null || undefined') - expect(true).assertTrue() + console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') + expect(true).assertTrue(); console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE PASSED') } else { - expect().assertFail() + expect().assertFail(); console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE FAILED') } console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE ends here') @@ -362,6 +422,70 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done() }) + /** + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : FocusStateChange callback api + * @tc.desc : FocusStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0InputPromise == null || camera0InputPromise == undefined) { + console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0InputPromise.on('focusStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "FocusState callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current FocusState is : " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT + * @tc.name : ExposureStateChange callback api + * @tc.desc : ExposureStateChange callback api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0InputPromise == null || camera0InputPromise == undefined) { + console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0InputPromise.on('exposureStateChange', async (err, data) => { + if (!err) { + console.info(TAG + "ExposureStateChange callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current ExposureStateChange is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + /** * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_ERROR * @tc.name : PreviewOutput callback onerror async api @@ -372,7 +496,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR previewOutputPromise == null || undefined') + console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') } else { console.info(TAG + 'Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate') await sleep(1) @@ -380,12 +504,12 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error during PreviewOutput with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "PREVIEW_OUTPUT_CALLBACK FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -408,7 +532,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { await getvideosurface() await sleep(2) videoOutputPromise = await cameraObj.createVideoOutput(videoId) - console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE: ' + videoOutputPromise) + console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) if (videoOutputPromise != null && videoOutputPromise != undefined) { expect(true).assertTrue() console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE PASSED') @@ -439,7 +563,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { if (!err) { console.info(TAG + 'VideoOutput Errorcallback is success') if (data != null || data != undefined) { - console.info(TAG + "Error during videoOutput with ErrorCode: " + data.code); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue() } } else { @@ -454,6 +578,97 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } }) + /*PhotoOutput APIs test script*/ + /** + * @tc.number : CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE + * @tc.name : Create PhotoOutput instance promise api + * @tc.desc : Create PhotoOutput instance promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE', 0, async function (done) { + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE to operate"); + console.info(TAG + 'Entering getImageReceiverSurfaceId') + await getImageReceiverSurfaceId() + await sleep(1) + photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); + console.info(TAG + "Entering createPhotoOutput success"); + if (photoOutputPromise != null || photoOutputPromise != undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE FAILED : "); + console.info(TAG + "Entering createPhotoOutput ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + await photoOutputPromise.isMirrorSupported() + .then(function (data) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); + }); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR + * @tc.name : Photo output callback on error api + * @tc.desc : Photo output callback on error api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); + photoOutputPromise.on('error', async (err, data) => { + if (!err) { + console.info(TAG + "PhotoOutputError callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + /** * @tc.number : CREATE_CAPTURE_SESSION_PROMISE * @tc.name : Create capturesession promise api @@ -465,7 +680,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { it('CREATE_CAPTURE_SESSION_PROMISE', 0, async function (done) { console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE to operate') captureSessionPromise = await cameraObj.createCaptureSession(null) - console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE: ' + captureSessionPromise) + console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) if (captureSessionPromise != null && captureSessionPromise != undefined) { expect(true).assertTrue() console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE PASSED') @@ -488,7 +703,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering CAP_SES_CALLBACK_ON_ERROR captureSessionPromise == null || undefined') + console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') } else { console.info(TAG + 'Entering CAP_SES_CALLBACK_ON_ERROR to operate') await sleep(1) @@ -496,12 +711,12 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { if (!err) { console.info(TAG + " captureSession errorcallback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error in CaptureSessioncallback with ErrorCode: " + data.code); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Error in CaptureSessioncallback FAILED: " + err.message); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -513,29 +728,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : CREATE_BEGIN_CONFIG_SUCCESS_PROMISE + * @tc.number : BEGIN_CONFIG_SUCCESS_PROMISE * @tc.name : CaptureSession_Begin config promise api * @tc.desc : CaptureSession_Begin config promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CREATE_BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { + it('BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering Create captureSession == null || undefined"); } else { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE to operate"); const promise = await captureSessionPromise.beginConfig(); console.info(TAG + "Entering beginConfig success:"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE FAILED : "); } - console.info(TAG + "Entering beginConfig ends here"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE ends here"); } await sleep(1); done(); @@ -551,11 +766,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering Add Input captureSession == null || undefined"); } else { console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success"); + console.info(TAG + "Entering Add Input success"); if (Promise == undefined) { expect(true).assertTrue(); console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); @@ -582,18 +797,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); + console.info(TAG + "Entering Add preview output captureSession == null || undefined"); } else { console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); + console.info(TAG + "Entering Add preview output : Success"); if (promise == undefined) { expect(true).assertTrue(); console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED : "); } console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here"); await sleep(1); @@ -613,11 +828,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('ADD_OUTPUT_VIDEO_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering Add video output captureSession == null || undefined"); } else { console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS to operate"); const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS success"); + console.info(TAG + "Entering Add video output success"); if (promise == undefined) { expect(true).assertTrue(); console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS PASSED"); @@ -634,6 +849,36 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) + /** + * @tc.number : ADD_OUTPUT_PHOTO + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_OUTPUT_PHOTO', 0, async function (done) { + if (captureSessionPromise == null || captureSessionPromise == undefined) { + console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO to operate"); + const promise = await captureSessionPromise.addOutput(photoOutputPromise); + console.info(TAG + "Entering Add output with photo output success"); + if (promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO FAILED "); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO ends here"); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) /** * @tc.number : REMOVE_INPUT_SUCCESS * @tc.name : remove input api @@ -696,6 +941,37 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) + /** + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS + * @tc.name : Remove photo Output api + * @tc.desc : Remove photo Output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + if (captureSessionPromise == null || captureSessionPromise == undefined) { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); + const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); + if (Promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); + } + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) + /** * @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS * @tc.name : Remove video Output api @@ -727,7 +1003,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) - /** * @tc.number : ADD_INPUT_SUCCESS_PROMISE * @tc.name : Add Input with camera0Input api @@ -790,6 +1065,37 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) + /** + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS + * @tc.name : Add output with photo output api + * @tc.desc : Add output with photo output api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { + if (captureSessionPromise == null || captureSessionPromise == undefined) { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); + const promise = await captureSessionPromise.addOutput(photoOutputPromise); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); + if (promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); + } + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) + /** * @tc.number : ADD_OUTPUT_VIDEO_SUCCESS * @tc.name : Add output with video output api @@ -831,18 +1137,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS captureSession == null || undefined"); + console.info(TAG + "Entering Commit config captureSession == null || undefined"); } else { console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); const promise = await captureSessionPromise.commitConfig(); - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig success"); + console.info(TAG + "Entering commitConfig success"); if (promise == undefined) { - expect(true).assertTrue() + expect(true).assertTrue(); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); } else { expect().assertFail() - console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "); console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } await sleep(1); @@ -862,18 +1168,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START previewOutput == null || undefined"); + console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); } else { console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); - previewOutputPromise.on("frameStart", async (err, data) => { + previewOutputPromise.on('frameStart', async (err, data) => { if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail() - console.info(TAG + "PreviewStart frameStart Callback FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1); done(); @@ -925,7 +1231,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START videoOutputPromise == null || undefined') + console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') } else { console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate') await sleep(1) @@ -937,7 +1243,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } } else { expect().assertFail() - console.info(TAG + "Video frameStart Callback is FAILED" + err.message); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_FRAME_START is FAILED : " + err.message); } await sleep(1); done(); @@ -957,19 +1263,19 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END videoOutputPromise == null || undefined') + console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') } else { console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate') await sleep(1) videoOutputPromise.on('frameEnd', async (err, data) => { if (!err) { - console.info(TAG + 'Video frameEnd callback is success') + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END is success') if (data != null || data != undefined) { expect(true).assertTrue() } } else { expect().assertFail() - console.info(TAG + 'Video frameEnd callback FAILED' + err.message) + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END FAILED' + err.message) } await sleep(1); done(); @@ -979,84 +1285,244 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } }) + //Capture callback /** - * @tc.number : CAPTURE_SESSION_START_PROMISE - * @tc.name : CaptureSession start promise api - * @tc.desc : CaptureSession start promise api + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START + * @tc.name : Photo capture callback on capture start api + * @tc.desc : Photo capture callback on capture start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('CAPTURE_SESSION_START_PROMISE', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE captureSessionPromise == null || undefined') + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); } else { - console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE to operate') - await captureSessionPromise.start(); - expect(true).assertTrue() - console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE PASSED') - console.info(TAG + 'Entering CAPTURE_SESSION_START_PROMISE ends here') - await sleep(1) - done() + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); + photoOutputPromise.on('captureStart', async (err, data) => { + if (!err) { + console.info(TAG + "CaptureStart Callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); } - await sleep(1) - done() }) - //FLASH Function API scripts /** - * @tc.number : HAS_FLASH - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END + * @tc.name : Photo capture callback on capture end api + * @tc.desc : Photo capture callback on capture end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('HAS_FLASH', 0, async function (done) { - console.info("--------------HAS_FLASH--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering HAS_FLASH success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); - console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering HAS_FLASH FAILED"); - expect().assertFail(); + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); + photoOutputPromise.on('captureEnd', async (err, data) => { + if (!err) { + console.info(TAG + "captureEnd callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "captureEnd callback with captureId: " + data.captureId); + console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); } - console.info(TAG + "Entering HAS_FLASH ends here"); - await sleep(1) - done(); }) /** - * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER + * @tc.name : Photo capture callback on frame shutter api + * @tc.desc : Photo capture callback on frame shutter api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); - } - else { - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED"); - expect().assertFail(); - console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); - } - await sleep(1); - done(); - }) + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); + photoOutputPromise.on('frameShutter', async (err, data) => { + if (!err) { + console.info(TAG + "frameShutter callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with captureId: " + data.captureId); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with timestamp: " + data.timestamp); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + } + }) + + /** + * @tc.number : CAPTURE_SESSION_START_SUCCESS + * @tc.name : capture session start api + * @tc.desc : capture session start api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { + if (captureSessionPromise == null || captureSessionPromise == undefined) { + console.info(TAG + "Entering capture session start captureSession == null || undefined"); + } else { + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate"); + await captureSessionPromise.start(); + console.info(TAG + "Entering captureSession start success"); + expect(true).assertTrue(); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here"); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : isMirrorSupported_PHOTO_OUTPUT + * @tc.name : isMirrorSupported + * @tc.desc : isMirrorSupported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); + await photoOutputPromise.isMirrorSupported() + .then(function (data) { + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); + console.info(TAG + "isMirrorSupported : " + data); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); + }); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : setMirror_true + * @tc.name : setMirror true + * @tc.desc : setMirror true + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('setMirror_true', 0, async function (done) { + if (photoOutputPromise == null || photoOutputPromise == undefined) { + console.info(TAG + "photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering setMirror_true to operate"); + await photoOutputPromise.setMirror(true) + .then(function (data) { + console.info(TAG + "Entering setMirror_true is success:"); + console.info(TAG + "setMirror is : " + 'True'); + expect(true).assertTrue(); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "setMirror_true FAILED : " + err.message); + }); + await sleep(1); + done(); + } + await sleep(1); + done(); + }) + + //FLASH Function API scripts + /** + * @tc.number : HAS_FLASH + * @tc.name : check if has flash-camera0Input api + * @tc.desc : check if has flash-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('HAS_FLASH', 0, async function (done) { + console.info("--------------HAS_FLASH--------------"); + console.info(TAG + 'hasFlash called.') + var hasFlashPromise = await camera0InputPromise.hasFlash(); + console.info(TAG + "Entering HAS_FLASH success"); + if (hasFlashPromise != null || hasFlashPromise != undefined) { + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise)); + expect(hasFlashPromise).assertEqual(true); + } + else { + console.info(TAG + "Entering HAS_FLASH FAILED : "); + expect().assertFail(); + } + console.info(TAG + "Entering HAS_FLASH ends here"); + await sleep(1) + done(); + }) + + /** + * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED + * @tc.name : check if flash mode open is supported-camera0Input api + * @tc.desc : check if flash mode open is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); + var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); + if (isFMOpenSupported != null || isFMOpenSupported != undefined) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); + console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); + expect(isFMOpenSupported).assertEqual(true); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); + } + else { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) /** * @tc.number : SET_FLASH_MODE_OPEN @@ -1073,9 +1539,9 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { if (SetFMOpen == undefined) { console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1) + expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED"); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : "); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } @@ -1103,7 +1569,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_OPEN FAILED"); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : "); console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1); @@ -1129,7 +1595,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : "); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } @@ -1154,7 +1620,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) } else { - console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED"); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : "); expect().assertFail(); console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } @@ -1182,7 +1648,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : "); console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1); @@ -1204,11 +1670,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { if (isFMAutoSupported != null || isFMAutoSupported != undefined) { console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(false); + expect(isFMAutoSupported).assertEqual(true); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED : "); expect().assertFail(); console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } @@ -1216,6 +1682,58 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { done(); }) + /** + * @tc.number : SET_FLASH_MODE_AUTO + * @tc.name : set flash mode auto camera0 api + * @tc.desc : set flash mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); + var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) + if (SetFMAlwaysAuto == undefined) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") + expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) + } else { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : "); + expect().assertFail(); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FLASH_MODE_AUTO + * @tc.name : get flash mode auto camera0 api + * @tc.desc : get flash mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); + var GetFMAuto = await camera0InputPromise.getFlashMode(); + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); + if (GetFMAuto == 2) { + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); + console.info(TAG + "Current FlashMode is: " + GetFMAuto); + expect(true).assertTrue(); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + /** * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.name : check if flash mode close is supported-camera0Input api @@ -1235,8 +1753,8 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } else { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED"); console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } await sleep(1); @@ -1260,8 +1778,8 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) } else { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED"); console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } await sleep(1); @@ -1288,505 +1806,1244 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED"); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED : "); console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } await sleep(1); done(); }) - // FOCUS promise API's + //ZOOM Function /** - * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api + * @tc.number : GET_ZOOM_RATIO_PROMISE + * @tc.name : get zoom ratio camera-0 cameraId api promise api + * @tc.desc : get zoom ratio camera-0 cameraId api promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED data is not null || undefined"); - console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED: " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); - } - else { + it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO_PROMISE--------------"); + var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); + if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise)); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED"); + } else { + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED"); - console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); } + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_FOCUS_MODE_LOCKED - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api + * @tc.number : SET_GET_ZOOM_1_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); - var SetFMLocked = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "SetFMLocked: " + JSON.stringify(SetFMLocked)) - if (SetFMLocked == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - } else { + it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(1); + console.info(TAG + "setZoomRatio success: 1"); + console.info(TAG + "getZoomRatio called") + var getpromise1 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise1); + if (getpromise1 != null && getpromise1 != undefined) { + expect(getpromise1).assertEqual(1); + console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED "); + } + else { + console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED"); - console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); } await sleep(1); done(); }) /** - * @tc.number : GET_FOCUS_MODE_LOCKED - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api + * @tc.number : SET_GET_ZOOM_2_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); - var GetFMLocked = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED success: " + GetFMLocked); - if (GetFMLocked == 0) { - console.info(TAG + "Current focusmode is: " + GetFMLocked); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); + it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(2); + console.info(TAG + "setZoomRatio success: 2"); + console.info(TAG + "getZoomRatio called") + var getpromise2 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise2); + if (getpromise2 != null && getpromise2 != undefined) { + expect(getpromise2).assertEqual(2); + console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED "); } else { + console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED"); - console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); } await sleep(1); done(); }) /** - * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported + * @tc.number : SET_GET_ZOOM_3_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); + it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(3); + console.info(TAG + "setZoomRatio success: 3"); + console.info(TAG + "getZoomRatio called") + var getpromise3 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise3); + if (getpromise3 != null && getpromise3 != undefined) { + expect(getpromise3).assertEqual(3); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED "); } else { + console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED"); - console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SET_FOCUS_MODE_MANUAL - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api + * @tc.number : SET_GET_ZOOM_4_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); - var setFocusManual = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "setFocusManual: " + JSON.stringify(setFocusManual)) - if (setFocusManual == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) + it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(4); + console.info(TAG + "setZoomRatio success: 4"); + console.info(TAG + "getZoomRatio called") + var getpromise4 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise4); + if (getpromise4 != null && getpromise4 != undefined) { + expect(getpromise4).assertEqual(4); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED "); } else { + console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED"); expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED"); - console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); } await sleep(1); done(); }) /** - * @tc.number : GET_FOCUS_MODE_MANUAL - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api + * @tc.number : SET_GET_ZOOM_5_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(5); + console.info(TAG + "setZoomRatio success: 5"); + console.info(TAG + "getZoomRatio called") + var getpromise5 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise5); + if (getpromise5 != null && getpromise5 != undefined) { + expect(getpromise5).assertEqual(5); + console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED "); + } + else { + console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED"); + expect().assertFail(); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_GET_ZOOM_6_PROMISE + * @tc.name : Zoom camera-0 cameraId api + * @tc.desc : Zoom camera-0 cameraId api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) { + var setpromise = await camera0InputPromise.setZoomRatio(6); + console.info(TAG + "setZoomRatio success: 6"); + console.info(TAG + "getZoomRatio called") + var getpromise6 = await camera0InputPromise.getZoomRatio(); + console.info(TAG + "getZoomRatio success: " + getpromise6); + if (getpromise6 != null && getpromise6 != undefined) { + expect(getpromise6).assertEqual(6); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED "); + } + else { + console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED"); + expect().assertFail(); + } + await sleep(1); + done(); + }) + + // FOCUS promise API's + /** + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED + * @tc.name : check is focus mode locked supported-camera0Input api + * @tc.desc : check is focus mode locked supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); + var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering is focus mode locked supported SUCCESS "); + if (isFMLockedSupported != null || isFMLockedSupported != undefined) { + console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); + console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); + expect(isFMLockedSupported).assertEqual(false); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); + } + else { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_LOCKED + * @tc.name : set focus mode locked camera0 api + * @tc.desc : set focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) + .then(function (data) { + console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) + console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_LOCKED + * @tc.name : get focus mode locked camera0 api + * @tc.desc : get focus mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode locked success: "); + if (data == 0) { + console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCAL_LENGTH + * @tc.name : get focal length camera0 api + * @tc.desc : get focal length camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCAL_LENGTH', 0, async function (done) { + console.info(TAG + "Entering GET_FOCAL_LENGTH to operate"); + await camera0InputPromise.getFocalLength() + .then(function (data) { + console.info(TAG + "Current focallength is: " + JSON.stringify(data)); + expect(data).assertEqual(3.4600000381469727); + console.info(TAG + "GET_FOCAL_LENGTH PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCAL_LENGTH FAILED : " + err.message); + }); + console.info(TAG + "GET_FOCAL_LENGTH ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED + * @tc.name : is focusmode manual supported + * @tc.desc : is focusmode manual supported + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); + var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); + if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { + console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); + expect(isFMmanualSupportedpromise).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); + } + else { + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_MANUAL + * @tc.name : set focus mode manual camera0 api + * @tc.desc : set focus mode manual camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); + await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) + .then(function (data) { + console.info(TAG + "setFocusManual: " + JSON.stringify(data)) + console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_MANUAL + * @tc.name : get focus mode manual camera0 api + * @tc.desc : get focus mode manual camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode manual SUCCESS"); + if (data == 0) { + console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); + }); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusPoint(Point1) + .then(function (data) { + console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + await camera0InputPromise.getFocusPoint() + .then(function (data) { + console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED " + err.message); + }); + console.info(TAG + "GET_FOCUS_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED + * @tc.name : check is focus mode continuous supported-camera0Input api + * @tc.desc : check is focus mode continuous supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); + var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { + console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); + console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); + expect(isFMContinuousSupportedpromise).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); + } + else { + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_CONTINUOUS + * @tc.name : set focus mode continuous camera0 api + * @tc.desc : set focus mode continuous camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); + await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) + .then(function (data) { + console.info(TAG + "setFocusCont: " + JSON.stringify(data)) + console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_CONTINUOUS + * @tc.name : get focus mode continuous camera0 api + * @tc.desc : get focus mode continuous camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); + await camera0InputPromise.getFocusMode() + .then(function (data) { + console.info(TAG + "Entering get focus mode continuous SUCCESS"); + if (data == 1) { + console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); + } + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED: " + err.message); + }); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusPoint(Point2) + .then(function (data) { + console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + await camera0InputPromise.getFocusPoint() + .then(function (data) { + console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED: " + err.message); + }); + console.info(TAG + "GET_FOCUS_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED + * @tc.name : check is focus mode auto supported-camera0Input api + * @tc.desc : check is focus mode auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); + var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); + if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { + console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); + console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); + expect(isFMAutoSupportedpromise).assertEqual(true); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); + } + else { + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : "); + expect().assertFail(); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_MODE_AUTO + * @tc.name : set focus mode auto camera0 api + * @tc.desc : set focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); + var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) + .then(function () { + console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) + console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") + expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : "); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_MODE_AUTO + * @tc.name : get focus mode auto camera0 api + * @tc.desc : get focus mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); + var getfocusmodepromise = await camera0InputPromise.getFocusMode(); + console.info(TAG + "Entering get focus mode auto SUCCESS"); + if (getfocusmodepromise == 2) { + console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_FOCUS_POINT + * @tc.name : set focus Point camera0 api + * @tc.desc : set focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering set focus mode locked to operate"); + await camera0InputPromise.setFocusPoint(Point3) + .then(function (data) { + console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_FOCUS_POINT + * @tc.name : get focus Point camera0 api + * @tc.desc : get focus Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); + await camera0InputPromise.getFocusPoint() + .then(function (data) { + console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_FOCUS_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + }); + console.info(TAG + "GET_FOCUS_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check is exposure mode locked supported-camera0Input api + * @tc.desc : check is exposure mode locked supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: " + data); + expect(data).assertEqual(false); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked FAILED") + expect().assertFail() + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED + * @tc.name : get exposure mode locked camera0 api + * @tc.desc : get exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); + await camera0InputPromise.getExposureMode() + .then(function (data) { + console.info(TAG + "Entering get exposure mode locked SUCCESS"); + console.info(TAG + "Current ExposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_POINT_exposure mode locked + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_Point to operate"); + await camera0InputPromise.setExposurePoint(Point1) + .then(function (data) { + console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_POINT_exposure mode locked + * @tc.name : get exposure Point camera0 api + * @tc.desc : get exposure Point camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + await camera0InputPromise.getExposurePoint() + .then(function (data) { + console.info(TAG + "Entering getExposurePoint SUCCESS"); + console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED: " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_BIASRANGE_exposure mode locked + * @tc.name : get exposure bias range camera0 api + * @tc.desc : get exposure bias range camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_BIASRANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASRANGE to operate"); + await camera0InputPromise.getExposureBiasRange() + .then(function (data) { + console.info(TAG + "Entering getExposureBiasRange SUCCESS"); + console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_BIASRANGE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_BIASRANGE FAILED: " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_BIASRANGE ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : SET_EXPOSURE_BIAS_exposure mode locked + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(-4) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : GET_EXPOSURE_VALUE_exposure mode locked + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_EXPOSURE_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(-4); + console.info(TAG + "GET_EXPOSURE_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_VALUE ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check is exposure mode auto supported-camera0Input api + * @tc.desc : check is exposure mode auto supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); - if (getfocusmodepromise == 0) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED"); - console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); - } + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: " + data); + expect(data).assertEqual(true); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED: " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); await sleep(1); done(); }) /** - * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); - } - else { - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED"); - expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); - } + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_FOCUS_MODE_CONTINUOUS - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api + * @tc.number : GET_EXPOSURE_MODE_AUTO + * @tc.name : get exposure mode auto camera0 api + * @tc.desc : get exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); - var setFocusCont = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "setFocusCont: " + JSON.stringify(setFocusCont)) - if (setFocusCont == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - } - else { - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED"); - console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); - } + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); + await camera0InputPromise.getExposureMode() + .then(function (data) { + console.info(TAG + "Entering get exposure mode auto SUCCESS"); + console.info(TAG + "Current exposureMode is: " + data); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED: " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : GET_FOCUS_MODE_CONTINUOUS - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api + * @tc.number : SET_EXPOSURE_POINT_exposure mode auto + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); - if (getfocusmodepromise == 1) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED"); - console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); - } + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + await camera0InputPromise.setExposurePoint(Point2) + .then(function (data) { + console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED: " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api + * @tc.number : GET_EXPOSURE_POINT_exposure mode auto + * @tc.name : get exposure Point camera0 api + * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); - } - else { - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED"); - expect().assertFail(); - console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); - } + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + await camera0InputPromise.getExposurePoint() + .then(function (data) { + console.info(TAG + "Entering getExposurePoint SUCCESS"); + console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED: " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_FOCUS_MODE_AUTO - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - if (setFocusAuto == undefined) { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - } - else { - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED"); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); - } + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(1) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1); done(); }) /** - * @tc.number : GET_FOCUS_MODE_AUTO - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api + * @tc.number : GET_EXPOSURE_VALUE_exposure mode auto + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_FOCUS_MODE_AUTO', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED"); - console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); - } + it('GET_EXPOSURE_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(1); + console.info(TAG + "GET_EXPOSURE_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_VALUE ends here"); await sleep(1); done(); }) - //ZOOM Function /** - * @tc.number : GET_ZOOM_RATIO_PROMISE - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : check is exposure mode continuous auto supported-camera0Input api + * @tc.desc : check is exposure mode continuous auto supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) { - console.info("--------------GET_ZOOM_RATIO_PROMISE--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED"); - } else { - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here"); + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED: " + data); + expect(data).assertEqual(false); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_1_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED"); - expect().assertFail(); - } + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_2_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : get exposure mode continuous auto camera0 api + * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED"); - expect().assertFail(); - } + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.getExposureMode() + .then(function (data) { + console.info(TAG + "Entering get exposure mode auto SUCCESS"); + console.info(TAG + "Current exposureMode is: " + data); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_3_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_POINT + * @tc.name : set exposure Point camera0 api + * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED"); - expect().assertFail(); - } + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); + await camera0InputPromise.setExposurePoint(Point3) + .then(function (data) { + console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_4_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_POINT + * @tc.name : get exposure Point camera0 api + * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED"); - expect().assertFail(); - } + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); + await camera0InputPromise.getExposurePoint() + .then(function (data) { + console.info(TAG + "Entering getExposurePoint SUCCESS"); + console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); + expect(true).assertTrue(); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_5_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : SET_EXPOSURE_BIAS_exposure mode continuous auto + * @tc.name : set exposure bias camera0 api + * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED"); - expect().assertFail(); - } + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); + await camera0InputPromise.setExposureBias(4) + .then(function (data) { + console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") + expect(true).assertTrue(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1); done(); }) /** - * @tc.number : SET_GET_ZOOM_6_PROMISE - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api + * @tc.number : GET_EXPOSURE_VALUE + * @tc.name : get exposure value camera0 api + * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED "); - } - else { - console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED"); - expect().assertFail(); - } + it('GET_EXPOSURE_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate"); + await camera0InputPromise.getExposureValue() + .then(function (data) { + console.info(TAG + "Entering getExposureValue SUCCESS"); + console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); + expect(data).assertEqual(4); + console.info(TAG + "GET_EXPOSURE_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_VALUE ends here"); await sleep(1); done(); }) @@ -1801,7 +3058,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEO_OUTPUT_START_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE videoOutputPromise == null || undefined') + console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') } else { console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE to operate') await videoOutputPromise.start() @@ -1825,13 +3082,15 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEO_RECORDER_START_PROMISE', 0, async function (done) { if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE videoRecorderPromise == null || undefined') + console.info(TAG + 'Entering Video recorder start videoRecorderPromise == null || undefined') } else { console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE to operate') await videoRecorder.start() - console.info(TAG + 'VIDEO_RECORDER_START_PROMISE called'); + console.info(TAG + 'Video recorder start called'); sleep(3); - console.info(TAG + 'VIDEO_RECORDER_START_PROMISE done.') + console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror : true.'); + photoOutputPromise.capture(photosettings1) + console.info(TAG + 'Capture during video - End.') expect(true).assertTrue() console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE PASSED') console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE ends here') @@ -1852,7 +3111,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEO_OUTPUT_STOP_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE videoOutputPromise == null || undefined') + console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') } else { console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE to operate') await videoOutputPromise.stop() @@ -1876,7 +3135,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEO_RECORDER_STOP_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE videoOutputPromise == null || undefined') + console.info(TAG + 'Entering Video recorder stop videoOutputPromise == null || undefined') } else { console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE to operate') await videoRecorder.stop() @@ -1901,7 +3160,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('CAPTURE_SESSION_STOP_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE captureSessionPromise == null || undefined') + console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') } else { console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE to operate') await captureSessionPromise.stop() @@ -1925,7 +3184,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('CAPTURE_SESSION_RELEASE_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE_PROMISE captureSessionPromise == null || undefined') + console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') } else { console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE_PROMISE to operate') await captureSessionPromise.release() @@ -1949,21 +3208,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined"); + console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); } else { console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await videoOutputPromise.release(); - console.info(TAG + "Entering VideoOutputPromise.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering VideoOutputPromise.release PASSED"); - } - console.info(TAG + "Entering VideoOutputPromise.release ends here"); + await videoOutputPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1); done(); } - await sleep(1); - done(); + await sleep(1) + done() }) /** @@ -1976,21 +3232,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined"); + console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); } else { console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await previewOutputPromise.release(); - console.info(TAG + "Entering previewOutputPromise.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutputPromise.release PASSED"); - } - console.info(TAG + "Entering previewOutputPromise.release ends here"); + await previewOutputPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1); done(); } - await sleep(1); - done(); + await sleep(1) + done() }) /** @@ -2003,21 +3256,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { */ it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE camera0InputPromise == null || undefined"); + console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); } else { console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE to operate"); - const promise = await camera0InputPromise.release(); - console.info(TAG + "Entering camera0InputPromise.release promise: " + JSON.stringify(promise)); - if (promise != null || promise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering camera0InputPromise.release PASSED"); - } - console.info(TAG + "Entering camera0InputPromise.release ends here"); + await camera0InputPromise.release(); + expect(true).assertTrue(); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1); done(); } - await sleep(1); - done(); + await sleep(1) + done() }) }) } \ No newline at end of file