diff --git a/multimedia/camera/camera_js_standard/src/main/config.json b/multimedia/camera/camera_js_standard/src/main/config.json index 11657c431b70968ea106d8655e24204b79b59ef2..fa83d30f524c724ac28e1a561133a99d0c0e451c 100644 --- a/multimedia/camera/camera_js_standard/src/main/config.json +++ b/multimedia/camera/camera_js_standard/src/main/config.json @@ -78,8 +78,12 @@ "reason": "use ohos.permission.READ_MEDIA" }, { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason": "use ohos.permission.START_ABILITIES_FROM_BACKGROUND" + "name": "ohos.permission.WRITE_MEDIA", + "reason": "use ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.START_ABILIIES_FROM_BACKGROUND", + "reason": "use ohos.permission.START_ABILIIES_FROM_BACKGROUND" }, { "name": "ohos.permission.START_INVISIBLE_ABILITY", diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets index 7df675043eac942f51cdf49bf3904307e9c6e9e6..7b83474a9f23e13f2e6795f739592f8a50d9c504 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets @@ -113,23 +113,35 @@ export default function cameraJSUnitOutput(surfaceId: any) { } } - async function getvideosurface() { await getFd('CameraOutput.mp4'); - videoConfig.url = fdPath; + videoConfig.url = fdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'createVideoRecorder called') - videoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(videoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - videoRecorder.prepare(videoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - }) - videoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - videoSurfaceId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoSurfaceId)) - }) + if (!err) { + console.info(TAG + 'createVideoRecorder called') + videoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(videoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + videoRecorder.prepare(videoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + videoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + videoSurfaceId = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoSurfaceId)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } + }) + } + else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) } @@ -164,7 +176,7 @@ export default function cameraJSUnitOutput(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - let permissionName6 = 'ohos.permission.START_ABILITIES_FROM_BACKGROUND'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { @@ -342,28 +354,28 @@ export default function cameraJSUnitOutput(surfaceId: any) { /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 + * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 * @tc.name : Create previewOutput instance async api * @tc.desc : Create previewOutput instance async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 2, async function (done) { - console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100', 2, async function (done) { + console.info(TAG + " --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100--------------"); if (isEmpty(cameraManager)) { console.info(TAG + "Entering CREATE_CAMERA_INPUT cameraManager == null || undefined") expect().assertFail(); } else { cameraInput = await cameraManager.createCameraInput(cameraDevicesArray[0]); if (isEmpty(cameraInput)) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); + console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 FAILED"); } cameraInput.open(async (err) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 open callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 open callback"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_OUTPUT_PROMISE_0100 FAILED: " + err.message); } await sleep(1000); done(); diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets index fbbfea772364410ba437b53f00e8d5bb3d09579d..a63b76bd6c161fe186501dd8cf0899a45d2b12b6 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets @@ -82,47 +82,59 @@ export default function cameraManagerTest(surfaceId: any) { let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - let fetchFileResult = await mediaTest.getFileAssets(fetchOp); - mFileAsset = await fetchFileResult.getAllObject(); - mFdNumber = await mFileAsset[0].open('Rw'); - mFdPath = "fd://" + mFdNumber.toString(); + let args = dataUri.id.toString(); + let fetchOp = { + selections: fileKeyObj.ID + "=?", + selectionArgs: [args], + } + let fetchFileResult = await mediaTest.getFileAssets(fetchOp); + mFileAsset = await fetchFileResult.getAllObject(); + mFdNumber = await mFileAsset[0].open('Rw'); + mFdPath = "fd://" + mFdNumber.toString(); } - } + } - async function closeFd() { + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { - console.info('[mediaLibrary] case close fd success'); - }).catch((err) => { - console.info('[mediaLibrary] case close fd failed'); - }); + await mFileAsset[0].close(mFdNumber).then(() => { + console.info('[mediaLibrary] case close fd success'); + }).catch((err) => { + console.info('[mediaLibrary] case close fd failed'); + }); } else { - console.info('[mediaLibrary] case fileAsset is null'); + console.info('[mediaLibrary] case fileAsset is null'); } - } + } - async function getVideoReceiveSurface() { + async function getVideoReceiveSurface() { console.log(TAG + 'Entering getVideoReceiveSurface') await getFd('CameraManager.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } }) - }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -218,7 +230,7 @@ export default function cameraManagerTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - let permissionName6 = 'ohos.permission.START_ABILITIES_FROM_BACKGROUND'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { @@ -293,24 +305,24 @@ describe('CameraManagerTest', function () { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 + * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 * @tc.name : Create camera manager instance async api * @tc.desc : Create camera manager instance async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100--------------"); cameraObj.getCameraManager(null, async (err, data) => { if (!err) { expect(isEmpty(data)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 success"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 FAILED: " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100 ends here"); await sleep(1000); done(); }) @@ -336,57 +348,57 @@ describe('CameraManagerTest', function () { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 + * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 * @tc.name : Get camera from cameramanager to get array of camera async api * @tc.desc : Get camera from cameramanager to get array of camera async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); + it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100--------------"); if (isEmpty(mCameraManager)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 cameraManager == null || undefined") + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 cameraManager == null || undefined") expect().assertFail(); } mCameraManager.getSupportedCameras(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 success"); if (!isEmpty(data)) { mCameraDevicesArray = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is " + mCameraDevicesArray.length); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 data is " + mCameraDevicesArray.length); if (mCameraDevicesArray.length > 0) { for (let i = 0; i < mCameraDevicesArray.length; i++) { // Get the variables from camera object let cameraId = mCameraDevicesArray[i].cameraId; expect(isEmpty(cameraId)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); let cameraPosition = mCameraDevicesArray[i].cameraPosition; expect(isEmpty(cameraPosition)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); let cameraType = mCameraDevicesArray[i].cameraType; expect(isEmpty(cameraType)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); let connectionType = mCameraDevicesArray[i].connectionType expect(isEmpty(connectionType)).assertFalse(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 ends here"); await sleep(1000); done(); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED , err = " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERAS_CALLBACK_0100 FAILED , err = " + err.message); } }) await sleep(1000); @@ -958,30 +970,30 @@ describe('CameraManagerTest', function () { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 + * @tc.number : SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 * @tc.name : Create CaptureSession instance api * @tc.desc : Create CaptureSession instance api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 2, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate"); + it('SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100', 2, async function (done) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate"); let cameraSession; mCameraManager.createCaptureSession(async (err, data) => { if (!err) { console.info(TAG + "Entering createCaptureSession success"); if (isEmpty(data)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 data == null || undefined") + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 data == null || undefined") expect().assertFail(); } else { cameraSession = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"); } await sleep(1000); done(); diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets index 283ae302fb3808625dae5020c147814f48c09ea5..af2fd124ced1bbe616d91390ea5932dd0c484dd7 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets @@ -40,10 +40,12 @@ let mFdPath; let mFdNumber; // CAMERA-0 letiables -let mCameraInputArray; -let mPreviewOutputArray; -let mPhotoOutputArray; -let mVideoOutputArray; +let mCameraNum; + +let mCameraInput; +let mPreviewOutput; +let mPhotoOutput; +let mVideoOutput; let mVideoProfileCfg = { audioBitrate: 48000, @@ -84,7 +86,7 @@ export default function cameraSessionTest(surfaceId: any) { return false; } - async function getFd(pathName){ + async function getFd(pathName) { let displayName = pathName; const mediaTest = mediaLibrary.getMediaLibrary(); let fileKeyObj = mediaLibrary.FileKey; @@ -92,25 +94,25 @@ export default function cameraSessionTest(surfaceId: any) { let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - let fetchFileResult = await mediaTest.getFileAssets(fetchOp); - mFileAsset = await fetchFileResult.getAllObject(); - mFdNumber = await mFileAsset[0].open('Rw'); - mFdPath = "fd://" + mFdNumber.toString(); + let args = dataUri.id.toString(); + let fetchOp = { + selections: fileKeyObj.ID + "=?", + selectionArgs: [args], + } + let fetchFileResult = await mediaTest.getFileAssets(fetchOp); + mFileAsset = await fetchFileResult.getAllObject(); + mFdNumber = await mFileAsset[0].open('Rw'); + mFdPath = "fd://" + mFdNumber.toString(); } } - + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { - console.info('[mediaLibrary] case close fd success'); - }).catch((err) => { - console.info('[mediaLibrary] case close fd failed'); - }); + await mFileAsset[0].close(mFdNumber).then(() => { + console.info('[mediaLibrary] case close fd success'); + }).catch((err) => { + console.info('[mediaLibrary] case close fd failed'); + }); } else { console.info('[mediaLibrary] case fileAsset is null'); } @@ -127,7 +129,7 @@ export default function cameraSessionTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - let permissionName6 = 'ohos.permission.START_ABILITIES_FROM_BACKGROUND'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { @@ -194,18 +196,30 @@ export default function cameraSessionTest(surfaceId: any) { await getFd('CameraSessionBase.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } }) - }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -258,7 +272,11 @@ export default function cameraSessionTest(surfaceId: any) { return false; } - console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraDevicesArray.length); + //mCameraNum = 1; + mCameraNum = mCameraDevicesArray.length; + + console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraNum); + console.info('Exit getCameraSupportDevicesArray'); return true; @@ -326,135 +344,133 @@ export default function cameraSessionTest(surfaceId: any) { await mCameraSession.release(); } - async function createInputs() { - console.info('Enter createInputs'); + async function createInput(idx:any) { + console.info('Enter createInput'); if (isEmpty(mCameraDevicesArray)) { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { + console.info(TAG + "createCameraInput FAILED"); + return false; + } - mCameraInputArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - mCameraInputArray[i] = await mCameraManager.createCameraInput(mCameraDevicesArray[i]); - if (isEmpty(mCameraInputArray[i])) { - console.info(TAG + "createCameraInput FAILED"); - return false; + mCameraInput.open(async (err) => { + console.info(TAG + "Entering mCameraInput open callback"); + if (!err) { + console.info(TAG + "Entering mCameraInput open PASSED "); + } else { + console.info(TAG + "Entering mCameraInput open FAILED : " + err.message); } + }) - mCameraInputArray[i].open(async (err) => { - console.info(TAG + "Entering mCameraInputArray open callback"); - if (!err) { - console.info(TAG + "Entering mCameraInputArray open PASSED "); - } else { - console.info(TAG + "Entering mCameraInputArray open FAILED : " + err.message); - } - }) - - await sleep(2000); + await sleep(100); - console.info(i + 'th CameraInput is: ' + mCameraInputArray[i]); - } + console.info(idx + 'th CameraInput is: ' + mCameraInput); - console.info('Exit createInputs'); + console.info('Exit createInput'); return true; } - async function releaseInputs() { - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering releaseInputs FAILED with NoCamera"); - } + async function releaseInput() { + console.info('Enter releaseInput'); - for (let i = 0; i < mCameraInputArray.length; i++) { - await mCameraInputArray[i].close(); - await mCameraInputArray[i].release(); + if (!isEmpty(mCameraInput)) { + await mCameraInput.close(); + await mCameraInput.release(); } + console.info('Exit releaseInput'); + return true; } - async function createOutputs() { - console.info('Enter createOutputs'); - - mPreviewOutputArray = new Array(mCameraDevicesArray.length); - mPhotoOutputArray = new Array(mCameraDevicesArray.length); - mVideoOutputArray = new Array(mCameraDevicesArray.length); + async function createOutput(idx:any) { + console.info('Enter createOutput'); - for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[i]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let j = 0; j < cameraOutputCap.previewProfiles.length; j++) { - mPreviewOutputArray[i] = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[j], surfaceId); - if (!isEmpty(mPreviewOutputArray[i])) { - break; - } + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; } + } - if (isEmpty(mPreviewOutputArray[i])) { - console.info(TAG + "createPreviewOutput FAILED"); - } + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); } + + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); } - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[0]); - if (!isEmpty(cameraOutputCap.photoProfiles)) { + + if (!isEmpty(cameraOutputCap.photoProfiles)) { console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); - - for (let j = 0; j < cameraOutputCap.photoProfiles.length; j++) { - mPhotoOutputArray[0] = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[j], mPhoteSurface); - if (!isEmpty(mPhotoOutputArray[0])) { + + for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) { + mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface); + if (!isEmpty(mPhotoOutput)) { break; } } - if (isEmpty(mPhotoOutputArray[0])) { - console.info(TAG + "createPhotoOutput FAILED"); + if (isEmpty(mPhotoOutput)) { + console.info(TAG + "createPhotoOutput FAILED"); } - console.info(TAG + "createPhotoOutput: " + mPhotoOutputArray[0]); + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); } - + /* if (!isEmpty(cameraOutputCap.videoProfiles)) { console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); - for (let j = 0; j < cameraOutputCap.videoProfiles.length; j++) { - mVideoOutputArray[0] = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[j], mVideoSurface); - if (!isEmpty(mVideoOutputArray[0])) { - break; + for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) { + try { + mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface); + if (!isEmpty(mVideoOutput)) { + break; + } + } + catch { + console.info(TAG + "createVideoOutput FAILED"); } } - if (isEmpty(mVideoOutputArray[0])) { + if (isEmpty(mVideoOutput)) { console.info(TAG + "createVideoOutput FAILED"); } - console.info(TAG + "createVideoOutput: " + mPhotoOutputArray[0]); + console.info(TAG + "createVideoOutput: " + mVideoOutput); } - + */ console.info('Exit createOutputs'); return true; } - async function releaseOutputs() { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - if (!isEmpty(mPreviewOutputArray[i])) { - await mPreviewOutputArray[i].close(); - await mPreviewOutputArray[i].release(); - } - } + async function releaseOutput() { + console.info('Enter releaseOutput'); - if (!isEmpty(mPhotoOutputArray[0])) { - await mPhotoOutputArray[0].close(); - await mPhotoOutputArray[0].release(); + if (!isEmpty(mPreviewOutput)) { + await mPreviewOutput.stop(); + await mPreviewOutput.release(); + } + + if (!isEmpty(mPhotoOutput)) { + await mPhotoOutput.release(); } - if (!isEmpty(mVideoOutputArray[0])) { - await mVideoOutputArray[0].close(); - await mVideoOutputArray[0].release(); + if (!isEmpty(mVideoOutput)) { + //await mVideoOutput.stop(); + await mVideoOutput.release(); } + + console.info('Exit releaseOutput'); return true; } @@ -462,27 +478,32 @@ export default function cameraSessionTest(surfaceId: any) { async function startCameraSession(idx:any) { console.info(TAG + "Enter startCameraSession"); - if (!isEmpty(mCameraInputArray[idx])) { + await createInput(idx); + await createOutput(idx); + + await sleep(1); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[idx]); + await mCameraSession.addInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[idx]); + await mCameraSession.addOutput(mPreviewOutput); } - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to addOutput mPhotoOutput"); - await mCameraSession.addOutput(mPhotoOutputArray[idx]); + await mCameraSession.addOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to addOutput mVideoOutput"); - await mCameraSession.addOutput(mVideoOutputArray[idx]); + await mCameraSession.addOutput(mVideoOutput); } */ + await sleep(1); await commitCameraSessionConfig(); @@ -503,7 +524,7 @@ export default function cameraSessionTest(surfaceId: any) { return true; } - async function stopCameraSession(idx:any) { + async function stopCameraSession() { console.info(TAG + "Enter stopCameraSession"); /* mCameraSession.stop(async (err) => { @@ -518,27 +539,28 @@ export default function cameraSessionTest(surfaceId: any) { await sleep(1000); */ - if (!isEmpty(mCameraInputArray[idx])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput input"); - await mCameraSession.removeInput(mCameraInputArray[idx]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[idx]); + await mCameraSession.removeOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to removeOutput mPhotoOutput"); - await mCameraSession.removeOutput(mPhotoOutputArray[idx]); + await mCameraSession.removeOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to removeOutput mVideoOutput"); - await mCameraSession.removeOutput(mVideoOutputArray[idx]); + await mCameraSession.removeOutput(mVideoOutput); } */ + await releaseInput(); + await releaseOutput(); console.info(TAG + "Exit stopCameraSession"); @@ -556,8 +578,6 @@ export default function cameraSessionTest(surfaceId: any) { await getCameraManagerInstance(); await getCameraSupportDevicesArray(); await createCameraSessionInstance(); - await createInputs(); - await createOutputs(); console.info('Device type = ' + deviceInfo.deviceType); @@ -567,19 +587,15 @@ export default function cameraSessionTest(surfaceId: any) { beforeEach(async function () { await sleep(100); console.info('beforeEach case'); - //await createCameraSessionInstance(); await sleep(100); }) afterEach(async function () { console.info('afterEach case'); - //await releaseCameraSessionInstance(); await sleep(100); }) afterAll(function () { - releaseInputs(); - releaseOutputs(); releaseVideoReceiveSurface(); releaseCameraSessionInstance(); sleep(1000); @@ -597,26 +613,29 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - if (!isEmpty(mCameraInputArray[0])) { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); try { - await mCameraSession.addInput(mCameraInputArray[0]); + await mCameraSession.addInput(mCameraInput); } catch { console.info(TAG + "addInput failed!"); } } - if (!isEmpty(mPreviewOutputArray[0])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); try { - await mCameraSession.addOutput(mPreviewOutputArray[0]); + await mCameraSession.addOutput(mPreviewOutput); } catch { console.info(TAG + "addOutput failed!"); @@ -645,15 +664,18 @@ export default function cameraSessionTest(surfaceId: any) { }) await sleep(500); - if (!isEmpty(mCameraInputArray[0])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput"); - await mCameraSession.removeInput(mCameraInputArray[0]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[0])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[0]); + await mCameraSession.removeOutput(mPreviewOutput); } + + await releaseInput(); + await releaseOutput(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_CALLBACK_0100 ends here"); done(); @@ -671,20 +693,23 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - if (!isEmpty(mCameraInputArray[0])) { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[0]); + await mCameraSession.addInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[0])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[0]); + await mCameraSession.addOutput(mPreviewOutput); } await sleep(500); @@ -705,15 +730,18 @@ export default function cameraSessionTest(surfaceId: any) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_PROMISE_0100 PASSED"); - if (!isEmpty(mCameraInputArray[0])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput"); - await mCameraSession.removeInput(mCameraInputArray[0]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[0])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[0]); + await mCameraSession.removeOutput(mPreviewOutput); } + + await releaseInput(); + await releaseOutput(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_CONFIG_PROMISE_0100 ends here"); done(); @@ -731,7 +759,7 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); @@ -773,7 +801,7 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); @@ -808,7 +836,7 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); @@ -850,7 +878,7 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); @@ -885,16 +913,19 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 start for camera[" + i + "]"); + + await createInput(i); + await createOutput(i); - mCameraSession.addInput(mCameraInputArray[i], async (err) => { + mCameraSession.addInput(mCameraInput, async (err) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 callback"); if (!err) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 PASSED"); @@ -903,8 +934,8 @@ export default function cameraSessionTest(surfaceId: any) { expect().assertFail(); } }) - await mCameraSession.addOutput(mPreviewOutputArray[i]); - await mCameraSession.addOutput(mPhotoOutputArray[i]); + await mCameraSession.addOutput(mPreviewOutput); + await mCameraSession.addOutput(mPhotoOutput); await sleep(500); await commitCameraSessionConfig(); @@ -912,7 +943,7 @@ export default function cameraSessionTest(surfaceId: any) { await beginCameraSessionConfig(); await sleep(1); - mCameraSession.removeInput(mCameraInputArray[i], async (err) => { + mCameraSession.removeInput(mCameraInput, async (err) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 callback"); if (!err) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 PASSED"); @@ -921,9 +952,12 @@ export default function cameraSessionTest(surfaceId: any) { expect().assertFail(); } }) - await mCameraSession.removeOutput(mPreviewOutputArray[i]); - await mCameraSession.removeOutput(mPhotoOutputArray[i]); + await mCameraSession.removeOutput(mPreviewOutput); + await mCameraSession.removeOutput(mPhotoOutput); await sleep(500); + + await releaseInput(); + await releaseOutput(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 end for camera[" + i + "]"); } @@ -944,18 +978,21 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100 start for camera[" + i + "]"); + + await createInput(i); + await createOutput(i); - await mCameraSession.addInput(mCameraInputArray[i]); - await mCameraSession.addOutput(mPreviewOutputArray[i]); - await mCameraSession.addOutput(mPhotoOutputArray[i]); + await mCameraSession.addInput(mCameraInput); + await mCameraSession.addOutput(mPreviewOutput); + await mCameraSession.addOutput(mPhotoOutput); await sleep(500); await commitCameraSessionConfig(); @@ -963,10 +1000,13 @@ export default function cameraSessionTest(surfaceId: any) { await beginCameraSessionConfig(); await sleep(1); - await mCameraSession.removeInput(mCameraInputArray[i]); - await mCameraSession.removeOutput(mPreviewOutputArray[i]); - await mCameraSession.removeOutput(mPhotoOutputArray[i]); + await mCameraSession.removeInput(mCameraInput); + await mCameraSession.removeOutput(mPreviewOutput); + await mCameraSession.removeOutput(mPhotoOutput); await sleep(500); + + await releaseInput(); + await releaseOutput(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100 end for camera[" + i + "]"); } @@ -975,6 +1015,7 @@ export default function cameraSessionTest(surfaceId: any) { done(); } }) + /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 * @tc.name : Check capture session add/remove output with callback or not for preview @@ -986,14 +1027,17 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - if (!isEmpty(mPreviewOutputArray[0])) { - mCameraSession.addOutput(mPreviewOutputArray[0], async (err) => { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mPreviewOutput)) { + mCameraSession.addOutput(mPreviewOutput, async (err) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 add callback"); if (!err) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 add PASSED"); @@ -1002,8 +1046,8 @@ export default function cameraSessionTest(surfaceId: any) { expect().assertFail(); } }) - await mCameraSession.addOutput(mPhotoOutputArray[0]); - await mCameraSession.addInput(mCameraInputArray[0]); + await mCameraSession.addOutput(mPhotoOutput); + await mCameraSession.addInput(mCameraInput); await sleep(500); await commitCameraSessionConfig(); @@ -1011,9 +1055,7 @@ export default function cameraSessionTest(surfaceId: any) { await beginCameraSessionConfig(); await sleep(1); - await sleep(500); - - mCameraSession.removeOutput(mPreviewOutputArray[0], async (err) => { + mCameraSession.removeOutput(mPreviewOutput, async (err) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 remove callback"); if (!err) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 remove PASSED"); @@ -1022,13 +1064,16 @@ export default function cameraSessionTest(surfaceId: any) { expect().assertFail(); } }) - await mCameraSession.removeOutput(mPhotoOutputArray[0]); - await mCameraSession.removeInput(mCameraInputArray[0]); + await mCameraSession.removeOutput(mPhotoOutput); + await mCameraSession.removeInput(mCameraInput); await sleep(500); } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 FAILED"); expect().assertFail(); } + + await releaseInput(); + await releaseOutput(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0100 ends here"); done(); @@ -1046,17 +1091,20 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - if (!isEmpty(mPreviewOutputArray[0])) { - await mCameraSession.addOutput(mPreviewOutputArray[0]); - await mCameraSession.addOutput(mPhotoOutputArray[0]); + await createInput(0); + await createOutput(0); + + if (!isEmpty(mPreviewOutput)) { + await mCameraSession.addOutput(mPreviewOutput); + await mCameraSession.addOutput(mPhotoOutput); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 add PASSED"); - await mCameraSession.addInput(mCameraInputArray[0]); + await mCameraSession.addInput(mCameraInput); await sleep(500); await commitCameraSessionConfig(); @@ -1066,15 +1114,18 @@ export default function cameraSessionTest(surfaceId: any) { await sleep(500); - await mCameraSession.removeOutput(mPreviewOutputArray[0]); + await mCameraSession.removeOutput(mPreviewOutput); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 remove PASSED"); - await mCameraSession.removeOutput(mPhotoOutputArray[0]); - await mCameraSession.removeInput(mCameraInputArray[0]); + await mCameraSession.removeOutput(mPhotoOutput); + await mCameraSession.removeInput(mCameraInput); await sleep(500); } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 FAILED"); expect().assertFail(); } + + await releaseInput(); + await releaseOutput(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 ends here"); done(); @@ -1082,37 +1133,40 @@ export default function cameraSessionTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 * @tc.name : Check capture session add/remove output with callback or not for photo * @tc.desc : Check capture session add/remove output with callback or not for photo * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - if (!isEmpty(mPhotoOutputArray[0])) { - if (!isEmpty(mPreviewOutputArray[0])) { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mPhotoOutput)) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[0]); + await mCameraSession.addOutput(mPreviewOutput); } - mCameraSession.addOutput(mPhotoOutputArray[0], async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 add callback"); + mCameraSession.addOutput(mPhotoOutput, async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 add callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 add PASSED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 add PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 add FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 add FAILED : " + err.message); expect().assertFail(); } }) - await mCameraSession.addInput(mCameraInputArray[0]); + await mCameraSession.addInput(mCameraInput); await sleep(500); await commitCameraSessionConfig(); @@ -1122,56 +1176,62 @@ export default function cameraSessionTest(surfaceId: any) { await sleep(500); - if (!isEmpty(mPreviewOutputArray[0])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[0]); + await mCameraSession.removeOutput(mPreviewOutput); } - mCameraSession.removeOutput(mPhotoOutputArray[0], async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 remove callback"); + mCameraSession.removeOutput(mPhotoOutput, async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 remove callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 remove PASSED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 remove PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 remove FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 remove FAILED : " + err.message); expect().assertFail(); } }) - await mCameraSession.removeInput(mCameraInputArray[0]); + await mCameraSession.removeInput(mCameraInput); await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 FAILED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 FAILED"); expect().assertFail(); } + + await releaseInput(); + await releaseOutput(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 * @tc.name : Check capture session can add/remove output with promise or not for photo * @tc.desc : Check capture session can add/remove output with promise or not for photo * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - if (!isEmpty(mPhotoOutputArray[0])) { - if (!isEmpty(mPreviewOutputArray[0])) { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mPhotoOutput)) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[0]); + await mCameraSession.addOutput(mPreviewOutput); } - await mCameraSession.addOutput(mPhotoOutputArray[0]); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200 add PASSED"); - await mCameraSession.addInput(mCameraInputArray[0]); + await mCameraSession.addOutput(mPhotoOutput); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 add PASSED"); + await mCameraSession.addInput(mCameraInput); await sleep(500); await commitCameraSessionConfig(); @@ -1181,24 +1241,157 @@ export default function cameraSessionTest(surfaceId: any) { await sleep(500); - if (!isEmpty(mPreviewOutputArray[0])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[0]); + await mCameraSession.removeOutput(mPreviewOutput); } - await mCameraSession.removeOutput(mPhotoOutputArray[0]); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200 remove PASSED"); - await mCameraSession.removeInput(mCameraInputArray[0]); + await mCameraSession.removeOutput(mPhotoOutput); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 remove PASSED"); + await mCameraSession.removeInput(mCameraInput); await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200 FAILED"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 FAILED"); expect().assertFail(); } + + await releaseInput(); + await releaseOutput(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0101 ends here"); done(); } }) + /** + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 + * @tc.name : Check capture session add/remove output with callback or not for video + * @tc.desc : Check capture session add/remove output with callback or not for video + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102--------------"); + + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 FAILED with NoCamera"); + expect().assertFail(); + done(); + } + else { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mVideoOutput)) { + + mCameraSession.addOutput(mVideoOutput, async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 add callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 add PASSED"); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 add FAILED : " + err.message); + expect().assertFail(); + } + }) + if (!isEmpty(mPreviewOutput)) { + console.info(TAG + "Start to addOutput mPreviewOutput"); + await mCameraSession.addOutput(mPreviewOutput); + } + await mCameraSession.addInput(mCameraInput); + await sleep(500); + + await commitCameraSessionConfig(); + await sleep(1); + await beginCameraSessionConfig(); + await sleep(1); + + await sleep(500); + + mCameraSession.removeOutput(mVideoOutput, async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 remove callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 remove PASSED"); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 remove FAILED : " + err.message); + expect().assertFail(); + } + }) + await sleep(100); + if (!isEmpty(mPreviewOutput)) { + console.info(TAG + "Start to removeOutput mPreviewOutput"); + await mCameraSession.removeOutput(mPreviewOutput); + } + await mCameraSession.removeInput(mCameraInput); + await sleep(500); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 FAILED"); + } + + await releaseInput(); + await releaseOutput(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_CALLBACK_0102 ends here"); + done(); + } + }) + + /** + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 + * @tc.name : Check capture session can add/remove output with promise or not for video + * @tc.desc : Check capture session can add/remove output with promise or not for video + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102--------------"); + + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 FAILED with NoCamera"); + expect().assertFail(); + done(); + } + else { + await createInput(0); + await createOutput(0); + + if (!isEmpty(mVideoOutput)) { + if (!isEmpty(mPreviewOutput)) { + console.info(TAG + "Start to addOutput mPreviewOutput"); + await mCameraSession.addOutput(mPreviewOutput); + } + await mCameraSession.addOutput(mVideoOutput); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 PASSED"); + await mCameraSession.addInput(mCameraInput); + await sleep(500); + + await commitCameraSessionConfig(); + await sleep(1); + await beginCameraSessionConfig(); + await sleep(1); + + await sleep(500); + + if (!isEmpty(mPreviewOutput)) { + console.info(TAG + "Start to removeOutput mPreviewOutput"); + await mCameraSession.removeOutput(mPreviewOutput); + } + await sleep(100); + await mCameraSession.removeOutput(mVideoOutput); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 remove PASSED"); + await mCameraSession.removeInput(mCameraInput); + await sleep(500); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 FAILED"); + } + + await releaseInput(); + await releaseOutput(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 ends here"); + done(); + } + }) /** * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 @@ -1211,12 +1404,12 @@ export default function cameraSessionTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { let nfyFlag = false; console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 start for camera[" + i + "]"); @@ -1247,7 +1440,7 @@ export default function cameraSessionTest(surfaceId: any) { } await beginCameraSessionConfig(); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 end for camera[" + i + "]"); } @@ -1258,38 +1451,38 @@ export default function cameraSessionTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 * @tc.name : camera status callback on CaptureSession async api for exposureStateChange * @tc.desc : camera status callback on CaptureSession async api for exposureStateChange * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { let nfyFlag = false; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 start for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.on('exposureStateChange', async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 callback"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 PASSED: " + data); + console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 PASSED: " + data); nfyFlag = true; } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 FAILED: " + err.message); + console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED: " + err.message); } await sleep(1); }) @@ -1300,53 +1493,53 @@ export default function cameraSessionTest(surfaceId: any) { if (nfyFlag == false) { //expect().assertFail(); - //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 FAILED without any nofity!"); + //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!"); } await beginCameraSessionConfig(); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 * @tc.name : camera status callback on CaptureSession async api for error * @tc.desc : camera status callback on CaptureSession async api for error * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { let nfyFlag = false; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 start for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.on('error', async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 callback"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 PASSED: " + data); + console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 PASSED: " + data); nfyFlag = true; } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 FAILED: " + err.message); + console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED: " + err.message); } await sleep(1); }) @@ -1355,16 +1548,16 @@ export default function cameraSessionTest(surfaceId: any) { if (nfyFlag == false) { //expect().assertFail(); - //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 FAILED without any nofity!"); + //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED without any nofity!"); } await beginCameraSessionConfig(); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 ends here"); done(); } }) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets index ac91f6311853c3bdcc9cf42298b49db5702f6aae..6ab8fe7af1e7019bbf95214d33f0b88cacec941b 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets @@ -40,10 +40,12 @@ let mFdPath; let mFdNumber; // CAMERA-0 letiables -let mCameraInputArray; -let mPreviewOutputArray; -let mPhotoOutputArray; -let mVideoOutputArray; +let mCameraNum; + +let mCameraInput; +let mPreviewOutput; +let mPhotoOutput; +let mVideoOutput; let mIsExposureModeSupportedArray; let mExposureBiasRangeArray; @@ -139,7 +141,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { return false; } - async function getFd(pathName){ + async function getFd(pathName) { let displayName = pathName; const mediaTest = mediaLibrary.getMediaLibrary(); let fileKeyObj = mediaLibrary.FileKey; @@ -147,27 +149,27 @@ export default function cameraSessionExposureTest(surfaceId: any) { let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - let fetchFileResult = await mediaTest.getFileAssets(fetchOp); - mFileAsset = await fetchFileResult.getAllObject(); - mFdNumber = await mFileAsset[0].open('Rw'); - mFdPath = "fd://" + mFdNumber.toString(); + let args = dataUri.id.toString(); + let fetchOp = { + selections: fileKeyObj.ID + "=?", + selectionArgs: [args], + } + let fetchFileResult = await mediaTest.getFileAssets(fetchOp); + mFileAsset = await fetchFileResult.getAllObject(); + mFdNumber = await mFileAsset[0].open('Rw'); + mFdPath = "fd://" + mFdNumber.toString(); } } - + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { - console.info('[mediaLibrary] case close fd success'); - }).catch((err) => { - console.info('[mediaLibrary] case close fd failed'); - }); + await mFileAsset[0].close(mFdNumber).then(() => { + console.info('[mediaLibrary] case close fd success'); + }).catch((err) => { + console.info('[mediaLibrary] case close fd failed'); + }); } else { - console.info('[mediaLibrary] case fileAsset is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } @@ -182,6 +184,9 @@ export default function cameraSessionExposureTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; + let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; + let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { console.info('[permission] case grantUserGrantedPermission success :' + result); }).catch((err) => { @@ -207,6 +212,21 @@ export default function cameraSessionExposureTest(surfaceId: any) { }).catch((err) => { console.info('[permission] case grantUserGrantedPermission failed :' + err); }); + await atManager.grantUserGrantedPermission(tokenID, permissionName6, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName7, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName8, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); } else { console.info('[permission] case apply permission failed, createAtManager failed'); } @@ -231,18 +251,30 @@ export default function cameraSessionExposureTest(surfaceId: any) { await getFd('CameraSessionExposure.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } }) - }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -295,7 +327,16 @@ export default function cameraSessionExposureTest(surfaceId: any) { return false; } - console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraDevicesArray.length); + //mCameraNum = 1; + mCameraNum = mCameraDevicesArray.length; + + console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraNum); + + mIsExposureModeSupportedArray = new Array(mCameraNum); + mExposureBiasRangeArray = new Array(mCameraNum); + mExposureBiasMaxArray = new Array(mCameraNum); + mExposureBiasMinArray = new Array(mCameraNum); + console.info('Exit getCameraSupportDevicesArray'); return true; @@ -363,175 +404,165 @@ export default function cameraSessionExposureTest(surfaceId: any) { await mCameraSession.release(); } - async function createInputs() { - console.info('Enter createInputs'); + async function createInput(idx:any) { + console.info('Enter createInput'); if (isEmpty(mCameraDevicesArray)) { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { + console.info(TAG + "createCameraInput FAILED"); + return false; + } - mCameraInputArray = new Array(mCameraDevicesArray.length); - mIsExposureModeSupportedArray = new Array(mCameraDevicesArray.length); - mExposureBiasRangeArray = new Array(mCameraDevicesArray.length); - mExposureBiasMaxArray = new Array(mCameraDevicesArray.length); - mExposureBiasMinArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - mCameraInputArray[i] = await mCameraManager.createCameraInput(mCameraDevicesArray[i]); - if (isEmpty(mCameraInputArray[i])) { - console.info(TAG + "createCameraInput FAILED"); - return false; + mCameraInput.open(async (err) => { + console.info(TAG + "Entering mCameraInput open callback"); + if (!err) { + console.info(TAG + "Entering mCameraInput open PASSED "); + } else { + console.info(TAG + "Entering mCameraInput open FAILED : " + err.message); } + }) - mCameraInputArray[i].open(async (err) => { - console.info(TAG + "Entering mCameraInputArray open callback"); - if (!err) { - console.info(TAG + "Entering mCameraInputArray open PASSED "); - } else { - console.info(TAG + "Entering mCameraInputArray open FAILED : " + err.message); - } - }) - - await sleep(2000); + await sleep(100); - console.info(i + 'th CameraInput is: ' + mCameraInputArray[i]); - } + console.info(idx + 'th CameraInput is: ' + mCameraInput); - console.info('Exit createInputs'); + console.info('Exit createInput'); return true; } - async function releaseInputs() { - console.info('Enter releaseInputs'); - - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering releaseInputs FAILED with NoCamera"); - return true; - } + async function releaseInput() { + console.info('Enter releaseInput'); - for (let i = 0; i < mCameraInputArray.length; i++) { - await mCameraInputArray[i].close(); - await mCameraInputArray[i].release(); + if (!isEmpty(mCameraInput)) { + await mCameraInput.close(); + await mCameraInput.release(); } - console.info('Exit releaseInputs'); + console.info('Exit releaseInput'); return true; } - async function createOutputs() { - console.info('Enter createOutputs'); - - mPreviewOutputArray = new Array(mCameraDevicesArray.length); - mPhotoOutputArray = new Array(mCameraDevicesArray.length); - mVideoOutputArray = new Array(mCameraDevicesArray.length); + async function createOutput(idx:any) { + console.info('Enter createOutput'); - for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[i]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let j = 0; j < cameraOutputCap.previewProfiles.length; j++) { - mPreviewOutputArray[i] = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[j], surfaceId); - if (!isEmpty(mPreviewOutputArray[i])) { - break; - } + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; } + } - if (isEmpty(mPreviewOutputArray[i])) { - console.info(TAG + "createPreviewOutput FAILED"); - } + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); } - /* - if (!isEmpty(cameraOutputCap.photoProfiles)) { - console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); + } + + if (!isEmpty(cameraOutputCap.photoProfiles)) { + console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); - for (let j = 0; j < cameraOutputCap.photoProfiles.length; j++) { - mPhotoOutputArray[i] = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[j], mPhoteSurface); - if (!isEmpty(mPhotoOutputArray[i])) { - break; - } + for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) { + mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface); + if (!isEmpty(mPhotoOutput)) { + break; } + } - if (isEmpty(mPhotoOutputArray[i])) { + if (isEmpty(mPhotoOutput)) { console.info(TAG + "createPhotoOutput FAILED"); - } - - console.info(TAG + "createPhotoOutput: " + mPhotoOutputArray[i]); } - if (!isEmpty(cameraOutputCap.videoProfiles)) { - console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); - for (let j = 0; j < cameraOutputCap.videoProfiles.length; j++) { - mVideoOutputArray[i] = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[j], mVideoSurface); - if (!isEmpty(mVideoOutputArray[i])) { + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); + } + /* + if (!isEmpty(cameraOutputCap.videoProfiles)) { + console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); + for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) { + try { + mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface); + if (!isEmpty(mVideoOutput)) { break; } } - - if (isEmpty(mVideoOutputArray[i])) { + catch { console.info(TAG + "createVideoOutput FAILED"); } + } - console.info(TAG + "createVideoOutput: " + mPhotoOutputArray[i]); + if (isEmpty(mVideoOutput)) { + console.info(TAG + "createVideoOutput FAILED"); } - */ - } + console.info(TAG + "createVideoOutput: " + mVideoOutput); + } + */ console.info('Exit createOutputs'); return true; } - async function releaseOutputs() { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - if (!isEmpty(mPreviewOutputArray[i])) { - await mPreviewOutputArray[i].close(); - await mPreviewOutputArray[i].release(); - } - - /* - if (!isEmpty(mPhotoOutputArray[i])) { - await mPhotoOutputArray[i].close(); - await mPhotoOutputArray[i].release(); - } - - if (!isEmpty(mVideoOutputArray[i])) { - await mVideoOutputArray[i].close(); - await mVideoOutputArray[i].release(); - } - */ + async function releaseOutput() { + console.info('Enter createOutput'); + + if (!isEmpty(mPreviewOutput)) { + await mPreviewOutput.stop(); + await mPreviewOutput.release(); } + if (!isEmpty(mPhotoOutput)) { + await mPhotoOutput.release(); + } + /* + if (!isEmpty(mVideoOutput)) { + await mVideoOutput.stop(); + await mVideoOutput.release(); + } + */ + console.info('Exit createOutput'); + return true; } async function startCameraSession(idx:any) { console.info(TAG + "Enter startCameraSession"); - if (!isEmpty(mCameraInputArray[idx])) { + await createInput(idx); + await createOutput(idx); + + await sleep(1); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[idx]); + await mCameraSession.addInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[idx]); + await mCameraSession.addOutput(mPreviewOutput); } - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to addOutput mPhotoOutput"); - await mCameraSession.addOutput(mPhotoOutputArray[idx]); + await mCameraSession.addOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to addOutput mVideoOutput"); - await mCameraSession.addOutput(mVideoOutputArray[idx]); + await mCameraSession.addOutput(mVideoOutput); } */ + await sleep(1); await commitCameraSessionConfig(); await beginCameraSessionConfig(); @@ -553,7 +584,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { return true; } - async function stopCameraSession(idx:any) { + async function stopCameraSession() { console.info(TAG + "Enter stopCameraSession"); /* mCameraSession.stop(async (err) => { @@ -568,27 +599,28 @@ export default function cameraSessionExposureTest(surfaceId: any) { await sleep(1000); */ - if (!isEmpty(mCameraInputArray[idx])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput input"); - await mCameraSession.removeInput(mCameraInputArray[idx]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[idx]); + await mCameraSession.removeOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to removeOutput mPhotoOutput"); - await mCameraSession.removeOutput(mPhotoOutputArray[idx]); + await mCameraSession.removeOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to removeOutput mVideoOutput"); - await mCameraSession.removeOutput(mVideoOutputArray[idx]); + await mCameraSession.removeOutput(mVideoOutput); } */ + await releaseInput(); + await releaseOutput(); console.info(TAG + "Exit stopCameraSession"); @@ -606,8 +638,6 @@ export default function cameraSessionExposureTest(surfaceId: any) { await getCameraManagerInstance(); await getCameraSupportDevicesArray(); await createCameraSessionInstance(); - await createInputs(); - await createOutputs(); console.info('Device type = ' + deviceInfo.deviceType); @@ -624,8 +654,6 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) afterAll(function () { - releaseInputs(); - releaseOutputs(); releaseVideoReceiveSurface(); releaseCameraSessionInstance(); sleep(1000); @@ -643,12 +671,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -672,7 +700,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); } @@ -693,12 +721,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -714,7 +742,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0100 end for camera[" + i + "]"); } @@ -735,12 +763,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -776,7 +804,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 not support"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0100 end for camera[" + i + "]"); } @@ -797,12 +825,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -826,7 +854,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100 not support"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0100 end for camera[" + i + "]"); } @@ -837,255 +865,255 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 * @tc.name : Check capture session support exposure auto mode with callback or not * @tc.desc : Check capture session support exposure auto mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mIsExposureModeSupportedArray[i] = false; mCameraSession.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 callback"); if (!err) { if (data != null || data != undefined) { mIsExposureModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 PASSED with isExposureModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 PASSED with isExposureModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 FAILED with isExposureModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 FAILED with isExposureModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 * @tc.name : Check capture session support exposure auto mode with promise or not * @tc.desc : Check capture session support exposure auto mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); let isExposureModeSupported = await mCameraSession.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 finish"); if (isExposureModeSupported != null || isExposureModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 PASSED with isExposureModeSupported is: " + isExposureModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 PASSED with isExposureModeSupported is: " + isExposureModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 FAILED with isExposureModeSupported is: " + isExposureModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 FAILED with isExposureModeSupported is: " + isExposureModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 * @tc.name : Check capture session set exposure auto mode with callback * @tc.desc : Check capture session set exposure auto mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); if (mIsExposureModeSupportedArray[i] == true) { mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getExposureMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 callback"); if (!err) { if (data == cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 PASSED with ExposureMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 PASSED with ExposureMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 FAILED with ExposureMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED with ExposureMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 * @tc.name : Check capture session set exposure auto mode with promise * @tc.desc : Check capture session set exposure auto mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); if (mIsExposureModeSupportedArray[i] == true) { await mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); await sleep(500); let exposureMode = await mCameraSession.getExposureMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 finish"); if (exposureMode == cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 PASSED with ExposureMode is: " + exposureMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 PASSED with ExposureMode is: " + exposureMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 FAILED with ExposureMode is: " + exposureMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 FAILED with ExposureMode is: " + exposureMode); expect().assertFail(); } await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 * @tc.name : Check capture session support exposure continuous auto mode with callback or not * @tc.desc : Check capture session support exposure continuous auto mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mIsExposureModeSupportedArray[i] = false; mCameraSession.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 callback"); if (!err) { if (data != null || data != undefined) { mIsExposureModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 PASSED with isExposureModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 PASSED with isExposureModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 FAILED with isExposureModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 FAILED with isExposureModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_CALLBACK_0102 ends here"); done(); } }) @@ -1098,15 +1126,15 @@ export default function cameraSessionExposureTest(surfaceId: any) { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0300', 2, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); @@ -1122,7 +1150,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102 end for camera[" + i + "]"); } @@ -1133,113 +1161,113 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 * @tc.name : Check capture session set exposure continuous auto mode with callback * @tc.desc : Check capture session set exposure continuous auto mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); if (mIsExposureModeSupportedArray[i] == true) { mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getExposureMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 callback"); if (!err) { if (data == cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 PASSED with ExposureMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 PASSED with ExposureMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 FAILED with ExposureMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED with ExposureMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 * @tc.name : Check capture session set exposure continuous auto mode with promise * @tc.desc : Check capture session set exposure continuous auto mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); if (mIsExposureModeSupportedArray[i] == true) { await mCameraSession.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 PASSED with ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); await sleep(500); let exposureMode = await mCameraSession.getExposureMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 finish"); if (exposureMode == cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 PASSED with ExposureMode is: " + exposureMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 PASSED with ExposureMode is: " + exposureMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 FAILED with ExposureMode is: " + exposureMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 FAILED with ExposureMode is: " + exposureMode); expect().assertFail(); } await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_MODE_PROMISE_0102 ends here"); done(); } }) @@ -1255,12 +1283,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -1292,7 +1320,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0100 end for camera[" + i + "]"); } @@ -1313,12 +1341,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -1338,7 +1366,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0100 end for camera[" + i + "]"); } @@ -1349,834 +1377,834 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 * @tc.name : Check capture session set METERING point with callback(left-top point) * @tc.desc : Check capture session set METERING point with callback(left-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 callback"); if (!err) { if ((data.x == mMETERINGPointLT.x) && (data.y == mMETERINGPointLT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 * @tc.name : Check capture session set METERING point with promise(left-top point) * @tc.desc : Check capture session set METERING point with promise(left-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointLT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 PASSED with METERINGPoint is: " + mMETERINGPointLT.x + ", " + mMETERINGPointLT.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 finish"); if ((METERINGPoint.x == mMETERINGPointLT.x) && (METERINGPoint.y == mMETERINGPointLT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 * @tc.name : Check capture session set METERING point with callback(right-top point) * @tc.desc : Check capture session set METERING point with callback(right-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 PASSED with METERINGPoint is: " + mMETERINGPointRT.x + ", " + mMETERINGPointRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 PASSED with METERINGPoint is: " + mMETERINGPointRT.x + ", " + mMETERINGPointRT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 callback"); if (!err) { if ((data.x == mMETERINGPointRT.x) && (data.y == mMETERINGPointRT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 * @tc.name : Check capture session set METERING point with promise(right-top point) * @tc.desc : Check capture session set METERING point with promise(right-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointRT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 PASSED with METERINGPoint is: " + mMETERINGPointRT.x + ", " + mMETERINGPointRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 PASSED with METERINGPoint is: " + mMETERINGPointRT.x + ", " + mMETERINGPointRT.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 finish"); if ((METERINGPoint.x == mMETERINGPointRT.x) && (METERINGPoint.y == mMETERINGPointRT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 * @tc.name : Check capture session set METERING point with callback(left-bottom point) * @tc.desc : Check capture session set METERING point with callback(left-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 PASSED with METERINGPoint is: " + mMETERINGPointLB.x + ", " + mMETERINGPointRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 PASSED with METERINGPoint is: " + mMETERINGPointLB.x + ", " + mMETERINGPointRB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 callback"); if (!err) { if ((data.x == mMETERINGPointLB.x) && (data.y == mMETERINGPointLB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 * @tc.name : Check capture session set METERING point with promise(left-bottom point) * @tc.desc : Check capture session set METERING point with promise(left-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointLB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 PASSED with METERINGPoint is: " + mMETERINGPointLB.x + ", " + mMETERINGPointRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 PASSED with METERINGPoint is: " + mMETERINGPointLB.x + ", " + mMETERINGPointRB.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 finish"); if ((METERINGPoint.x == mMETERINGPointLB.x) && (METERINGPoint.y == mMETERINGPointLB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 * @tc.name : Check capture session set METERING point with callback(right-bottom point) * @tc.desc : Check capture session set METERING point with callback(right-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 PASSED with METERINGPoint is: " + mMETERINGPointRB.x + ", " + mMETERINGPointRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 PASSED with METERINGPoint is: " + mMETERINGPointRB.x + ", " + mMETERINGPointRB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 callback"); if (!err) { if ((data.x == mMETERINGPointRB.x) && (data.y == mMETERINGPointRB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 * @tc.name : Check capture session set METERING point with promise(right-bottom point) * @tc.desc : Check capture session set METERING point with promise(right-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointRB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 PASSED with METERINGPoint is: " + mMETERINGPointRB.x + ", " + mMETERINGPointRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 PASSED with METERINGPoint is: " + mMETERINGPointRB.x + ", " + mMETERINGPointRB.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 finish"); if ((METERINGPoint.x == mMETERINGPointRB.x) && (METERINGPoint.y == mMETERINGPointRB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 * @tc.name : Check capture session set METERING point with callback(left-top invalid point) * @tc.desc : Check capture session set METERING point with callback(left-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointInvalidLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLT.x + ", " + mMETERINGPointInvalidLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLT.x + ", " + mMETERINGPointInvalidLT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 callback"); if (!err) { if (((data.x != mMETERINGPointInvalidLT.x) && (data.y != mMETERINGPointInvalidLT.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0600 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0105 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 * @tc.name : Check capture session set METERING point with promise(left-top invalid point) * @tc.desc : Check capture session set METERING point with promise(left-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointInvalidLT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLT.x + ", " + mMETERINGPointInvalidLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLT.x + ", " + mMETERINGPointInvalidLT.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 finish"); if (((METERINGPoint.x != mMETERINGPointInvalidLT.x) && (METERINGPoint.y != mMETERINGPointInvalidLT.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0600 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0105 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 * @tc.name : Check capture session set METERING point with callback(right-top invalid point) * @tc.desc : Check capture session set METERING point with callback(right-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointInvalidRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRT.x + ", " + mMETERINGPointInvalidRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRT.x + ", " + mMETERINGPointInvalidRT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 callback"); if (!err) { if (((data.x != mMETERINGPointInvalidRT.x) && (data.y != mMETERINGPointInvalidRT.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0700 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0106 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 * @tc.name : Check capture session set METERING point with promise(right-top invalid point) * @tc.desc : Check capture session set METERING point with promise(right-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointInvalidRT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRT.x + ", " + mMETERINGPointInvalidRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRT.x + ", " + mMETERINGPointInvalidRT.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 finish"); if (((METERINGPoint.x != mMETERINGPointInvalidRT.x) && (METERINGPoint.y != mMETERINGPointInvalidRT.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0700 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0106 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 * @tc.name : Check capture session set METERING point with callback(left-bottom invalid point) * @tc.desc : Check capture session set METERING point with callback(left-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointInvalidLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLB.x + ", " + mMETERINGPointInvalidRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLB.x + ", " + mMETERINGPointInvalidRB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 callback"); if (!err) { if (((data.x != mMETERINGPointInvalidLB.x) && (data.y != mMETERINGPointInvalidLB.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0800 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0107 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 * @tc.name : Check capture session set METERING point with promise(left-bottom invalid point) * @tc.desc : Check capture session set METERING point with promise(left-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointInvalidLB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLB.x + ", " + mMETERINGPointInvalidRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 PASSED with METERINGPoint is: " + mMETERINGPointInvalidLB.x + ", " + mMETERINGPointInvalidRB.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 finish"); if (((METERINGPoint.x != mMETERINGPointInvalidLB.x) && (METERINGPoint.y != mMETERINGPointInvalidLB.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0800 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0107 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 * @tc.name : Check capture session set METERING point with callback(right-bottom invalid point) * @tc.desc : Check capture session set METERING point with callback(right-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setMeteringPoint(mMETERINGPointInvalidRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRB.x + ", " + mMETERINGPointInvalidRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRB.x + ", " + mMETERINGPointInvalidRB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getMeteringPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 callback"); if (!err) { if (((data.x != mMETERINGPointInvalidRB.x) && (data.y != mMETERINGPointInvalidRB.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 PASSED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 PASSED with METERINGPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 FAILED with METERINGPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED with METERINGPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0900 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_CALLBACK_0108 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 * @tc.name : Check capture session set METERING point with promise(right-bottom invalid point) * @tc.desc : Check capture session set METERING point with promise(right-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setMeteringPoint(mMETERINGPointInvalidRB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRB.x + ", " + mMETERINGPointInvalidRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 PASSED with METERINGPoint is: " + mMETERINGPointInvalidRB.x + ", " + mMETERINGPointInvalidRB.y); await sleep(500); let METERINGPoint = await mCameraSession.getMeteringPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 finish"); if (((METERINGPoint.x != mMETERINGPointInvalidRB.x) && (METERINGPoint.y != mMETERINGPointInvalidRB.y)) || (mEnableCheckInvalidMETERINGPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 PASSED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 FAILED with METERINGPoint is: " + METERINGPoint.x + ", " + METERINGPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0900 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_METERING_POINT_PROMISE_0108 ends here"); done(); } }) @@ -2192,12 +2220,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -2232,7 +2260,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_CALLBACK_0100 end for camera[" + i + "]"); } @@ -2253,12 +2281,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -2278,7 +2306,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_EXPOSURE_BIAS_RANGE_PROMISE_0100 end for camera[" + i + "]"); } @@ -2299,12 +2327,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -2336,7 +2364,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0100 end for camera[" + i + "]"); } @@ -2357,12 +2385,12 @@ export default function cameraSessionExposureTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -2382,7 +2410,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0100 end for camera[" + i + "]"); } @@ -2393,417 +2421,417 @@ export default function cameraSessionExposureTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 * @tc.name : Check capture session set exposure bias with callback(invalid value, min - 1) * @tc.desc : Check capture session set exposure bias with callback(invalid value, min - 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setExposureBias(mExposureBiasMinArray[i] - 1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 callback"); if (!err) { if (data != (mExposureBiasMinArray[i] - 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 PASSED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 PASSED with ExposureValue is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 FAILED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED with ExposureValue is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 * @tc.name : Check capture session set exposure bias with promise(invalid value, min - 1) * @tc.desc : Check capture session set exposure bias with promise(invalid value, min - 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setExposureBias(mExposureBiasMinArray[i] - 1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 1)); await sleep(500); let exposureValue = await mCameraSession.getExposureValue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 finish"); if (exposureValue != (mExposureBiasMinArray[i] - 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 PASSED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 PASSED with ExposureValue is: " + exposureValue); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 FAILED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 FAILED with ExposureValue is: " + exposureValue); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 * @tc.name : Check capture session set exposure bias with callback(invalid value, min - 0.1) * @tc.desc : Check capture session set exposure bias with callback(invalid value, min - 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setExposureBias(mExposureBiasMinArray[i] - 0.1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 0.1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 0.1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 callback"); if (!err) { if (data != (mExposureBiasMinArray[i] - 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 PASSED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 PASSED with ExposureValue is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 FAILED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED with ExposureValue is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 * @tc.name : Check capture session set exposure bias with promise(invalid value, min - 0.1) * @tc.desc : Check capture session set exposure bias with promise(invalid value, min - 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setExposureBias(mExposureBiasMinArray[i] - 0.1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 0.1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 PASSED with ExposureBias is: " + (mExposureBiasMinArray[i] - 0.1)); await sleep(500); let exposureValue = await mCameraSession.getExposureValue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 finish"); if (exposureValue != (mExposureBiasMinArray[i] - 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 PASSED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 PASSED with ExposureValue is: " + exposureValue); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 FAILED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 FAILED with ExposureValue is: " + exposureValue); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 * @tc.name : Check capture session set exposure bias with callback(invalid value, max + 1) * @tc.desc : Check capture session set exposure bias with callback(invalid value, max + 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setExposureBias(mExposureBiasMaxArray[i] + 1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 callback"); if (!err) { if (data != (mExposureBiasMaxArray[i] + 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 PASSED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 PASSED with ExposureValue is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 FAILED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED with ExposureValue is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 * @tc.name : Check capture session set exposure bias with promise(invalid value, max + 1) * @tc.desc : Check capture session set exposure bias with promise(invalid value, max + 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setExposureBias(mExposureBiasMaxArray[i] + 1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 1)); await sleep(500); let exposureValue = await mCameraSession.getExposureValue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 finish"); if (exposureValue != (mExposureBiasMaxArray[i] + 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 PASSED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 PASSED with ExposureValue is: " + exposureValue); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 FAILED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 FAILED with ExposureValue is: " + exposureValue); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 * @tc.name : Check capture session set exposure bias with callback(invalid value, max + 0.1) * @tc.desc : Check capture session set exposure bias with callback(invalid value, max + 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setExposureBias(mExposureBiasMaxArray[i] + 0.1, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 0.1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 0.1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getExposureValue(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 callback"); if (!err) { if (data != (mExposureBiasMaxArray[i] + 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 PASSED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 PASSED with ExposureValue is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 FAILED with ExposureValue is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED with ExposureValue is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_CALLBACK_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 * @tc.name : Check capture session set exposure bias with promise(invalid value, max + 0.1) * @tc.desc : Check capture session set exposure bias with promise(invalid value, max + 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setExposureBias(mExposureBiasMaxArray[i] + 0.1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 0.1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 PASSED with ExposureBias is: " + (mExposureBiasMaxArray[i] + 0.1)); await sleep(500); let exposureValue = await mCameraSession.getExposureValue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 finish"); if (exposureValue != (mExposureBiasMaxArray[i] + 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 PASSED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 PASSED with ExposureValue is: " + exposureValue); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 FAILED with ExposureValue is: " + exposureValue); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 FAILED with ExposureValue is: " + exposureValue); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_EXPOSURE_BIAS_PROMISE_0104 ends here"); done(); } }) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets index 11fdc9fd0ed6137286284b0a929dc014f4d5a85a..4da6083e657e9ee82d836ef7de9140af19a89e61 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + // @ts-ignore import cameraObj from '@ohos.multimedia.camera'; @@ -23,7 +23,7 @@ import fileio from '@ohos.fileio'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl' import bundle from '@ohos.bundle' import deviceInfo from '@ohos.deviceInfo'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; const TAG = "CameraModuleTest: "; @@ -40,10 +40,12 @@ let mFdPath; let mFdNumber; // CAMERA-0 letiables -let mCameraInputArray; -let mPreviewOutputArray; -let mPhotoOutputArray; -let mVideoOutputArray; +let mCameraNum; + +let mCameraInput; +let mPreviewOutput; +let mPhotoOutput; +let mVideoOutput; let mHasFlashArray; let mIsFlashModeSupportedArray; @@ -109,10 +111,10 @@ export default function cameraSessionFlashTest(surfaceId: any) { mFdPath = "fd://" + mFdNumber.toString(); } } - + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { + await mFileAsset[0].close(mFdNumber).then(() => { console.info('[mediaLibrary] case close fd success'); }).catch((err) => { console.info('[mediaLibrary] case close fd failed'); @@ -133,6 +135,9 @@ export default function cameraSessionFlashTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; + let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; + let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { console.info('[permission] case grantUserGrantedPermission success :' + result); }).catch((err) => { @@ -158,6 +163,21 @@ export default function cameraSessionFlashTest(surfaceId: any) { }).catch((err) => { console.info('[permission] case grantUserGrantedPermission failed :' + err); }); + await atManager.grantUserGrantedPermission(tokenID, permissionName6, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName7, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName8, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); } else { console.info('[permission] case apply permission failed, createAtManager failed'); } @@ -182,18 +202,30 @@ export default function cameraSessionFlashTest(surfaceId: any) { await getFd('CameraSessionFlush.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - }) - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) - }) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } + }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -225,7 +257,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { async function getCameraSupportDevicesArray() { console.info('Enter getCameraSupportDevicesArray'); - + mCameraDevicesArray = await mCameraManager.getSupportedCameras(); /* mCameraManager.getSupportedCameras(async (err, data) => { @@ -248,7 +280,14 @@ export default function cameraSessionFlashTest(surfaceId: any) { return false; } - console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraDevicesArray.length); + //mCameraNum = 1; + mCameraNum = mCameraDevicesArray.length; + + console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraNum); + + mHasFlashArray = new Array(mCameraNum); + mIsFlashModeSupportedArray = new Array(mCameraNum); + console.info('Exit getCameraSupportDevicesArray'); return true; @@ -259,9 +298,9 @@ export default function cameraSessionFlashTest(surfaceId: any) { mCameraSession.beginConfig(async (err) => { if (!err) { - console.info(TAG + "Entering beginConfig PASSED"); + console.info(TAG + "Entering beginConfig PASSED"); } else { - console.info(TAG + "Entering beginConfig FAILED : " + err.message); + console.info(TAG + "Entering beginConfig FAILED : " + err.message); } }) @@ -316,177 +355,169 @@ export default function cameraSessionFlashTest(surfaceId: any) { await mCameraSession.release(); } - async function createInputs() { - console.info('Enter createInputs'); + async function createInput(idx:any) { + console.info('Enter createInput'); if (isEmpty(mCameraDevicesArray)) { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { + console.info(TAG + "createCameraInput FAILED"); + return false; + } - mCameraInputArray = new Array(mCameraDevicesArray.length); - mHasFlashArray = new Array(mCameraDevicesArray.length); - mIsFlashModeSupportedArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - mCameraInputArray[i] = await mCameraManager.createCameraInput(mCameraDevicesArray[i]); - if (isEmpty(mCameraInputArray[i])) { - console.info(TAG + "createCameraInput FAILED"); - return false; + mCameraInput.open(async (err) => { + console.info(TAG + "Entering mCameraInput open callback"); + if (!err) { + console.info(TAG + "Entering mCameraInput open PASSED "); + } else { + console.info(TAG + "Entering mCameraInput open FAILED : " + err.message); } + }) - mCameraInputArray[i].open(async (err) => { - console.info(TAG + "Entering mCameraInputArray open callback"); - if (!err) { - console.info(TAG + "Entering mCameraInputArray open PASSED "); - } else { - console.info(TAG + "Entering mCameraInputArray open FAILED : " + err.message); - } - }) - - await sleep(100); + await sleep(100); - console.info(i + 'th CameraInput is: ' + mCameraInputArray[i]); - } + console.info(idx + 'th CameraInput is: ' + mCameraInput); - console.info('Exit createInputs'); + console.info('Exit createInput'); return true; } - async function releaseInputs() { - console.info('Enter releaseInputs'); - - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering releaseInputs FAILED with NoCamera"); - return true; - } + async function releaseInput() { + console.info('Enter releaseInput'); - for (let i = 0; i < mCameraInputArray.length; i++) { - await mCameraInputArray[i].close(); - await mCameraInputArray[i].release(); + if (!isEmpty(mCameraInput)) { + await mCameraInput.close(); + await mCameraInput.release(); } - console.info('Exit releaseInputs'); + console.info('Exit releaseInput'); return true; } - async function createOutputs() { - console.info('Enter createOutputs'); - - mPreviewOutputArray = new Array(mCameraDevicesArray.length); - mPhotoOutputArray = new Array(mCameraDevicesArray.length); - mVideoOutputArray = new Array(mCameraDevicesArray.length); + async function createOutput(idx:any) { + console.info('Enter createOutput'); - for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[i]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let j = 0; j < cameraOutputCap.previewProfiles.length; j++) { - mPreviewOutputArray[i] = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[j], surfaceId); - if (!isEmpty(mPreviewOutputArray[i])) { - break; - } + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; } + } - if (isEmpty(mPreviewOutputArray[i])) { - console.info(TAG + "createPreviewOutput FAILED"); - } + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); } - /* - if (!isEmpty(cameraOutputCap.photoProfiles)) { - console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); + } + + if (!isEmpty(cameraOutputCap.photoProfiles)) { + console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); - for (let j = 0; j < cameraOutputCap.photoProfiles.length; j++) { - mPhotoOutputArray[i] = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[j], mPhoteSurface); - if (!isEmpty(mPhotoOutputArray[i])) { - break; - } + for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) { + mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface); + if (!isEmpty(mPhotoOutput)) { + break; } + } - if (isEmpty(mPhotoOutputArray[i])) { + if (isEmpty(mPhotoOutput)) { console.info(TAG + "createPhotoOutput FAILED"); - } - - console.info(TAG + "createPhotoOutput: " + mPhotoOutputArray[i]); } - if (!isEmpty(cameraOutputCap.videoProfiles)) { - console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); - for (let j = 0; j < cameraOutputCap.videoProfiles.length; j++) { - mVideoOutputArray[i] = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[j], mVideoSurface); - if (!isEmpty(mVideoOutputArray[i])) { + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); + } + /* + if (!isEmpty(cameraOutputCap.videoProfiles)) { + console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); + for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) { + try { + mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface); + if (!isEmpty(mVideoOutput)) { break; } } - - if (isEmpty(mVideoOutputArray[i])) { + catch { console.info(TAG + "createVideoOutput FAILED"); } + } - console.info(TAG + "createVideoOutput: " + mPhotoOutputArray[i]); + if (isEmpty(mVideoOutput)) { + console.info(TAG + "createVideoOutput FAILED"); } - */ - } + console.info(TAG + "createVideoOutput: " + mVideoOutput); + } + */ console.info('Exit createOutputs'); return true; } - async function releaseOutputs() { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - if (!isEmpty(mPreviewOutputArray[i])) { - await mPreviewOutputArray[i].close(); - await mPreviewOutputArray[i].release(); - } + async function releaseOutput() { + console.info('Enter createOutput'); - /* - if (!isEmpty(mPhotoOutputArray[i])) { - await mPhotoOutputArray[i].close(); - await mPhotoOutputArray[i].release(); - } - - if (!isEmpty(mVideoOutputArray[i])) { - await mVideoOutputArray[i].close(); - await mVideoOutputArray[i].release(); - } - */ + if (!isEmpty(mPreviewOutput)) { + await mPreviewOutput.stop(); + await mPreviewOutput.release(); } - + + if (!isEmpty(mPhotoOutput)) { + await mPhotoOutput.release(); + } + /* + if (!isEmpty(mVideoOutput)) { + await mVideoOutput.stop(); + await mVideoOutput.release(); + } + */ + console.info('Exit createOutput'); + return true; } - async function startCameraSession(idx: any) { + async function startCameraSession(idx:any) { console.info(TAG + "Enter startCameraSession"); - if (!isEmpty(mCameraInputArray[idx])) { + await createInput(idx); + await createOutput(idx); + + await sleep(1); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[idx]); + await mCameraSession.addInput(mCameraInput); } - - if (!isEmpty(mPreviewOutputArray[idx])) { + + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[idx]); + await mCameraSession.addOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to addOutput mPhotoOutput"); - await mCameraSession.addOutput(mPhotoOutputArray[idx]); + await mCameraSession.addOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to addOutput mVideoOutput"); - await mCameraSession.addOutput(mVideoOutputArray[idx]); + await mCameraSession.addOutput(mVideoOutput); } */ + await sleep(1); await commitCameraSessionConfig(); await beginCameraSessionConfig(); - + /* await mCameraSession.start(async (err) => { console.info(TAG + "Entering mCameraSession start callback"); @@ -504,7 +535,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { return true; } - async function stopCameraSession(idx: any) { + async function stopCameraSession() { console.info(TAG + "Enter stopCameraSession"); /* mCameraSession.stop(async (err) => { @@ -519,27 +550,28 @@ export default function cameraSessionFlashTest(surfaceId: any) { await sleep(1000); */ - if (!isEmpty(mCameraInputArray[idx])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput input"); - await mCameraSession.removeInput(mCameraInputArray[idx]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[idx]); + await mCameraSession.removeOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to removeOutput mPhotoOutput"); - await mCameraSession.removeOutput(mPhotoOutputArray[idx]); + await mCameraSession.removeOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to removeOutput mVideoOutput"); - await mCameraSession.removeOutput(mVideoOutputArray[idx]); + await mCameraSession.removeOutput(mVideoOutput); } */ + await releaseInput(); + await releaseOutput(); console.info(TAG + "Exit stopCameraSession"); @@ -557,14 +589,12 @@ export default function cameraSessionFlashTest(surfaceId: any) { await mgetCameraManagerInstance(); await getCameraSupportDevicesArray(); await createCameraSessionInstance(); - await createInputs(); - await createOutputs(); console.info('Device type = ' + deviceInfo.deviceType); console.info('beforeAll case'); }) - + beforeEach(function () { sleep(1000); console.info('beforeEach case'); @@ -575,8 +605,6 @@ export default function cameraSessionFlashTest(surfaceId: any) { }) afterAll(function () { - releaseInputs(); - releaseOutputs(); releaseVideoReceiveSurface(); releaseCameraSessionInstance(); sleep(1000); @@ -594,18 +622,18 @@ export default function cameraSessionFlashTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 start for camera[" + i + "]"); - + await startCameraSession(i); mHasFlashArray[i] = false; - + mCameraSession.hasFlash(async (err, data) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 callback"); if (!err) { @@ -622,14 +650,14 @@ export default function cameraSessionFlashTest(surfaceId: any) { } }) await sleep(1000); - - await stopCameraSession(i); - + + await stopCameraSession(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 end for camera[" + i + "]"); } - + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_CALLBACK_0100 ends here"); - done(); + done(); } }) @@ -641,20 +669,20 @@ export default function cameraSessionFlashTest(surfaceId: any) { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 start for camera[" + i + "]"); - + await startCameraSession(i); - + let hasFlashPromise = await mCameraSession.hasFlash(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 finish"); if (hasFlashPromise != null || hasFlashPromise != undefined) { @@ -664,14 +692,14 @@ export default function cameraSessionFlashTest(surfaceId: any) { expect().assertFail(); } await sleep(1000); - - await stopCameraSession(i); - + + await stopCameraSession(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 end for camera[" + i + "]"); } - + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 ends here"); - done(); + done(); } }) @@ -683,21 +711,21 @@ export default function cameraSessionFlashTest(surfaceId: any) { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); - + await startCameraSession(i); - + mIsFlashModeSupportedArray[i] = false; - + if (mHasFlashArray[i] == true) { mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 callback"); @@ -718,14 +746,14 @@ export default function cameraSessionFlashTest(surfaceId: any) { } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 not support"); } - - await stopCameraSession(i); - + + await stopCameraSession(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); } - + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 ends here"); - done(); + done(); } }) @@ -737,19 +765,19 @@ export default function cameraSessionFlashTest(surfaceId: any) { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 start for camera[" + i + "]"); - + await startCameraSession(i); - + if (mHasFlashArray[i] == true) { let isFlashModeSupported = await mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 finish"); @@ -758,18 +786,18 @@ export default function cameraSessionFlashTest(surfaceId: any) { } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 FAILED with isFlashModeSupported is: " + isFlashModeSupported); expect().assertFail(); - } - + } + await sleep(1000); } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 not support"); } - - await stopCameraSession(i); - + + await stopCameraSession(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 end for camera[" + i + "]"); } - + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 ends here"); done(); } @@ -784,19 +812,19 @@ export default function cameraSessionFlashTest(surfaceId: any) { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 start for camera[" + i + "]"); - + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err) => { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 callback"); @@ -827,12 +855,12 @@ export default function cameraSessionFlashTest(surfaceId: any) { } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 not support"); } - - await stopCameraSession(i); - + + await stopCameraSession(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 end for camera[" + i + "]"); } - + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0100 ends here"); done(); } @@ -846,23 +874,23 @@ export default function cameraSessionFlashTest(surfaceId: any) { * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 start for camera[" + i + "]"); - + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { await mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); await sleep(500); let flashMode = await mCameraSession.getFlashMode(); @@ -877,650 +905,650 @@ export default function cameraSessionFlashTest(surfaceId: any) { } else { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 not support"); } - - await stopCameraSession(i); - + + await stopCameraSession(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 end for camera[" + i + "]"); } - + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0100 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 * @tc.name : Check capture session support flash open mode with callback or not * @tc.desc : Check capture session support flash open mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); + await startCameraSession(i); - + mIsFlashModeSupportedArray[i] = false; - + if (mHasFlashArray[i] == true) { mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 callback"); if (!err) { if (data != null || data != undefined) { mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 PASSED with isFlashModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 PASSED with isFlashModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 FAILED with isFlashModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 FAILED with isFlashModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0200 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 * @tc.name : Check capture session support flash open mode with promise or not * @tc.desc : Check capture session support flash open mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 start for camera[" + i + "]"); + await startCameraSession(i); - + if (mHasFlashArray[i] == true) { let isFlashModeSupported = await mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 finish"); if (isFlashModeSupported != null || isFlashModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 PASSED with isFlashModeSupported is: " + isFlashModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 PASSED with isFlashModeSupported is: " + isFlashModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 FAILED with isFlashModeSupported is: " + isFlashModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 FAILED with isFlashModeSupported is: " + isFlashModeSupported); expect().assertFail(); - } - + } + await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0200 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 * @tc.name : Check capture session set flash open mode with callback * @tc.desc : Check capture session set flash open mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 start for camera[" + i + "]"); + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 callback"); if (!err) { if (data == cameraObj.FlashMode.FLASH_MODE_OPEN) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 PASSED with FlaseMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 PASSED with FlaseMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 FAILED with FlaseMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED with FlaseMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0200 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 * @tc.name : Check capture session set flash open mode with promise * @tc.desc : Check capture session set flash open mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 start for camera[" + i + "]"); + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { await mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); await sleep(500); let flashMode = await mCameraSession.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 finish"); if (flashMode == cameraObj.FlashMode.FLASH_MODE_OPEN) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 PASSED with FlaseMode is: " + flashMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 PASSED with FlaseMode is: " + flashMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 FAILED with FlaseMode is: " + flashMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 FAILED with FlaseMode is: " + flashMode); expect().assertFail(); } await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0200 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 * @tc.name : Check capture session support flash auto mode with callback or not * @tc.desc : Check capture session support flash auto mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); + await startCameraSession(i); - + mIsFlashModeSupportedArray[i] = false; - + if (mHasFlashArray[i] == true) { mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 callback"); if (!err) { if (data != null || data != undefined) { mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 PASSED with isFlashModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 PASSED with isFlashModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 FAILED with isFlashModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 FAILED with isFlashModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0300 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 * @tc.name : Check capture session support flash auto mode with promise or not * @tc.desc : Check capture session support flash auto mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 start for camera[" + i + "]"); + await startCameraSession(i); - + if (mHasFlashArray[i] == true) { let isFlashModeSupported = await mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 finish"); if (isFlashModeSupported != null || isFlashModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 PASSED with isFlashModeSupported is: " + isFlashModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 PASSED with isFlashModeSupported is: " + isFlashModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 FAILED with isFlashModeSupported is: " + isFlashModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 FAILED with isFlashModeSupported is: " + isFlashModeSupported); expect().assertFail(); - } - + } + await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0300 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 * @tc.name : Check capture session set flash auto mode with callback * @tc.desc : Check capture session set flash auto mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 start for camera[" + i + "]"); + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 callback"); if (!err) { if (data == cameraObj.FlashMode.FLASH_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 PASSED with FlaseMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 PASSED with FlaseMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 FAILED with FlaseMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED with FlaseMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0300 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 * @tc.name : Check capture session set flash auto mode with promise * @tc.desc : Check capture session set flash auto mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 start for camera[" + i + "]"); + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { await mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); await sleep(500); let flashMode = await mCameraSession.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 finish"); if (flashMode == cameraObj.FlashMode.FLASH_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 PASSED with FlaseMode is: " + flashMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 PASSED with FlaseMode is: " + flashMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 FAILED with FlaseMode is: " + flashMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 FAILED with FlaseMode is: " + flashMode); expect().assertFail(); } await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0300 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 * @tc.name : Check capture session support flash always open mode with callback or not * @tc.desc : Check capture session support flash always open mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 start for camera[" + i + "]"); + await startCameraSession(i); - + mIsFlashModeSupportedArray[i] = false; - + if (mHasFlashArray[i] == true) { mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 callback"); if (!err) { if (data != null || data != undefined) { mIsFlashModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 PASSED with isFlashModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 PASSED with isFlashModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 FAILED with isFlashModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 FAILED with isFlashModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0400 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 * @tc.name : Check capture session support flash always open mode with promise or not * @tc.desc : Check capture session support flash always open mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 start for camera[" + i + "]"); + await startCameraSession(i); - + if (mHasFlashArray[i] == true) { let isFlashModeSupported = await mCameraSession.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 finish"); if (isFlashModeSupported != null || isFlashModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 PASSED with hasFlash is: " + isFlashModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 PASSED with hasFlash is: " + isFlashModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 FAILED with hasFlash is: " + isFlashModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 FAILED with hasFlash is: " + isFlashModeSupported); expect().assertFail(); - } - + } + await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0400 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 * @tc.name : Check capture session set flash always open mode with callback * @tc.desc : Check capture session set flash always open mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 start for camera[" + i + "]"); + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFlashMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 callback"); if (!err) { if (data == cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 PASSED with FlaseMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 PASSED with FlaseMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 FAILED with FlaseMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED with FlaseMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0400 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 * @tc.name : Check capture session set flash always open mode with promise * @tc.desc : Check capture session set flash always open mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 start for camera[" + i + "]"); - + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 start for camera[" + i + "]"); + await startCameraSession(i); - + if ((mHasFlashArray[i] == true) && (mIsFlashModeSupportedArray[i] == true)) { await mCameraSession.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 PASSED with FlashMode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); await sleep(500); let flashMode = await mCameraSession.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 finish"); if (flashMode == cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 PASSED with FlaseMode is: " + flashMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 PASSED with FlaseMode is: " + flashMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 FAILED with FlaseMode is: " + flashMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 FAILED with FlaseMode is: " + flashMode); expect().assertFail(); } - + await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 not support"); } - - await stopCameraSession(i); - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 end for camera[" + i + "]"); + + await stopCameraSession(); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 end for camera[" + i + "]"); } - - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0400 ends here"); + + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FLASH_MODE_PROMISE_0103 ends here"); done(); } }) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets index 42602d999267b0d8d92f8a732bb849226589a569..37112c121940a272a2308c9aba2a64997795b475 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets @@ -40,10 +40,12 @@ let mFdPath; let mFdNumber; // CAMERA-0 letiables -let mCameraInputArray; -let mPreviewOutputArray; -let mPhotoOutputArray; -let mVideoOutputArray; +let mCameraNum; + +let mCameraInput; +let mPreviewOutput; +let mPhotoOutput; +let mVideoOutput; let mIsFocusModeSupportedArray; @@ -136,7 +138,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { return false; } - async function getFd(pathName){ + async function getFd(pathName) { let displayName = pathName; const mediaTest = mediaLibrary.getMediaLibrary(); let fileKeyObj = mediaLibrary.FileKey; @@ -144,27 +146,27 @@ export default function cameraSessionFocusTest(surfaceId: any) { let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - let fetchFileResult = await mediaTest.getFileAssets(fetchOp); - mFileAsset = await fetchFileResult.getAllObject(); - mFdNumber = await mFileAsset[0].open('Rw'); - mFdPath = "fd://" + mFdNumber.toString(); + let args = dataUri.id.toString(); + let fetchOp = { + selections: fileKeyObj.ID + "=?", + selectionArgs: [args], + } + let fetchFileResult = await mediaTest.getFileAssets(fetchOp); + mFileAsset = await fetchFileResult.getAllObject(); + mFdNumber = await mFileAsset[0].open('Rw'); + mFdPath = "fd://" + mFdNumber.toString(); } } - + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { - console.info('[mediaLibrary] case close fd success'); - }).catch((err) => { - console.info('[mediaLibrary] case close fd failed'); - }); + await mFileAsset[0].close(mFdNumber).then(() => { + console.info('[mediaLibrary] case close fd success'); + }).catch((err) => { + console.info('[mediaLibrary] case close fd failed'); + }); } else { - console.info('[mediaLibrary] case fileAsset is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } @@ -179,6 +181,9 @@ export default function cameraSessionFocusTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; + let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; + let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { console.info('[permission] case grantUserGrantedPermission success :' + result); }).catch((err) => { @@ -204,6 +209,21 @@ export default function cameraSessionFocusTest(surfaceId: any) { }).catch((err) => { console.info('[permission] case grantUserGrantedPermission failed :' + err); }); + await atManager.grantUserGrantedPermission(tokenID, permissionName6, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName7, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName8, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); } else { console.info('[permission] case apply permission failed, createAtManager failed'); } @@ -228,18 +248,30 @@ export default function cameraSessionFocusTest(surfaceId: any) { await getFd('CameraSessionFocus.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - }) - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) - }) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } + }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -294,7 +326,13 @@ export default function cameraSessionFocusTest(surfaceId: any) { return false; } - console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraDevicesArray.length); + //mCameraNum = 1; + mCameraNum = mCameraDevicesArray.length; + + console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraNum); + + mIsFocusModeSupportedArray = new Array(mCameraNum); + console.info('Exit getCameraSupportDevicesArray'); return true; @@ -362,172 +400,165 @@ export default function cameraSessionFocusTest(surfaceId: any) { await mCameraSession.release(); } - async function createInputs() { - console.info('Enter createInputs'); + async function createInput(idx:any) { + console.info('Enter createInput'); if (isEmpty(mCameraDevicesArray)) { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { + console.info(TAG + "createCameraInput FAILED"); + return false; + } - mCameraInputArray = new Array(mCameraDevicesArray.length); - mIsFocusModeSupportedArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - mCameraInputArray[i] = await mCameraManager.createCameraInput(mCameraDevicesArray[i]); - if (isEmpty(mCameraInputArray[i])) { - console.info(TAG + "createCameraInput FAILED"); - return false; + mCameraInput.open(async (err) => { + console.info(TAG + "Entering mCameraInput open callback"); + if (!err) { + console.info(TAG + "Entering mCameraInput open PASSED "); + } else { + console.info(TAG + "Entering mCameraInput open FAILED : " + err.message); } + }) - mCameraInputArray[i].open(async (err) => { - console.info(TAG + "Entering mCameraInputArray open callback"); - if (!err) { - console.info(TAG + "Entering mCameraInputArray open PASSED "); - } else { - console.info(TAG + "Entering mCameraInputArray open FAILED : " + err.message); - } - }) - - await sleep(2000); + await sleep(100); - console.info(i + 'th CameraInput is: ' + mCameraInputArray[i]); - } + console.info(idx + 'th CameraInput is: ' + mCameraInput); - console.info('Exit createInputs'); + console.info('Exit createInput'); return true; } - async function releaseInputs() { - console.info('Enter releaseInputs'); + async function releaseInput() { + console.info('Enter releaseInput'); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering releaseInputs FAILED with NoCamera"); - return true; - } - - for (let i = 0; i < mCameraInputArray.length; i++) { - await mCameraInputArray[i].close(); - await mCameraInputArray[i].release(); + if (!isEmpty(mCameraInput)) { + await mCameraInput.close(); + await mCameraInput.release(); } - console.info('Exit releaseInputs'); + console.info('Exit releaseInput'); return true; } - async function createOutputs() { - console.info('Enter createOutputs'); + async function createOutput(idx:any) { + console.info('Enter createOutput'); - mPreviewOutputArray = new Array(mCameraDevicesArray.length); - mPhotoOutputArray = new Array(mCameraDevicesArray.length); - mVideoOutputArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[i]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let j = 0; j < cameraOutputCap.previewProfiles.length; j++) { - mPreviewOutputArray[i] = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[j], surfaceId); - if (!isEmpty(mPreviewOutputArray[i])) { - break; - } + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; } + } - if (isEmpty(mPreviewOutputArray[i])) { - console.info(TAG + "createPreviewOutput FAILED"); - } + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); } - /* - if (!isEmpty(cameraOutputCap.photoProfiles)) { - console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); + } + + if (!isEmpty(cameraOutputCap.photoProfiles)) { + console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); - for (let j = 0; j < cameraOutputCap.photoProfiles.length; j++) { - mPhotoOutputArray[i] = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[j], mPhoteSurface); - if (!isEmpty(mPhotoOutputArray[i])) { - break; - } + for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) { + mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface); + if (!isEmpty(mPhotoOutput)) { + break; } + } - if (isEmpty(mPhotoOutputArray[i])) { + if (isEmpty(mPhotoOutput)) { console.info(TAG + "createPhotoOutput FAILED"); - } - - console.info(TAG + "createPhotoOutput: " + mPhotoOutputArray[i]); } - if (!isEmpty(cameraOutputCap.videoProfiles)) { - console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); - for (let j = 0; j < cameraOutputCap.videoProfiles.length; j++) { - mVideoOutputArray[i] = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[j], mVideoSurface); - if (!isEmpty(mVideoOutputArray[i])) { + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); + } + /* + if (!isEmpty(cameraOutputCap.videoProfiles)) { + console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); + for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) { + try { + mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface); + if (!isEmpty(mVideoOutput)) { break; } } - - if (isEmpty(mVideoOutputArray[i])) { + catch { console.info(TAG + "createVideoOutput FAILED"); } + } - console.info(TAG + "createVideoOutput: " + mPhotoOutputArray[i]); + if (isEmpty(mVideoOutput)) { + console.info(TAG + "createVideoOutput FAILED"); } - */ - } + console.info(TAG + "createVideoOutput: " + mVideoOutput); + } + */ console.info('Exit createOutputs'); return true; } - async function releaseOutputs() { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - if (!isEmpty(mPreviewOutputArray[i])) { - await mPreviewOutputArray[i].close(); - await mPreviewOutputArray[i].release(); - } - - /* - if (!isEmpty(mPhotoOutputArray[i])) { - await mPhotoOutputArray[i].close(); - await mPhotoOutputArray[i].release(); - } - - if (!isEmpty(mVideoOutputArray[i])) { - await mVideoOutputArray[i].close(); - await mVideoOutputArray[i].release(); - } - */ + async function releaseOutput() { + console.info('Enter createOutput'); + + if (!isEmpty(mPreviewOutput)) { + await mPreviewOutput.stop(); + await mPreviewOutput.release(); } + if (!isEmpty(mPhotoOutput)) { + await mPhotoOutput.release(); + } + /* + if (!isEmpty(mVideoOutput)) { + await mVideoOutput.stop(); + await mVideoOutput.release(); + } + */ + console.info('Exit createOutput'); + return true; } async function startCameraSession(idx:any) { console.info(TAG + "Enter startCameraSession"); - if (!isEmpty(mCameraInputArray[idx])) { + await createInput(idx); + await createOutput(idx); + + await sleep(1); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[idx]); + await mCameraSession.addInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[idx]); + await mCameraSession.addOutput(mPreviewOutput); } - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to addOutput mPhotoOutput"); - await mCameraSession.addOutput(mPhotoOutputArray[idx]); + await mCameraSession.addOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to addOutput mVideoOutput"); - await mCameraSession.addOutput(mVideoOutputArray[idx]); + await mCameraSession.addOutput(mVideoOutput); } */ + await sleep(1); await commitCameraSessionConfig(); await beginCameraSessionConfig(); @@ -549,7 +580,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { return true; } - async function stopCameraSession(idx:any) { + async function stopCameraSession() { console.info(TAG + "Enter stopCameraSession"); /* mCameraSession.stop(async (err) => { @@ -564,27 +595,28 @@ export default function cameraSessionFocusTest(surfaceId: any) { await sleep(1000); */ - if (!isEmpty(mCameraInputArray[idx])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput input"); - await mCameraSession.removeInput(mCameraInputArray[idx]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[idx]); + await mCameraSession.removeOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to removeOutput mPhotoOutput"); - await mCameraSession.removeOutput(mPhotoOutputArray[idx]); + await mCameraSession.removeOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to removeOutput mVideoOutput"); - await mCameraSession.removeOutput(mVideoOutputArray[idx]); + await mCameraSession.removeOutput(mVideoOutput); } */ + await releaseInput(); + await releaseOutput(); console.info(TAG + "Exit stopCameraSession"); @@ -602,8 +634,6 @@ export default function cameraSessionFocusTest(surfaceId: any) { await getCameraManagerInstance(); await getCameraSupportDevicesArray(); await createCameraSessionInstance(); - await createInputs(); - await createOutputs(); console.info('Device type = ' + deviceInfo.deviceType); @@ -620,8 +650,6 @@ export default function cameraSessionFocusTest(surfaceId: any) { }) afterAll(function () { - releaseInputs(); - releaseOutputs(); releaseVideoReceiveSurface(); releaseCameraSessionInstance(); sleep(1000); @@ -639,12 +667,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -668,7 +696,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); } @@ -689,12 +717,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -710,7 +738,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0100 end for camera[" + i + "]"); } @@ -731,12 +759,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -772,7 +800,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 not support"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0100 end for camera[" + i + "]"); } @@ -793,12 +821,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -822,7 +850,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100 not support"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0100 end for camera[" + i + "]"); } @@ -833,613 +861,613 @@ export default function cameraSessionFocusTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 * @tc.name : Check capture session support focus continuous auto mode with callback or not * @tc.desc : Check capture session support focus continuous auto mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mIsFocusModeSupportedArray[i] = false; mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 callback"); if (!err) { if (data != null || data != undefined) { mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 PASSED with isFocusModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 PASSED with isFocusModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 FAILED with isFocusModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 FAILED with isFocusModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 * @tc.name : Check capture session support focus continuous auto mode with promise or not * @tc.desc : Check capture session support focus continuous auto mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); let isFocusModeSupported = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 finish"); if (isFocusModeSupported != null || isFocusModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 PASSED with isFocusModeSupported is: " + isFocusModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 PASSED with isFocusModeSupported is: " + isFocusModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 FAILED with isFocusModeSupported is: " + isFocusModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 FAILED with isFocusModeSupported is: " + isFocusModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 * @tc.name : Check capture session set focus continuous auto mode with callback * @tc.desc : Check capture session set focus continuous auto mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 callback"); if (!err) { if (data == cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 PASSED with FocusMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 PASSED with FocusMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 FAILED with FocusMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED with FocusMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 * @tc.name : Check capture session set focus continuous auto mode with promise * @tc.desc : Check capture session set focus continuous auto mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); await sleep(500); let focusMode = await mCameraSession.getFocusMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 finish"); if (focusMode == cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 PASSED with FocusMode is: " + focusMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 PASSED with FocusMode is: " + focusMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 FAILED with FocusMode is: " + focusMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 FAILED with FocusMode is: " + focusMode); expect().assertFail(); } await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 * @tc.name : Check capture session support focus auto mode with callback or not * @tc.desc : Check capture session support focus auto mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mIsFocusModeSupportedArray[i] = false; mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 callback"); if (!err) { if (data != null || data != undefined) { mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 PASSED with isFocusModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 PASSED with isFocusModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 FAILED with isFocusModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 FAILED with isFocusModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 * @tc.name : Check capture session support focus auto mode with promise or not * @tc.desc : Check capture session support focus auto mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); let isFocusModeSupported = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 finish"); if (isFocusModeSupported != null || isFocusModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 PASSED with isFocusModeSupported is: " + isFocusModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 PASSED with isFocusModeSupported is: " + isFocusModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 FAILED with isFocusModeSupported is: " + isFocusModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 FAILED with isFocusModeSupported is: " + isFocusModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 * @tc.name : Check capture session set focus auto mode with callback * @tc.desc : Check capture session set focus auto mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 callback"); if (!err) { if (data == cameraObj.FocusMode.FOCUS_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 PASSED with FocusMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 PASSED with FocusMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 FAILED with FocusMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED with FocusMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 * @tc.name : Check capture session set focus auto mode with promise * @tc.desc : Check capture session set focus auto mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); await sleep(500); let focusMode = await mCameraSession.getFocusMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 finish"); if (focusMode == cameraObj.FocusMode.FOCUS_MODE_AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 PASSED with FocusMode is: " + focusMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 PASSED with FocusMode is: " + focusMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 FAILED with FocusMode is: " + focusMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 FAILED with FocusMode is: " + focusMode); expect().assertFail(); } await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 * @tc.name : Check capture session support focus locked mode with callback or not * @tc.desc : Check capture session support focus locked mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); mIsFocusModeSupportedArray[i] = false; mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 callback"); if (!err) { if (data != null || data != undefined) { mIsFocusModeSupportedArray[i] = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 PASSED with isFocusModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 PASSED with isFocusModeSupported is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 FAILED with isFocusModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 FAILED with isFocusModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 * @tc.name : Check capture session support focus locked mode with promise or not * @tc.desc : Check capture session support focus locked mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); let isFocusModeSupported = await mCameraSession.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 finish"); if (isFocusModeSupported != null || isFocusModeSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 PASSED with isFocusModeSupported is: " + isFocusModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 PASSED with isFocusModeSupported is: " + isFocusModeSupported); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 FAILED with isFocusModeSupported is: " + isFocusModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 FAILED with isFocusModeSupported is: " + isFocusModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FOCUS_MODE_SUPPORT_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 * @tc.name : Check capture session set focus locked mode with callback * @tc.desc : Check capture session set focus locked mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 callback"); if (!err) { if (data == cameraObj.FocusMode.FOCUS_MODE_LOCKED) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 PASSED with FocusMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 PASSED with FocusMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 FAILED with FocusMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED with FocusMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 * @tc.name : Check capture session set focus locked mode with promise * @tc.desc : Check capture session set focus locked mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); if (mIsFocusModeSupportedArray[i] == true) { await mCameraSession.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 PASSED with FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); await sleep(500); let focusMode = await mCameraSession.getFocusMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 finish"); if (focusMode == cameraObj.FocusMode.FOCUS_MODE_LOCKED) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 PASSED with FocusMode is: " + focusMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 PASSED with FocusMode is: " + focusMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 FAILED with FocusMode is: " + focusMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with FocusMode is: " + focusMode); expect().assertFail(); } await sleep(1000); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 not support"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 not support"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 ends here"); done(); } }) @@ -1455,12 +1483,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -1492,7 +1520,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0100 end for camera[" + i + "]"); } @@ -1513,12 +1541,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -1538,7 +1566,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0100 end for camera[" + i + "]"); } @@ -1549,833 +1577,833 @@ export default function cameraSessionFocusTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 * @tc.name : Check capture session set focus point with callback(left-top point) * @tc.desc : Check capture session set focus point with callback(left-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 PASSED with FocusPoint is: " + mFocusPointLT.x + ", " + mFocusPointLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 PASSED with FocusPoint is: " + mFocusPointLT.x + ", " + mFocusPointLT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 callback"); if (!err) { if ((data.x == mFocusPointLT.x) && (data.y == mFocusPointLT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 * @tc.name : Check capture session set focus point with promise(left-top point) * @tc.desc : Check capture session set focus point with promise(left-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointLT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 PASSED with FocusPoint is: " + mFocusPointLT.x + ", " + mFocusPointLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 PASSED with FocusPoint is: " + mFocusPointLT.x + ", " + mFocusPointLT.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 finish"); if ((focusPoint.x == mFocusPointLT.x) && (focusPoint.y == mFocusPointLT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 * @tc.name : Check capture session set focus point with callback(right-top point) * @tc.desc : Check capture session set focus point with callback(right-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 PASSED with FocusPoint is: " + mFocusPointRT.x + ", " + mFocusPointRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 PASSED with FocusPoint is: " + mFocusPointRT.x + ", " + mFocusPointRT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 callback"); if (!err) { if ((data.x == mFocusPointRT.x) && (data.y == mFocusPointRT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 * @tc.name : Check capture session set focus point with promise(right-top point) * @tc.desc : Check capture session set focus point with promise(right-top point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointRT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 PASSED with FocusPoint is: " + mFocusPointRT.x + ", " + mFocusPointRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 PASSED with FocusPoint is: " + mFocusPointRT.x + ", " + mFocusPointRT.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 finish"); if ((focusPoint.x == mFocusPointRT.x) && (focusPoint.y == mFocusPointRT.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 * @tc.name : Check capture session set focus point with callback(left-bottom point) * @tc.desc : Check capture session set focus point with callback(left-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 PASSED with FocusPoint is: " + mFocusPointLB.x + ", " + mFocusPointLB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 PASSED with FocusPoint is: " + mFocusPointLB.x + ", " + mFocusPointLB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 callback"); if (!err) { if ((data.x == mFocusPointLB.x) && (data.y == mFocusPointLB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 * @tc.name : Check capture session set focus point with promise(left-bottom point) * @tc.desc : Check capture session set focus point with promise(left-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointLB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 PASSED with FocusPoint is: " + mFocusPointLB.x + ", " + mFocusPointLB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 PASSED with FocusPoint is: " + mFocusPointLB.x + ", " + mFocusPointLB.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 finish"); if ((focusPoint.x == mFocusPointLB.x) && (focusPoint.y == mFocusPointLB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 * @tc.name : Check capture session set focus point with callback(right-bottom point) * @tc.desc : Check capture session set focus point with callback(right-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 PASSED with FocusPoint is: " + mFocusPointRB.x + ", " + mFocusPointRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 PASSED with FocusPoint is: " + mFocusPointRB.x + ", " + mFocusPointRB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 callback"); if (!err) { if ((data.x == mFocusPointRB.x) && (data.y == mFocusPointRB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 * @tc.name : Check capture session set focus point with promise(right-bottom point) * @tc.desc : Check capture session set focus point with promise(right-bottom point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointRB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 PASSED with FocusPoint is: " + mFocusPointRB.x + ", " + mFocusPointRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 PASSED with FocusPoint is: " + mFocusPointRB.x + ", " + mFocusPointRB.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 finish"); if ((focusPoint.x == mFocusPointRB.x) && (focusPoint.y == mFocusPointRB.y)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 * @tc.name : Check capture session set focus point with callback(left-top invalid point) * @tc.desc : Check capture session set focus point with callback(left-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointInvalidLT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 PASSED with FocusPoint is: " + mFocusPointInvalidLT.x + ", " + mFocusPointInvalidLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 PASSED with FocusPoint is: " + mFocusPointInvalidLT.x + ", " + mFocusPointInvalidLT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 callback"); if (!err) { if (((data.x != mFocusPointInvalidLT.x) && (data.y != mFocusPointInvalidLT.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0600 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0105 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 * @tc.name : Check capture session set focus point with promise(left-top invalid point) * @tc.desc : Check capture session set focus point with promise(left-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointInvalidLT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 PASSED with FocusPoint is: " + mFocusPointInvalidLT.x + ", " + mFocusPointInvalidLT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 PASSED with FocusPoint is: " + mFocusPointInvalidLT.x + ", " + mFocusPointInvalidLT.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 finish"); if (((focusPoint.x != mFocusPointInvalidLT.x) && (focusPoint.y != mFocusPointInvalidLT.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0600 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0105 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 * @tc.name : Check capture session set focus point with callback(right-top invalid point) * @tc.desc : Check capture session set focus point with callback(right-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointInvalidRT, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 PASSED with FocusPoint is: " + mFocusPointInvalidRT.x + ", " + mFocusPointInvalidRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 PASSED with FocusPoint is: " + mFocusPointInvalidRT.x + ", " + mFocusPointInvalidRT.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 callback"); if (!err) { if (((data.x != mFocusPointInvalidRT.x) && (data.y != mFocusPointInvalidRT.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0700 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0106 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 * @tc.name : Check capture session set focus point with promise(right-top invalid point) * @tc.desc : Check capture session set focus point with promise(right-top invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointInvalidRT); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 PASSED with FocusPoint is: " + mFocusPointInvalidRT.x + ", " + mFocusPointInvalidRT.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 PASSED with FocusPoint is: " + mFocusPointInvalidRT.x + ", " + mFocusPointInvalidRT.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 finish"); if (((focusPoint.x != mFocusPointInvalidRT.x) && (focusPoint.y != mFocusPointInvalidRT.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0700 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0106 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 * @tc.name : Check capture session set focus point with callback(left-bottom invalid point) * @tc.desc : Check capture session set focus point with callback(left-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointInvalidLB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 PASSED with FocusPoint is: " + mFocusPointInvalidLB.x + ", " + mFocusPointInvalidLB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 PASSED with FocusPoint is: " + mFocusPointInvalidLB.x + ", " + mFocusPointInvalidLB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 callback"); if (!err) { if (((data.x != mFocusPointInvalidLB.x) && (data.y != mFocusPointInvalidLB.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0800 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0107 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 * @tc.name : Check capture session set focus point with promise(left-bottom invalid point) * @tc.desc : Check capture session set focus point with promise(left-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointInvalidLB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 PASSED with FocusPoint is: " + mFocusPointInvalidLB.x + ", " + mFocusPointInvalidLB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 PASSED with FocusPoint is: " + mFocusPointInvalidLB.x + ", " + mFocusPointInvalidLB.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 finish"); if (((focusPoint.x != mFocusPointInvalidLB.x) && (focusPoint.y != mFocusPointInvalidLB.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0800 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0107 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 * @tc.name : Check capture session set focus point with callback(right-bottom invalid point) * @tc.desc : Check capture session set focus point with callback(right-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 start for camera[" + i + "]"); await startCameraSession(i); mCameraSession.setFocusPoint(mFocusPointInvalidRB, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 PASSED with FocusPoint is: " + mFocusPointInvalidRB.x + ", " + mFocusPointInvalidRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 PASSED with FocusPoint is: " + mFocusPointInvalidRB.x + ", " + mFocusPointInvalidRB.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getFocusPoint(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 callback"); if (!err) { if (((data.x != mFocusPointInvalidRB.x) && (data.y != mFocusPointInvalidRB.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 PASSED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 PASSED with FocusPoint is: " + data.x + ", " + data.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 FAILED with FocusPoint is: " + data.x + ", " + data.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED with FocusPoint is: " + data.x + ", " + data.y); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0900 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_CALLBACK_0108 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 * @tc.name : Check capture session set focus point with promise(right-bottom invalid point) * @tc.desc : Check capture session set focus point with promise(right-bottom invalid point) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 start for camera[" + i + "]"); await startCameraSession(i); await mCameraSession.setFocusPoint(mFocusPointInvalidRB); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 PASSED with FocusPoint is: " + mFocusPointInvalidRB.x + ", " + mFocusPointInvalidRB.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 PASSED with FocusPoint is: " + mFocusPointInvalidRB.x + ", " + mFocusPointInvalidRB.y); await sleep(500); let focusPoint = await mCameraSession.getFocusPoint(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 finish"); if (((focusPoint.x != mFocusPointInvalidRB.x) && (focusPoint.y != mFocusPointInvalidRB.y)) || (mEnableCheckInvalidFocusPoint == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 PASSED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 FAILED with FocusPoint is: " + focusPoint.x + ", " + focusPoint.y); expect().assertFail(); } await sleep(500); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0900 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_POINT_PROMISE_0108 ends here"); done(); } }) @@ -2391,12 +2419,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -2412,7 +2440,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_CALLBACK_0100 end for camera[" + i + "]"); } @@ -2433,12 +2461,12 @@ export default function cameraSessionFocusTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -2449,7 +2477,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 end for camera[" + i + "]"); } diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets index a0a5cba8b846a42007854a77d2eaed5d3a8774a2..aac3571a696bf3efa394864a4063ea49c6c180c8 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets @@ -40,10 +40,12 @@ let mFdPath; let mFdNumber; // CAMERA-0 letiables -let mCameraInputArray; -let mPreviewOutputArray; -let mPhotoOutputArray; -let mVideoOutputArray; +let mCameraNum; + +let mCameraInput; +let mPreviewOutput; +let mPhotoOutput; +let mVideoOutput; let mIsVideoStabilizationModeSupportedArray; @@ -89,7 +91,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { return false; } - async function getFd(pathName){ + async function getFd(pathName) { let displayName = pathName; const mediaTest = mediaLibrary.getMediaLibrary(); let fileKeyObj = mediaLibrary.FileKey; @@ -97,27 +99,27 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - let fetchFileResult = await mediaTest.getFileAssets(fetchOp); - mFileAsset = await fetchFileResult.getAllObject(); - mFdNumber = await mFileAsset[0].open('Rw'); - mFdPath = "fd://" + mFdNumber.toString(); + let args = dataUri.id.toString(); + let fetchOp = { + selections: fileKeyObj.ID + "=?", + selectionArgs: [args], + } + let fetchFileResult = await mediaTest.getFileAssets(fetchOp); + mFileAsset = await fetchFileResult.getAllObject(); + mFdNumber = await mFileAsset[0].open('Rw'); + mFdPath = "fd://" + mFdNumber.toString(); } } - + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { - console.info('[mediaLibrary] case close fd success'); - }).catch((err) => { - console.info('[mediaLibrary] case close fd failed'); - }); + await mFileAsset[0].close(mFdNumber).then(() => { + console.info('[mediaLibrary] case close fd success'); + }).catch((err) => { + console.info('[mediaLibrary] case close fd failed'); + }); } else { - console.info('[mediaLibrary] case fileAsset is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } @@ -132,6 +134,9 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; + let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; + let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { console.info('[permission] case grantUserGrantedPermission success :' + result); }).catch((err) => { @@ -157,6 +162,21 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }).catch((err) => { console.info('[permission] case grantUserGrantedPermission failed :' + err); }); + await atManager.grantUserGrantedPermission(tokenID, permissionName6, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName7, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName8, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); } else { console.info('[permission] case apply permission failed, createAtManager failed'); } @@ -181,18 +201,30 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { await getFd('CameraSessionVideoStabilization.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - }) - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) - }) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } + }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -247,7 +279,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { return false; } - console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraDevicesArray.length); + //mCameraNum = 1; + mCameraNum = mCameraDevicesArray.length; + + console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraNum); + + mIsVideoStabilizationModeSupportedArray = new Array(mCameraNum); + console.info('Exit getCameraSupportDevicesArray'); return true; @@ -315,144 +353,132 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { await mCameraSession.release(); } - async function createInputs() { - console.info('Enter createInputs'); + async function createInput(idx:any) { + console.info('Enter createInput'); if (isEmpty(mCameraDevicesArray)) { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { + console.info(TAG + "createCameraInput FAILED"); + return false; + } - mCameraInputArray = new Array(mCameraDevicesArray.length); - mIsVideoStabilizationModeSupportedArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - mCameraInputArray[i] = await mCameraManager.createCameraInput(mCameraDevicesArray[i]); - if (isEmpty(mCameraInputArray[i])) { - console.info(TAG + "createCameraInput FAILED"); - return false; + mCameraInput.open(async (err) => { + console.info(TAG + "Entering mCameraInput open callback"); + if (!err) { + console.info(TAG + "Entering mCameraInput open PASSED "); + } else { + console.info(TAG + "Entering mCameraInput open FAILED : " + err.message); } + }) - mCameraInputArray[i].open(async (err) => { - console.info(TAG + "Entering mCameraInputArray open callback"); - if (!err) { - console.info(TAG + "Entering mCameraInputArray open PASSED "); - } else { - console.info(TAG + "Entering mCameraInputArray open FAILED : " + err.message); - } - }) - - await sleep(2000); + await sleep(100); - console.info(i + 'th CameraInput is: ' + mCameraInputArray[i]); - } + console.info(idx + 'th CameraInput is: ' + mCameraInput); - console.info('Exit createInputs'); + console.info('Exit createInput'); return true; } - async function releaseInputs() { - console.info('Enter releaseInputs'); - - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering releaseInputs FAILED with NoCamera"); - return true; - } + async function releaseInput() { + console.info('Enter releaseInput'); - for (let i = 0; i < mCameraInputArray.length; i++) { - await mCameraInputArray[i].close(); - await mCameraInputArray[i].release(); + if (!isEmpty(mCameraInput)) { + await mCameraInput.close(); + await mCameraInput.release(); } - console.info('Exit releaseInputs'); + console.info('Exit releaseInput'); return true; } - async function createOutputs() { - console.info('Enter createOutputs'); + async function createOutput(idx:any) { + console.info('Enter createOutput'); - mPreviewOutputArray = new Array(mCameraDevicesArray.length); - mPhotoOutputArray = new Array(mCameraDevicesArray.length); - mVideoOutputArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[i]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let j = 0; j < cameraOutputCap.previewProfiles.length; j++) { - mPreviewOutputArray[i] = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[j], surfaceId); - if (!isEmpty(mPreviewOutputArray[i])) { - break; - } + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; } + } - if (isEmpty(mPreviewOutputArray[i])) { - console.info(TAG + "createPreviewOutput FAILED"); - } + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); } - /* - if (!isEmpty(cameraOutputCap.photoProfiles)) { - console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); + } + + if (!isEmpty(cameraOutputCap.photoProfiles)) { + console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); - for (let j = 0; j < cameraOutputCap.photoProfiles.length; j++) { - mPhotoOutputArray[i] = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[j], mPhoteSurface); - if (!isEmpty(mPhotoOutputArray[i])) { - break; - } + for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) { + mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface); + if (!isEmpty(mPhotoOutput)) { + break; } + } - if (isEmpty(mPhotoOutputArray[i])) { + if (isEmpty(mPhotoOutput)) { console.info(TAG + "createPhotoOutput FAILED"); - } - - console.info(TAG + "createPhotoOutput: " + mPhotoOutputArray[i]); } - if (!isEmpty(cameraOutputCap.videoProfiles)) { - console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); - for (let j = 0; j < cameraOutputCap.videoProfiles.length; j++) { - mVideoOutputArray[i] = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[j], mVideoSurface); - if (!isEmpty(mVideoOutputArray[i])) { + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); + } + /* + if (!isEmpty(cameraOutputCap.videoProfiles)) { + console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); + for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) { + try { + mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface); + if (!isEmpty(mVideoOutput)) { break; } } - - if (isEmpty(mVideoOutputArray[i])) { + catch { console.info(TAG + "createVideoOutput FAILED"); } + } - console.info(TAG + "createVideoOutput: " + mPhotoOutputArray[i]); + if (isEmpty(mVideoOutput)) { + console.info(TAG + "createVideoOutput FAILED"); } - */ - } + console.info(TAG + "createVideoOutput: " + mVideoOutput); + } + */ console.info('Exit createOutputs'); return true; } - async function releaseOutputs() { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - if (!isEmpty(mPreviewOutputArray[i])) { - await mPreviewOutputArray[i].close(); - await mPreviewOutputArray[i].release(); - } - - /* - if (!isEmpty(mPhotoOutputArray[i])) { - await mPhotoOutputArray[i].close(); - await mPhotoOutputArray[i].release(); - } - - if (!isEmpty(mVideoOutputArray[i])) { - await mVideoOutputArray[i].close(); - await mVideoOutputArray[i].release(); - } - */ + async function releaseOutput() { + console.info('Enter createOutput'); + + if (!isEmpty(mPreviewOutput)) { + await mPreviewOutput.stop(); + await mPreviewOutput.release(); + } + + if (!isEmpty(mPhotoOutput)) { + await mPhotoOutput.release(); } + /* + if (!isEmpty(mVideoOutput)) { + await mVideoOutput.stop(); + await mVideoOutput.release(); + } + */ + console.info('Exit createOutput'); return true; } @@ -460,27 +486,32 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { async function startCameraSession(idx:any) { console.info(TAG + "Enter startCameraSession"); - if (!isEmpty(mCameraInputArray[idx])) { + await createInput(idx); + await createOutput(idx); + + await sleep(1); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[idx]); + await mCameraSession.addInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[idx]); + await mCameraSession.addOutput(mPreviewOutput); } - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to addOutput mPhotoOutput"); - await mCameraSession.addOutput(mPhotoOutputArray[idx]); + await mCameraSession.addOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to addOutput mVideoOutput"); - await mCameraSession.addOutput(mVideoOutputArray[idx]); + await mCameraSession.addOutput(mVideoOutput); } */ + await sleep(1); await commitCameraSessionConfig(); await beginCameraSessionConfig(); @@ -502,7 +533,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { return true; } - async function stopCameraSession(idx:any) { + async function stopCameraSession() { console.info(TAG + "Enter stopCameraSession"); /* mCameraSession.stop(async (err) => { @@ -517,27 +548,28 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { await sleep(1000); */ - if (!isEmpty(mCameraInputArray[idx])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput input"); - await mCameraSession.removeInput(mCameraInputArray[idx]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[idx]); + await mCameraSession.removeOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to removeOutput mPhotoOutput"); - await mCameraSession.removeOutput(mPhotoOutputArray[idx]); + await mCameraSession.removeOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to removeOutput mVideoOutput"); - await mCameraSession.removeOutput(mVideoOutputArray[idx]); + await mCameraSession.removeOutput(mVideoOutput); } */ + await releaseInput(); + await releaseOutput(); console.info(TAG + "Exit stopCameraSession"); @@ -555,8 +587,6 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { await getCameraManagerInstance(); await getCameraSupportDevicesArray(); await createCameraSessionInstance(); - await createInputs(); - await createOutputs(); console.info('Device type = ' + deviceInfo.deviceType); @@ -573,8 +603,6 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }) afterAll(function () { - releaseInputs(); - releaseOutputs(); releaseVideoReceiveSurface(); releaseCameraSessionInstance(); sleep(1000); @@ -592,12 +620,12 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUmCameraNumPPORT_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -626,7 +654,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 end for camera[" + i + "]"); } @@ -647,12 +675,12 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -673,7 +701,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 end for camera[" + i + "]"); } @@ -694,12 +722,12 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -732,15 +760,10 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }) await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0100 end for camera[" + i + "]"); } @@ -761,12 +784,12 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -787,15 +810,10 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { } await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0100 end for camera[" + i + "]"); } @@ -806,103 +824,103 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 * @tc.name : Check capture session support video stabilization low mode with callback or not * @tc.desc : Check capture session support video stabilization low mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); mIsVideoStabilizationModeSupportedArray[i] = false; mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 callback"); if (!err) { if (data != null || data != undefined) { mIsVideoStabilizationModeSupportedArray[i] = data; if ((deviceInfo.deviceType != 'default') && (data == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 FAILED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 PASSED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 PASSED with isVideoStabilizationModeSupported is: " + data); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 FAILED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 * @tc.name : Check capture session support video stabilization low mode with promise or not * @tc.desc : Check capture session support video stabilization low mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 finish"); if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { if ((deviceInfo.deviceType != 'default') && (isVideoStabilizationModeSupported == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 ends here"); done(); } }) @@ -918,12 +936,12 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 start for camera[" + i + "]"); await startCameraSession(i); @@ -956,15 +974,10 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }) await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0101 end for camera[" + i + "]"); } @@ -975,728 +988,693 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 * @tc.name : Check capture session set video stabilization low mode with promise * @tc.desc : Check capture session set video stabilization low mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { await mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.LOW); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.LOW); await sleep(500); let vdeoStabilizationMode = await mCameraSession.getActiveVideoStabilizationMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 finish"); if (vdeoStabilizationMode == cameraObj.VideoStabilizationMode.LOW) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); expect().assertFail(); } await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 * @tc.name : Check capture session support video stabilization middle mode with callback or not * @tc.desc : Check capture session support video stabilization middle mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); mIsVideoStabilizationModeSupportedArray[i] = false; mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 callback"); if (!err) { if (data != null || data != undefined) { mIsVideoStabilizationModeSupportedArray[i] = data; - if ((deviceInfo.deviceType != 'default') && (data == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 FAILED with isVideoStabilizationModeSupported is: " + data); + if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (data == false)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 PASSED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 PASSED with isVideoStabilizationModeSupported is: " + data); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 FAILED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 * @tc.name : Check capture session support video stabilization middle mode with promise or not * @tc.desc : Check capture session support video stabilization middle mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 finish"); if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { - if ((deviceInfo.deviceType != 'default') && (isVideoStabilizationModeSupported == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (isVideoStabilizationModeSupported == false)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 * @tc.name : Check capture session set video stabilization middle mode with callback * @tc.desc : Check capture session set video stabilization middle mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.MIDDLE); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.MIDDLE); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 callback"); if (!err) { if (data == cameraObj.VideoStabilizationMode.MIDDLE) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 PASSED with VideoStabilizationMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 PASSED with VideoStabilizationMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 FAILED with VideoStabilizationMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED with VideoStabilizationMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 * @tc.name : Check capture session set video stabilization middle mode with promise * @tc.desc : Check capture session set video stabilization middle mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { await mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.MIDDLE); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.MIDDLE); await sleep(500); let vdeoStabilizationMode = await mCameraSession.getActiveVideoStabilizationMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 finish"); if (vdeoStabilizationMode == cameraObj.VideoStabilizationMode.MIDDLE) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); expect().assertFail(); } await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 * @tc.name : Check capture session support video stabilization high mode with callback or not * @tc.desc : Check capture session support video stabilization high mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); mIsVideoStabilizationModeSupportedArray[i] = false; mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 callback"); if (!err) { if (data != null || data != undefined) { mIsVideoStabilizationModeSupportedArray[i] = data; - if ((deviceInfo.deviceType != 'default') && (data == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 FAILED with isVideoStabilizationModeSupported is: " + data); + if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (data == false)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 PASSED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 PASSED with isVideoStabilizationModeSupported is: " + data); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 FAILED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 * @tc.name : Check capture session support video stabilization high mode with promise or not * @tc.desc : Check capture session support video stabilization high mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 finish"); if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { - if ((deviceInfo.deviceType != 'default') && (isVideoStabilizationModeSupported == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (isVideoStabilizationModeSupported == false)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 * @tc.name : Check capture session set video stabilization high mode with callback * @tc.desc : Check capture session set video stabilization high mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.HIGH); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.HIGH); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 callback"); if (!err) { if (data == cameraObj.VideoStabilizationMode.HIGH) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 PASSED with VideoStabilizationMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 PASSED with VideoStabilizationMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 FAILED with VideoStabilizationMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED with VideoStabilizationMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 * @tc.name : Check capture session set video stabilization high mode with promise * @tc.desc : Check capture session set video stabilization high mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { await mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.HIGH); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.HIGH); await sleep(500); let vdeoStabilizationMode = await mCameraSession.getActiveVideoStabilizationMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 finish"); if (vdeoStabilizationMode == cameraObj.VideoStabilizationMode.HIGH) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); expect().assertFail(); } await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 * @tc.name : Check capture session support video stabilization auto mode with callback or not * @tc.desc : Check capture session support video stabilization auto mode with callback or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 start for camera[" + i + "]"); await startCameraSession(i); mIsVideoStabilizationModeSupportedArray[i] = false; mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 callback"); if (!err) { if (data != null || data != undefined) { mIsVideoStabilizationModeSupportedArray[i] = data; - if ((deviceInfo.deviceType != 'default') && (data == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 FAILED with isVideoStabilizationModeSupported is: " + data); + if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (data == false)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 PASSED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 PASSED with isVideoStabilizationModeSupported is: " + data); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 FAILED with isVideoStabilizationModeSupported is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with isVideoStabilizationModeSupported is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 * @tc.name : Check capture session support video stabilization auto mode with promise or not * @tc.desc : Check capture session support video stabilization auto mode with promise or not * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 start for camera[" + i + "]"); await startCameraSession(i); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 finish"); if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { - if ((deviceInfo.deviceType != 'default') && (isVideoStabilizationModeSupported == false)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (isVideoStabilizationModeSupported == false)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); expect().assertFail(); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 * @tc.name : Check capture session set video stabilization auto mode with callback * @tc.desc : Check capture session set video stabilization auto mode with callback * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO, async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 callback"); if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.AUTO); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); mCameraSession.getActiveVideoStabilizationMode(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 callback"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 callback"); if (!err) { if (data == cameraObj.VideoStabilizationMode.AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 PASSED with VideoStabilizationMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 PASSED with VideoStabilizationMode is: " + data); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 FAILED with VideoStabilizationMode is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED with VideoStabilizationMode is: " + data); expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 FAILED : " + err.message); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } }) await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_CALLBACK_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 * @tc.name : Check capture session set video stabilization auto mode with promise * @tc.desc : Check capture session set video stabilization auto mode with promise * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 start for camera[" + i + "]"); await startCameraSession(i); if (mIsVideoStabilizationModeSupportedArray[i] == true) { await mCameraSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.AUTO); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 PASSED with VideoStabilizationMode is: " + cameraObj.VideoStabilizationMode.AUTO); await sleep(500); let vdeoStabilizationMode = await mCameraSession.getActiveVideoStabilizationMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 finish"); if (vdeoStabilizationMode == cameraObj.VideoStabilizationMode.AUTO) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 PASSED with VideoStabilizationMode is: " + vdeoStabilizationMode); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 FAILED with VideoStabilizationMode is: " + vdeoStabilizationMode); expect().assertFail(); } await sleep(500); } else { - if (deviceInfo.deviceType != 'default') { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 FAILED"); - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 PASSED"); - } + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 PASSED"); } - await stopCameraSession(i); + await stopCameraSession(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_VIDEO_STABILIZATION_MODE_PROMISE_0104 ends here"); done(); } }) diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets index a10bf2244e019ed360178715e9ae723e57e9d0b4..c943a9b30eed325ff0c9cb48915f5f16f837f1b7 100755 --- a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets @@ -40,10 +40,12 @@ let mFdPath; let mFdNumber; // CAMERA-0 letiables -let mCameraInputArray; -let mPreviewOutputArray; -let mPhotoOutputArray; -let mVideoOutputArray; +let mCameraNum; + +let mCameraInput; +let mPreviewOutput; +let mPhotoOutput; +let mVideoOutput; let mZoomRatioRangeArray; let mZoomRatioMaxArray; @@ -91,7 +93,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { return false; } - async function getFd(pathName){ + async function getFd(pathName) { let displayName = pathName; const mediaTest = mediaLibrary.getMediaLibrary(); let fileKeyObj = mediaLibrary.FileKey; @@ -99,27 +101,27 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { let publicPath = await mediaTest.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); let dataUri = await mediaTest.createAsset(mediaType, displayName, publicPath); if (dataUri != undefined) { - let args = dataUri.id.toString(); - let fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - let fetchFileResult = await mediaTest.getFileAssets(fetchOp); - mFileAsset = await fetchFileResult.getAllObject(); - mFdNumber = await mFileAsset[0].open('Rw'); - mFdPath = "fd://" + mFdNumber.toString(); + let args = dataUri.id.toString(); + let fetchOp = { + selections: fileKeyObj.ID + "=?", + selectionArgs: [args], + } + let fetchFileResult = await mediaTest.getFileAssets(fetchOp); + mFileAsset = await fetchFileResult.getAllObject(); + mFdNumber = await mFileAsset[0].open('Rw'); + mFdPath = "fd://" + mFdNumber.toString(); } } - + async function closeFd() { if (mFileAsset != null) { - await mFileAsset[0].close(mFdNumber).then(() => { - console.info('[mediaLibrary] case close fd success'); - }).catch((err) => { - console.info('[mediaLibrary] case close fd failed'); - }); + await mFileAsset[0].close(mFdNumber).then(() => { + console.info('[mediaLibrary] case close fd success'); + }).catch((err) => { + console.info('[mediaLibrary] case close fd failed'); + }); } else { - console.info('[mediaLibrary] case fileAsset is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } @@ -134,6 +136,9 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; let permissionName4 = 'ohos.permission.READ_MEDIA'; let permissionName5 = 'ohos.permission.WRITE_MEDIA'; + let permissionName6 = 'ohos.permission.START_ABILIIES_FROM_BACKGROUND'; + let permissionName7 = 'ohos.permission.START_INVISIBLE_ABILITY'; + let permissionName8 = 'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'; await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { console.info('[permission] case grantUserGrantedPermission success :' + result); }).catch((err) => { @@ -159,6 +164,21 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { }).catch((err) => { console.info('[permission] case grantUserGrantedPermission failed :' + err); }); + await atManager.grantUserGrantedPermission(tokenID, permissionName6, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName7, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName8, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); } else { console.info('[permission] case apply permission failed, createAtManager failed'); } @@ -183,18 +203,30 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { await getFd('CameraSessionZoomRatio.mp4'); mVideoConfig.url = mFdPath; media.createVideoRecorder((err, recorder) => { - console.info(TAG + 'Entering create video receiver') - mVideoRecorder = recorder - console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) - console.info(TAG + 'videoRecorder.prepare called.') - mVideoRecorder.prepare(mVideoConfig, (err) => { - console.info(TAG + 'videoRecorder.prepare success.') - }) - mVideoRecorder.getInputSurface((err, id) => { - console.info(TAG + 'getInputSurface called') - mVideoSurface = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) - }) + if (!err) { + console.info(TAG + 'Entering create video receiver') + mVideoRecorder = recorder + console.info(TAG + 'videoRecorder is :' + JSON.stringify(mVideoRecorder)) + console.info(TAG + 'videoRecorder.prepare called.') + mVideoRecorder.prepare(mVideoConfig, (err) => { + if (!err) { + console.info(TAG + 'videoRecorder.prepare success.') + mVideoRecorder.getInputSurface((err, id) => { + console.info(TAG + 'getInputSurface called') + if (!err) { + mVideoSurface = id + console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(mVideoSurface)) + } else { + console.info(TAG + 'getInputSurface FAILED') + } + }) + } else { + console.info(TAG + 'prepare FAILED') + } + }) + } else { + console.info(TAG + 'createVideoRecorder FAILED') + } }) console.log(TAG + 'Exit getVideoReceiveSurface') } @@ -249,7 +281,15 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { return false; } - console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraDevicesArray.length); + //mCameraNum = 1; + mCameraNum = mCameraDevicesArray.length; + + console.info(TAG + "getCameraSupportDevicesArray is: " + mCameraNum); + + mZoomRatioRangeArray = new Array(mCameraNum); + mZoomRatioMaxArray = new Array(mCameraNum); + mZoomRatioMinArray = new Array(mCameraNum); + console.info('Exit getCameraSupportDevicesArray'); return true; @@ -317,174 +357,165 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { await mCameraSession.release(); } - async function createInputs() { - console.info('Enter createInputs'); + async function createInput(idx:any) { + console.info('Enter createInput'); if (isEmpty(mCameraDevicesArray)) { console.info(TAG + "Entering createInputs FAILED with NoCamera"); return false; } + + mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); + if (isEmpty(mCameraInput)) { + console.info(TAG + "createCameraInput FAILED"); + return false; + } - mCameraInputArray = new Array(mCameraDevicesArray.length); - mZoomRatioRangeArray = new Array(mCameraDevicesArray.length); - mZoomRatioMaxArray = new Array(mCameraDevicesArray.length); - mZoomRatioMinArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - mCameraInputArray[i] = await mCameraManager.createCameraInput(mCameraDevicesArray[i]); - if (isEmpty(mCameraInputArray[i])) { - console.info(TAG + "createCameraInput FAILED"); - return false; + mCameraInput.open(async (err) => { + console.info(TAG + "Entering mCameraInput open callback"); + if (!err) { + console.info(TAG + "Entering mCameraInput open PASSED "); + } else { + console.info(TAG + "Entering mCameraInput open FAILED : " + err.message); } + }) - mCameraInputArray[i].open(async (err) => { - console.info(TAG + "Entering mCameraInputArray open callback"); - if (!err) { - console.info(TAG + "Entering mCameraInputArray open PASSED "); - } else { - console.info(TAG + "Entering mCameraInputArray open FAILED : " + err.message); - } - }) - - await sleep(2000); + await sleep(100); - console.info(i + 'th CameraInput is: ' + mCameraInputArray[i]); - } + console.info(idx + 'th CameraInput is: ' + mCameraInput); - console.info('Exit createInputs'); + console.info('Exit createInput'); return true; } - async function releaseInputs() { - console.info('Enter releaseInputs'); - - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering releaseInputs FAILED with NoCamera"); - return true; - } + async function releaseInput() { + console.info('Enter releaseInput'); - for (let i = 0; i < mCameraInputArray.length; i++) { - await mCameraInputArray[i].close(); - await mCameraInputArray[i].release(); + if (!isEmpty(mCameraInput)) { + await mCameraInput.close(); + await mCameraInput.release(); } - console.info('Exit releaseInputs'); + console.info('Exit releaseInput'); return true; } - async function createOutputs() { - console.info('Enter createOutputs'); + async function createOutput(idx:any) { + console.info('Enter createOutput'); - mPreviewOutputArray = new Array(mCameraDevicesArray.length); - mPhotoOutputArray = new Array(mCameraDevicesArray.length); - mVideoOutputArray = new Array(mCameraDevicesArray.length); - - for (let i = 0; i < mCameraDevicesArray.length; i++) { - let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[i]); - if (!isEmpty(cameraOutputCap.previewProfiles)) { - console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); - for (let j = 0; j < cameraOutputCap.previewProfiles.length; j++) { - mPreviewOutputArray[i] = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[j], surfaceId); - if (!isEmpty(mPreviewOutputArray[i])) { - break; - } + let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); + if (!isEmpty(cameraOutputCap.previewProfiles)) { + console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); + for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { + mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); + if (!isEmpty(mPreviewOutput)) { + break; } + } - if (isEmpty(mPreviewOutputArray[i])) { - console.info(TAG + "createPreviewOutput FAILED"); - } + if (isEmpty(mPreviewOutput)) { + console.info(TAG + "createPreviewOutput FAILED"); } - /* - if (!isEmpty(cameraOutputCap.photoProfiles)) { - console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); + console.info(TAG + "createPreviewOutput: " + mPreviewOutput); + } + + if (!isEmpty(cameraOutputCap.photoProfiles)) { + console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length); - for (let j = 0; j < cameraOutputCap.photoProfiles.length; j++) { - mPhotoOutputArray[i] = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[j], mPhoteSurface); - if (!isEmpty(mPhotoOutputArray[i])) { - break; - } + for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) { + mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhoteSurface); + if (!isEmpty(mPhotoOutput)) { + break; } + } - if (isEmpty(mPhotoOutputArray[i])) { + if (isEmpty(mPhotoOutput)) { console.info(TAG + "createPhotoOutput FAILED"); - } - - console.info(TAG + "createPhotoOutput: " + mPhotoOutputArray[i]); } - if (!isEmpty(cameraOutputCap.videoProfiles)) { - console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); - for (let j = 0; j < cameraOutputCap.videoProfiles.length; j++) { - mVideoOutputArray[i] = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[j], mVideoSurface); - if (!isEmpty(mVideoOutputArray[i])) { + console.info(TAG + "createPhotoOutput: " + mPhotoOutput); + } + /* + if (!isEmpty(cameraOutputCap.videoProfiles)) { + console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length); + for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) { + try { + mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface); + if (!isEmpty(mVideoOutput)) { break; } } - - if (isEmpty(mVideoOutputArray[i])) { + catch { console.info(TAG + "createVideoOutput FAILED"); } + } - console.info(TAG + "createVideoOutput: " + mPhotoOutputArray[i]); + if (isEmpty(mVideoOutput)) { + console.info(TAG + "createVideoOutput FAILED"); } - */ - } + console.info(TAG + "createVideoOutput: " + mVideoOutput); + } + */ console.info('Exit createOutputs'); return true; } - async function releaseOutputs() { - for (let i = 0; i < mCameraDevicesArray.length; i++) { - if (!isEmpty(mPreviewOutputArray[i])) { - await mPreviewOutputArray[i].close(); - await mPreviewOutputArray[i].release(); - } - - /* - if (!isEmpty(mPhotoOutputArray[i])) { - await mPhotoOutputArray[i].close(); - await mPhotoOutputArray[i].release(); - } - - if (!isEmpty(mVideoOutputArray[i])) { - await mVideoOutputArray[i].close(); - await mVideoOutputArray[i].release(); - } - */ + async function releaseOutput() { + console.info('Enter createOutput'); + + if (!isEmpty(mPreviewOutput)) { + await mPreviewOutput.stop(); + await mPreviewOutput.release(); } + if (!isEmpty(mPhotoOutput)) { + await mPhotoOutput.release(); + } + /* + if (!isEmpty(mVideoOutput)) { + await mVideoOutput.stop(); + await mVideoOutput.release(); + } + */ + console.info('Exit createOutput'); + return true; } async function startCameraSession(idx:any) { console.info(TAG + "Enter startCameraSession"); - if (!isEmpty(mCameraInputArray[idx])) { + await createInput(idx); + await createOutput(idx); + + await sleep(1); + + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to addInput"); - await mCameraSession.addInput(mCameraInputArray[idx]); + await mCameraSession.addInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to addOutput mPreviewOutput"); - await mCameraSession.addOutput(mPreviewOutputArray[idx]); + await mCameraSession.addOutput(mPreviewOutput); } - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to addOutput mPhotoOutput"); - await mCameraSession.addOutput(mPhotoOutputArray[idx]); + await mCameraSession.addOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to addOutput mVideoOutput"); - await mCameraSession.addOutput(mVideoOutputArray[idx]); + await mCameraSession.addOutput(mVideoOutput); } */ + await sleep(1); await commitCameraSessionConfig(); await beginCameraSessionConfig(); @@ -506,7 +537,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { return true; } - async function stopCameraSession(idx:any) { + async function stopCameraSession() { console.info(TAG + "Enter stopCameraSession"); /* mCameraSession.stop(async (err) => { @@ -521,27 +552,28 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { await sleep(1000); */ - if (!isEmpty(mCameraInputArray[idx])) { + if (!isEmpty(mCameraInput)) { console.info(TAG + "Start to removeInput input"); - await mCameraSession.removeInput(mCameraInputArray[idx]); + await mCameraSession.removeInput(mCameraInput); } - if (!isEmpty(mPreviewOutputArray[idx])) { + if (!isEmpty(mPreviewOutput)) { console.info(TAG + "Start to removeOutput mPreviewOutput"); - await mCameraSession.removeOutput(mPreviewOutputArray[idx]); + await mCameraSession.removeOutput(mPreviewOutput); } - - /* - if (!isEmpty(mPhotoOutputArray[idx])) { + + if (!isEmpty(mPhotoOutput)) { console.info(TAG + "Start to removeOutput mPhotoOutput"); - await mCameraSession.removeOutput(mPhotoOutputArray[idx]); + await mCameraSession.removeOutput(mPhotoOutput); } - - if (!isEmpty(mVideoOutputArray[idx])) { + /* + if (!isEmpty(mVideoOutput)) { console.info(TAG + "Start to removeOutput mVideoOutput"); - await mCameraSession.removeOutput(mVideoOutputArray[idx]); + await mCameraSession.removeOutput(mVideoOutput); } */ + await releaseInput(); + await releaseOutput(); console.info(TAG + "Exit stopCameraSession"); @@ -560,8 +592,6 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { await getCameraManagerInstance(); await getCameraSupportDevicesArray(); await createCameraSessionInstance(); - await createInputs(); - await createOutputs(); console.info('Device type = ' + deviceInfo.deviceType); @@ -578,8 +608,6 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { }) afterAll(function () { - releaseInputs(); - releaseOutputs(); releaseVideoReceiveSurface(); releaseCameraSessionInstance(); sleep(1000); @@ -597,12 +625,12 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 start for camera[" + i + "]"); await startCameraSession(i); @@ -614,7 +642,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { mZoomRatioRangeArray[i] = data; console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED with ZoomRatioRange length is: " + data.length); for (let j = 0; j < mZoomRatioRangeArray[i].length; j++) { - console.info(TAG + j + "th, zoom ratio is: " + data[i][j] + ", " + mZoomRatioRangeArray[i][j]); + console.info(TAG + j + "th, zoom ratio is: " + data[j] + ", " + mZoomRatioRangeArray[i][j]); if ((mZoomRatioMaxArray[i] == undefined) || (mZoomRatioMaxArray[i] < mZoomRatioRangeArray[i][j])) { mZoomRatioMaxArray[i] = mZoomRatioRangeArray[i][j] @@ -631,13 +659,12 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { expect().assertFail(); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED : " + err.message); } }) await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 end for camera[" + i + "]"); } @@ -658,32 +685,37 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 start for camera[" + i + "]"); await startCameraSession(i); - let zoomRatioRange = await mCameraSession.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish"); - if (zoomRatioRange.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: " + zoomRatioRange.length); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 FAILED with ZoomRatioRange length is: " + zoomRatioRange.length); - expect().assertFail(); + try { + let zoomRatioRange = await mCameraSession.getZoomRatioRange(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish"); + if (zoomRatioRange.length > 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: " + zoomRatioRange.length); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 FAILED with ZoomRatioRange length is: " + zoomRatioRange.length); + expect().assertFail(); + } + + for (let j = 0; j < zoomRatioRange.length; j++) { + console.info(TAG + j + "th, zoom ratio is: " + zoomRatioRange[j]); + } } - - for (let j = 0; j < zoomRatioRange.length; j++) { - console.info(TAG + j + "th, zoom ratio is: " + zoomRatioRange[j]); + catch { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED"); } await sleep(1000); - await stopCameraSession(i); + await stopCameraSession(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 end for camera[" + i + "]"); } @@ -704,45 +736,47 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 start for camera[" + i + "]"); - await startCameraSession(i); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); - mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0], async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 callback"); - if (!err) { - if (data == mZoomRatioRangeArray[i][0]) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 PASSED with ZoomRatioRange is: " + data); + mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0], async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED with ZoomRatioRange is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED : " + err.message); expect().assertFail(); } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); + }) + await sleep(500); + + mCameraSession.getZoomRatio(async (err, data) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 callback"); + if (!err) { + if (data == mZoomRatioRangeArray[i][0]) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 PASSED with ZoomRatioRange is: " + data); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED with ZoomRatioRange is: " + data); + expect().assertFail(); + } + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 FAILED : " + err.message); + expect().assertFail(); + } + }) + await sleep(500); + + await stopCameraSession(); + } - await stopCameraSession(i); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0100 end for camera[" + i + "]"); } @@ -762,32 +796,34 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100', 2, async function (done) { console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100--------------"); - if (isEmpty(mCameraInputArray)) { + if (mCameraNum == 0) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { + for (let i = 0; i < mCameraNum; i++) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 start for camera[" + i + "]"); - await startCameraSession(i); - - await mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0]); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); - await sleep(500); - - let zoomRatio = await mCameraSession.getZoomRatio(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); - if (zoomRatio == mZoomRatioRangeArray[i][0]) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + zoomRatio); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: " + zoomRatio); - expect().assertFail(); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + await mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0]); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); + await sleep(500); + + let zoomRatio = await mCameraSession.getZoomRatio(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); + if (zoomRatio == mZoomRatioRangeArray[i][0]) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + zoomRatio); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: " + zoomRatio); + expect().assertFail(); + } + await sleep(500); + + await stopCameraSession(); } - await sleep(500); - - await stopCameraSession(i); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 end for camera[" + i + "]"); } @@ -798,417 +834,433 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 * @tc.name : Check capture session zoom ratio with callback(invalid value, max + 1) * @tc.desc : Check capture session zoom ratio with callback(invalid value, max + 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 start for camera[" + i + "]"); - - await startCameraSession(i); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 start for camera[" + i + "]"); - mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 callback"); - if (!err) { - if (data != (mZoomRatioMaxArray[i] + 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 PASSED with ZoomRatio is: " + data); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1), async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 FAILED with ZoomRatio is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED : " + err.message); expect().assertFail(); } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(i); + }) + await sleep(500); + + mCameraSession.getZoomRatio(async (err, data) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 callback"); + if (!err) { + if (data != (mZoomRatioMaxArray[i] + 1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 PASSED with ZoomRatio is: " + data); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED with ZoomRatio is: " + data); + expect().assertFail(); + } + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 FAILED : " + err.message); + expect().assertFail(); + } + }) + await sleep(500); + + await stopCameraSession(); + } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 * @tc.name : Check capture session set zoom ratio with promise(invalid value, max + 1) * @tc.desc : Check capture session set zoom ratio with promise(invalid value, max + 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 start for camera[" + i + "]"); - await startCameraSession(i); - - await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); - await sleep(500); - - let zoomRatio = await mCameraSession.getZoomRatio(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 finish"); - if (zoomRatio != (mZoomRatioMaxArray[i] + 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 PASSED with ZoomRatio is: " + zoomRatio); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 FAILED with ZoomRatio is: " + zoomRatio); - expect().assertFail(); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); + await sleep(500); + + let zoomRatio = await mCameraSession.getZoomRatio(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"); + if (zoomRatio != (mZoomRatioMaxArray[i] + 1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + zoomRatio); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with ZoomRatio is: " + zoomRatio); + expect().assertFail(); + } + await sleep(500); + + await stopCameraSession(); } - await sleep(500); - - await stopCameraSession(i); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0200 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 * @tc.name : Check capture session zoom ratio with callback(invalid value, max + 0.1) * @tc.desc : Check capture session zoom ratio with callback(invalid value, max + 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 start for camera[" + i + "]"); - - await startCameraSession(i); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 start for camera[" + i + "]"); - mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 callback"); - if (!err) { - if (data != (mZoomRatioMaxArray[i] + 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 PASSED with ZoomRatio is: " + data); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1), async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 FAILED with ZoomRatio is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED : " + err.message); expect().assertFail(); } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(i); + }) + await sleep(500); + + mCameraSession.getZoomRatio(async (err, data) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 callback"); + if (!err) { + if (data != (mZoomRatioMaxArray[i] + 0.1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 PASSED with ZoomRatio is: " + data); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED with ZoomRatio is: " + data); + expect().assertFail(); + } + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 FAILED : " + err.message); + expect().assertFail(); + } + }) + await sleep(500); + + await stopCameraSession(); + } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 * @tc.name : Check capture session set zoom ratio with promise(invalid value, max + 0.1) * @tc.desc : Check capture session set zoom ratio with promise(invalid value, max + 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 start for camera[" + i + "]"); - await startCameraSession(i); - - await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); - await sleep(500); - - let zoomRatio = await mCameraSession.getZoomRatio(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 finish"); - if (zoomRatio != (mZoomRatioMaxArray[i] + 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 PASSED with ZoomRatio is: " + zoomRatio); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 FAILED with ZoomRatio is: " + zoomRatio); - expect().assertFail(); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); + await sleep(500); + + let zoomRatio = await mCameraSession.getZoomRatio(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"); + if (zoomRatio != (mZoomRatioMaxArray[i] + 0.1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + zoomRatio); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with ZoomRatio is: " + zoomRatio); + expect().assertFail(); + } + await sleep(500); + + await stopCameraSession(); } - await sleep(500); - - await stopCameraSession(i); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0300 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 * @tc.name : Check capture session zoom ratio with callback(invalid value, min - 1) * @tc.desc : Check capture session zoom ratio with callback(invalid value, min - 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 start for camera[" + i + "]"); - - await startCameraSession(i); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 start for camera[" + i + "]"); - mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 callback"); - if (!err) { - if (data != (mZoomRatioMinArray[i] - 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 PASSED with ZoomRatio is: " + data); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1), async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 FAILED with ZoomRatio is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED : " + err.message); expect().assertFail(); } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(i); + }) + await sleep(500); + + mCameraSession.getZoomRatio(async (err, data) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 callback"); + if (!err) { + if (data != (mZoomRatioMinArray[i] - 1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 PASSED with ZoomRatio is: " + data); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED with ZoomRatio is: " + data); + expect().assertFail(); + } + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 FAILED : " + err.message); + expect().assertFail(); + } + }) + await sleep(500); + + await stopCameraSession(); + } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 * @tc.name : Check capture session set zoom ratio with promise(invalid value, min - 1) * @tc.desc : Check capture session set zoom ratio with promise(invalid value, min - 1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 start for camera[" + i + "]"); - - await startCameraSession(i); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 start for camera[" + i + "]"); - await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); - await sleep(500); - - let zoomRatio = await mCameraSession.getZoomRatio(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 finish"); - if (zoomRatio != (mZoomRatioMinArray[i] - 1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 PASSED with ZoomRatio is: " + zoomRatio); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 FAILED with ZoomRatio is: " + zoomRatio); - expect().assertFail(); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); + await sleep(500); + + let zoomRatio = await mCameraSession.getZoomRatio(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"); + if (zoomRatio != (mZoomRatioMinArray[i] - 1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + zoomRatio); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with ZoomRatio is: " + zoomRatio); + expect().assertFail(); + } + await sleep(500); + + await stopCameraSession(); } - await sleep(500); - - await stopCameraSession(i); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0400 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 * @tc.name : Check capture session zoom ratio with callback(invalid value, min - 0.1) * @tc.desc : Check capture session zoom ratio with callback(invalid value, min - 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 start for camera[" + i + "]"); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 start for camera[" + i + "]"); - await startCameraSession(i); - - mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] - 0.1), async (err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 callback"); - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - mCameraSession.getZoomRatio(async (err, data) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 callback"); - if (!err) { - if (data != (mZoomRatioMaxArray[i] - 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 PASSED with ZoomRatio is: " + data); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] - 0.1), async (err) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 callback"); + if (!err) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 FAILED with ZoomRatio is: " + data); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED : " + err.message); expect().assertFail(); } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 FAILED : " + err.message); - expect().assertFail(); - } - }) - await sleep(500); - - await stopCameraSession(i); + }) + await sleep(500); + + mCameraSession.getZoomRatio(async (err, data) => { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 callback"); + if (!err) { + if (data != (mZoomRatioMaxArray[i] - 0.1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 PASSED with ZoomRatio is: " + data); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED with ZoomRatio is: " + data); + expect().assertFail(); + } + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 FAILED : " + err.message); + expect().assertFail(); + } + }) + await sleep(500); + + await stopCameraSession(); + } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_CALLBACK_0104 ends here"); done(); } }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 + * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 * @tc.name : Check capture session set zoom ratio with promise(invalid value, min - 0.1) * @tc.desc : Check capture session set zoom ratio with promise(invalid value, min - 0.1) * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 */ - it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500', 2, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500--------------"); + it('SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104', 2, async function (done) { + console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104--------------"); - if (isEmpty(mCameraInputArray)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 FAILED with NoCamera"); + if (mCameraNum == 0) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with NoCamera"); expect().assertFail(); done(); } else { - for (let i = 0; i < mCameraInputArray.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 start for camera[" + i + "]"); - - await startCameraSession(i); + for (let i = 0; i < mCameraNum; i++) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 start for camera[" + i + "]"); - await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 0.1)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 finish"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); - await sleep(500); - - let zoomRatio = await mCameraSession.getZoomRatio(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 finish"); - if (zoomRatio != (mZoomRatioMinArray[i] - 0.1)) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 PASSED with ZoomRatio is: " + zoomRatio); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 FAILED with ZoomRatio is: " + zoomRatio); - expect().assertFail(); + if (!isEmpty(mZoomRatioRangeArray[i])) { + await startCameraSession(i); + + await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 0.1)); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); + await sleep(500); + + let zoomRatio = await mCameraSession.getZoomRatio(); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"); + if (zoomRatio != (mZoomRatioMinArray[i] - 0.1)) { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + zoomRatio); + } else { + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with ZoomRatio is: " + zoomRatio); + expect().assertFail(); + } + await sleep(500); + + await stopCameraSession(); } - await sleep(500); - - await stopCameraSession(i); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 end for camera[" + i + "]"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 end for camera[" + i + "]"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0500 ends here"); + console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 ends here"); done(); } })