diff --git a/multimedia/BUILD.gn b/multimedia/BUILD.gn index f8aaba26b844e22144d8cddd2fee6a36c92d97d0..a2dbeb17bc49cad11a689180e8f45fc68de6155a 100644 --- a/multimedia/BUILD.gn +++ b/multimedia/BUILD.gn @@ -24,12 +24,7 @@ group("multimedia") { "audio/audio_js_standard/audioManager:audio_manager_js_hap", "audio/audio_js_standard/audioRenderer:audio_renderer_js_hap", "audio/audio_js_standard/audioVoip:audio_voip_js_hap", - "camera/cameraDepthOffield:camera_depthoffield_ets_hap", - "camera/cameraExceedWideAngle:camera_exceedwideangle_ets_hap", - "camera/cameraLongFocus:camera_longfocus_ets_hap", - "camera/cameraUnspc:camera_unspc_ets_hap", - "camera/cameraWideAngle:camera_wideangle_ets_hap", - "camera/cameraWideAngleRK:camera_wideanglerk_ets_hap", + "camera/camera_js_standard:camera_standard_ets_hap", "image/image_js_standard/image:image_js_hap", "image/image_js_standard/imageColorspace:image_colorspace_js_hap", "image/image_js_standard/imageCreator:image_creator_js_hap", diff --git a/multimedia/camera/cameraDepthOffield/BUILD.gn b/multimedia/camera/cameraDepthOffield/BUILD.gn deleted file mode 100644 index 7eafa6b91290e7a05a8b6c315032c1fc84f2071c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("camera_depthoffield_ets_hap") { - hap_profile = "./src/main/config.json" - deps = [ - ":camera_ets_assets", - ":camera_ets_resources", - ] - ets2abc = true - - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsCameraDepthOffieldETSTest" - subsystem_name = "multimedia" - part_name = "multimedia_camera_framework" -} -ohos_js_assets("camera_ets_assets") { - source_dir = "./src/main/ets/MainAbility" -} -ohos_resources("camera_ets_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/camera/cameraDepthOffield/Test.json b/multimedia/camera/cameraDepthOffield/Test.json deleted file mode 100644 index 9fea4acc6bb6c4accd35c3e4a4888301e3e5e303..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/Test.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "Configuration for camerastandard DepthOffield Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "1000000", - "package": "com.open.harmony.multimedia.cameradftest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "touch /data/media/01.mp4", - "chmod -R 777 /data/media" - - ], - "teardown-command":[ - - ] - }, - { - "test-file-name": [ - "ActsCameraDepthOffieldETSTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraDepthOffield/src/main/config.json b/multimedia/camera/cameraDepthOffield/src/main/config.json deleted file mode 100644 index 5f72095e70a283e57f1253d92f7222abaaf2dcda..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/src/main/config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.multimedia.cameradftest", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.multimedia.cameradftest", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.multimedia.cameradftest.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.CAMERA", - "reason": "use ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "use ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason": "use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "use ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "use ohos.permission.WRITE_MEDIA" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets deleted file mode 100644 index b74a9528e3bcdfe491dfe794285f6989d496adf4..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ /dev/null @@ -1,2779 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitCameraFormat(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitCameraFormat', function () { - console.info(TAG + '----------CameraJsUnitCameraFormat--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 PASSED"); - } - } 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_CAMERA_MANAGER_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - var cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - var camerasArrayPromise = await cameraManager.getCameras(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 - * @tc.name : get camera if from camera-0 input async api - * @tc.desc : get camera if from camera-0 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100', 0, async function (done) { - camera0Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 data is not null || undefined"); - var CameraId0 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 PASSED with CameraID :" + CameraId0); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 - * @tc.name : get camera if from camera-0 input promise api - * @tc.desc : get camera if from camera-0 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100', 0, async function (done) { - var camera0IdPromise = await camera0InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); - if (camera0IdPromise != null && camera0IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 PASSED" + camera0IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-0 camerainput async api - * @tc.desc : Get supported video formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 - * @tc.name : Get supported video formats from camera-0 camerainput promise api - * @tc.desc : Get supported video formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on("focusStateChange", async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CAMERA-1 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-1 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera1InputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 - * @tc.name : get camera ID from camera-1 input async api - * @tc.desc : get camera ID from camera-1 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - camera1Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - var CameraId1 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 PASSED with CameraID : " + CameraId1); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 - * @tc.name : get camera ID from camera-1 input promise api - * @tc.desc : get camera ID from camera-1 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100', 0, async function (done) { - var camera1IdPromise = await camera1InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise: " + JSON.stringify(camera1IdPromise)); - if (camera1IdPromise != null && camera1IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 PASSED" + camera1IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-1 camerainput async api - * @tc.desc : Get supported video formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 - * @tc.name : Get supported video formats from camera-1 camerainput promise api - * @tc.desc : Get supported video formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-2 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraId async api - * @tc.desc : Create camerainput from camera-2 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-2 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera2Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[2].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraId promise api - * @tc.desc : Create camerainput from camera-2 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera2InputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise: " + JSON.stringify(camera2InputPromise)); - if (camera2InputPromise != null && camera2InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 - * @tc.name : get camera ID from camera-2 input async api - * @tc.desc : get camera ID from camera-2 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - camera2Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - var CameraId2 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 PASSED with CameraID : " + CameraId2); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 - * @tc.name : get camera ID from camera-2 input promise api - * @tc.desc : get camera ID from camera-2 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100', 0, async function (done) { - var camera2IdPromise = await camera2InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise: " + JSON.stringify(camera2IdPromise)); - if (camera2IdPromise != null && camera2IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 PASSED" + camera2IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-2 camerainput async api - * @tc.desc : Get supported video formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 - * @tc.name : Get supported video formats from camera-2 camerainput promise api - * @tc.desc : Get supported video formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-3 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraId async api - * @tc.desc : Create camerainput from camera-3 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-3 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera3Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[3].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraId promise api - * @tc.desc : Create camerainput from camera-3 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera3InputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise: " + JSON.stringify(camera3InputPromise)); - if (camera3InputPromise != null && camera3InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 - * @tc.name : get camera ID from camera-3 input async api - * @tc.desc : get camera ID from camera-3 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - camera3Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - var CameraId3 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 PASSED with CameraID : " + CameraId3); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 - * @tc.name : get camera ID from camera-3 input promise api - * @tc.desc : get camera ID from camera-3 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100', 0, async function (done) { - var camera3IdPromise = await camera3InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise: " + JSON.stringify(camera3IdPromise)); - if (camera3IdPromise != null && camera3IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 PASSED" + camera3IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-3 camerainput async api - * @tc.desc : Get supported video formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 - * @tc.name : Get supported video formats from camera-3 camerainput promise api - * @tc.desc : Get supported video formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE TRUE DEAPTH*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype true deapth async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype true deapth async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype true deapth promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype true deapth promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE TRUE DEAPTH*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype true deapth async api - * @tc.desc : Create camerainput from cameraposition back & cameratype true deapth async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype true deapth promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype true deapth promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE TRUE DEAPTH*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype true deapth async api - * @tc.desc : Create camerainput from cameraposition front & cameratype true deapth async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype true deapth promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype true deapth promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets deleted file mode 100644 index 54de11efdc95e7ad97d972b4081928b1e224b8ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitEnum(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJSUnitEnum', function () { - console.info(TAG + '----------CameraJSUnitEnum--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100 - * @tc.name : camera status ENAME - * @tc.desc : camera status ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100------------"); - console.info(TAG + "CameraStatus CAMERA_STATUS_APPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_APPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_APPEAR).assertEqual(0); - console.info(TAG + "CameraStatus CAMERA_STATUS_DISAPPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR).assertEqual(1); - console.info(TAG + "CameraStatus CAMERA_STATUS_AVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE).assertEqual(2); - console.info(TAG + "CameraStatus CAMERA_STATUS_UNAVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100 - * @tc.name : Camera position ENAME - * @tc.desc : Camera position ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100------------") - console.info(TAG + "CameraPosition CAMERA_POSITION_BACK : " + cameraObj.CameraPosition.CAMERA_POSITION_BACK); - expect(cameraObj.CameraPosition.CAMERA_POSITION_BACK).assertEqual(1); - console.info(TAG + "CameraPosition CAMERA_POSITION_FRONT : " + cameraObj.CameraPosition.CAMERA_POSITION_FRONT); - expect(cameraObj.CameraPosition.CAMERA_POSITION_FRONT).assertEqual(2); - console.info(TAG + "CameraPosition CAMERA_POSITION_UNSPECIFIED : " + cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED); - expect(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED).assertEqual(0); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100 - * @tc.name : camera type ENAME - * @tc.desc : camera type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100------------") - console.info(TAG + "CameraType CAMERA_TYPE_UNSPECIFIED : " + cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - expect(cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED).assertEqual(0); - console.info(TAG + "CameraType CAMERA_TYPE_WIDE_ANGLE : " + cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE); - expect(cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE).assertEqual(1); - console.info(TAG + 'CameraType CAMERA_TYPE_ULTRA_WIDE : ' + cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE); - expect(cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE).assertEqual(2); - console.info(TAG + 'CameraType CAMERA_TYPE_TELEPHOTO : ' + cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO); - expect(cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO).assertEqual(3); - console.info(TAG + 'CameraType CAMERA_TYPE_TRUE_DEPTH : ' + cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - expect(cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH).assertEqual(4); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100 - * @tc.name : connection type ENAME - * @tc.desc : connection type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100------------") - console.info(TAG + "ConnectionType CAMERA_CONNECTION_BUILT_IN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN).assertEqual(0); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_USB_PLUGIN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN).assertEqual(1); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_REMOTE : " + cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100 - * @tc.name : Flash Mode ENAME - * @tc.desc : Flash Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100------------") - console.info(TAG + "FlashMode FLASH_MODE_CLOSE : " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - console.info(TAG + "FlashMode FLASH_MODE_OPEN : " + cameraObj.FlashMode.FLASH_MODE_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - console.info(TAG + "FlashMode FLASH_MODE_AUTO : " + cameraObj.FlashMode.FLASH_MODE_AUTO); - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - console.info(TAG + "FlashMode FLASH_MODE_ALWAYS_OPEN : " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100 - * @tc.name : Focus Mode ENAME - * @tc.desc : Focus Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100------------") - console.info(TAG + "FocusMode FOCUS_MODE_MANUAL : " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0); - console.info(TAG + "FocusMode FOCUS_MODE_CONTINUOUS_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "FocusMode FOCUS_MODE_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "FocusMode FOCUS_MODE_LOCKED : " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100 - * @tc.name : Focus State ENAME - * @tc.desc : Focus State ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100------------") - console.info(TAG + "FocusState FOCUS_STATE_SCAN : " + cameraObj.FocusState.FOCUS_STATE_SCAN); - expect(cameraObj.FocusState.FOCUS_STATE_SCAN).assertEqual(0); - console.info(TAG + "FocusState FOCUS_STATE_FOCUSED : " + cameraObj.FocusState.FOCUS_STATE_FOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_FOCUSED).assertEqual(1); - console.info(TAG + "FocusState FOCUS_STATE_UNFOCUSED : " + cameraObj.FocusState.FOCUS_STATE_UNFOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_UNFOCUSED).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100 - * @tc.name : Image Rotation ENAME - * @tc.desc : Image Rotation ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100------------") - console.info(TAG + "ImageRotation ROTATION_0 : " + cameraObj.ImageRotation.ROTATION_0); - expect(cameraObj.ImageRotation.ROTATION_0).assertEqual(0); - console.info(TAG + "ImageRotation ROTATION_90 : " + cameraObj.ImageRotation.ROTATION_90); - expect(cameraObj.ImageRotation.ROTATION_90).assertEqual(90); - console.info(TAG + "ImageRotation ROTATION_180 : " + cameraObj.ImageRotation.ROTATION_180); - expect(cameraObj.ImageRotation.ROTATION_180).assertEqual(180); - console.info(TAG + "ImageRotation ROTATION_270 : " + cameraObj.ImageRotation.ROTATION_270); - expect(cameraObj.ImageRotation.ROTATION_270).assertEqual(270); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100 - * @tc.name : Quality Level ENAME - * @tc.desc : Quality Level ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100------------") - console.info(TAG + "QualityLevel QUALITY_LEVEL_HIGH : " + cameraObj.QualityLevel.QUALITY_LEVEL_HIGH); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_HIGH).assertEqual(0); - console.info(TAG + "QualityLevel QUALITY_LEVEL_MEDIUM : " + cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM).assertEqual(1); - console.info(TAG + "QualityLevel QUALITY_LEVEL_LOW : " + cameraObj.QualityLevel.QUALITY_LEVEL_LOW); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_LOW).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 - * @tc.name : CameraInputErrorCode ENAME - * @tc.desc : CameraInputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 : " + cameraObj.CameraInputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CameraInputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 - * @tc.name : CaptureSessionErrorCode ENAME - * @tc.desc : CaptureSessionErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 : " + cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 - * @tc.name : PreviewOutputErrorCode ENAME - * @tc.desc : PreviewOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 : " + cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 - * @tc.name : PhotoOutputErrorCode ENAME - * @tc.desc : PhotoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 : " + cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 - * @tc.name : VideoOutputErrorCode ENAME - * @tc.desc : VideoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 : " + cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets deleted file mode 100644 index 3b990e106f896ed54704bdb813583aa6c359e1fb..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ /dev/null @@ -1,3606 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0Input; -var camera1Input; -var cameraManager; -var previewOutputAsync; -var photoOutputAsync; -var captureSession; -var surfaceId1; -var camerasArray; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoAsync', function () { - console.info(TAG + '----------CameraJsUnitPhotoAsync--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-Precision Control-Async-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Camera Manager success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering Camera Manager data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GetCameras success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering GetCameras data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GetCameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GetCameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GetCameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "cameraInput error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Create PreviewOutput instance api - * @tc.desc : Create PreviewOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - cameraObj.createPreviewOutput(surfaceId, async (err, data) => { - if (!err) { - console.info(TAG + " Entering createPreviewOutput success"); - if (data != null || data != undefined) { - console.info(TAG + " Entering createPreviewOutput data is not null || undefined"); - previewOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED" + previewOutputAsync); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 to operate"); - previewOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 - * @tc.name : Create CaptureSession instance api - * @tc.desc : Create CaptureSession instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 to operate"); - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - captureSession = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 - * @tc.name : Add Input with camera1Input api - * @tc.desc : Add Input with camera1Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 to operate"); - captureSession.addInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - photoOutputAsync.setMirror(false, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - captureSession.removeInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 to operate"); - captureSession.addInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputAsync.on("frameStart", async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputAsync.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 to operate"); - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 PASSED"); - } - else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings2 api - * @tc.desc : Photo output capture with photosettings2 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - photoOutputAsync.capture(photosettings3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings3 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - photoOutputAsync.capture(photosettings4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings4 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - camera0Input.getFocalLength(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_POINT to operate"); - camera0Input.setFocusPoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SET_FOCUS_POINT PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_POINT to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_POINT PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); - console.info(TAG + "GET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 to operate"); - camera0Input.setFocusPoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 to operate"); - camera0Input.setFocusPoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : GET_FOCUS_POINT_focus mode auto - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 -4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - camera0Input.setExposurePoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 mode auto - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 mode auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - camera0Input.setExposurePoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 mode continuous auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - camera0Input.setExposurePoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 -5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - camera0Input.setExposureBias(-5, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 6 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - camera0Input.setExposureBias(6, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 to operate"); - captureSession.stop(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.stop data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 to operate"); - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 previewOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 to operate"); - previewOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutputAsync.release success"); - console.info(TAG + "Entering previewOutputAsync.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets deleted file mode 100644 index c14442e53bbb82953bb57518e61b1a76791d112c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ /dev/null @@ -1,3283 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0InputPromise; -var cameraManagerPromise; -var previewOutputPromise; -var photoOutputPromise; -var CaptureSessionPromise; -var surfaceId1; -var camerasArrayPromise -var camera1InputPromise; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoPromise', function () { - console.info(TAG + '----------CameraJsUnitPhotoPromise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-PhotoMode-Promise-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - camerasArrayPromise = await cameraManagerPromise.getCameras(); - console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering Get Cameras success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering Get Cameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering Get Cameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering Get Cameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); - console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200--------------"); - camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); - console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during camera0InputPromise with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PreviewOutput instance promise api - * @tc.desc : Create PreviewOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId); - console.info(TAG + " Entering createPreviewOutput success"); - if (previewOutputPromise != null || previewOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering createPreviewOutput PASSED: " + JSON.stringify(previewOutputPromise)); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create CaptureSession instance promise api - * @tc.desc : Create Capturesession instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); - CaptureSessionPromise = await cameraObj.createCaptureSession(null); - console.info(TAG + "Entering createCaptureSession success"); - if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - CaptureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering Remove preview Output success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - await photoOutputPromise.setMirror(true).then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - await photoOutputPromise.setMirror(false) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); - } - console.info(TAG + "Entering beginConfig ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - // callback related API - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED :" + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 to operate"); - await CaptureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - await photoOutputPromise.capture(photosettings3) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 :" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - await photoOutputPromise.capture(photosettings4) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - await sleep(1000) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); - if (data == 2) { - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - }) - .catch((err) => { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100-4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with location settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400-5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - await camera0InputPromise.setExposureBias(-5) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - await camera0InputPromise.setExposureBias(6) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 ends here"); - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session stop captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.stop(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session release captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PhotoOutput release api - * @tc.desc : PhotoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await photoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - }); -} \ No newline at end of file diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets deleted file mode 100644 index 571ca690ff89ac2fbd3becb18f81fc97bc447bf8..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ /dev/null @@ -1,3800 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = "CameraModuleTest: "; -var cameraManager -var camerasArray -var camera0Input -var previewOutput -var photoOutputAsync -var videoRecorder -var surfaceId1 - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point = { x: 1, y: 1 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -let fdPath; -let fileAsset; -let fdNumber; -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/02.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var videoId -var videoOutput -var captureSession - -export default function cameraJSUnitVideoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('02.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModeAsync', function () { - console.info(TAG + '----------Camera-VideoMode-Async--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------') - await sleep(1) - cameraObj.getCameraManager(null, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Camera manager success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') - cameraManager = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------') - await sleep(1) - cameraManager.getCameras((err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Cameras success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Cameras data is not null || undefined') - camerasArray = data - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId - console.info(TAG + 'Entering Get Cameras camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArray[i].cameraPosition - console.info(TAG + 'Entering Get Cameras camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArray[i].cameraType - console.info(TAG + 'Entering Get Cameras camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArray[i].connectionType - console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined') - } - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info('--------------CAMERA-0 STARTS HERE--------------') - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------') - await sleep(1) - cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + 'Entering Create camera input data is not null || undefined') - camera0Input = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :' + camerasArray[0].cameraId) - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0Input error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 - * @tc.name : Create previewoutput async api - * @tc.desc : Create previewoutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createPreviewOutput(surfaceId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create preview output success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create preview output data is not null || undefined') - previewOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - previewOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 - * @tc.name : Create videooutput async api - * @tc.desc : Create videooutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 to operate') - await getvideosurface() - await sleep(2) - cameraObj.createVideoOutput(videoId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create videooutput success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create videooutput data is not null || undefined') - videoOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "VideoOutput Errorcallback is success") - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 - * @tc.name : Create capturesession async api - * @tc.desc : Create capturesession async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create capturesession success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create capturesession data is not null || undefined') - captureSession = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail() - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 - * @tc.name : Begin Config async api - * @tc.desc : Begin Config async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering Begin Config captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.beginConfig((err, data) => { - if (!err) { - console.info(TAG + 'Entering Begin Config success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput preview success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput video success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 ends here') - await sleep(1); - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(previewOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove video Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove video Output FAILED" + err.message); - console.info(TAG + "Entering Remove video Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - //framerate - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 to operate"); - videoOutput.getFrameRateRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get frame rate range success"); - expect(true).assertTrue(); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api_err - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Off success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLOw async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode low success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1) - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeMedium - * @tc.desc : getVideoStabilizationModeMedium async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode medium success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode High success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Auto success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 - * @tc.name : CommitConfig async api - * @tc.desc : CommitConfig async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CommitConfig success') - console.info(TAG + 'Entering CommitConfig data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //callback API - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate"); - previewOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - videoOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success'); - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 - * @tc.name : CaptureSession start async api - * @tc.desc : CaptureSession start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 to operate") - await sleep(1) - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering CaptureSession start success") - expect(true).assertTrue() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 PASSED") - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 ends here"); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100_exposure mode continuous auto - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 - * @tc.name : VideoOutput start async api - * @tc.desc : VideoOutput start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 videoOutput == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 to operate") - await sleep(1) - videoOutput.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 success: " + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 FAILED: " + err.message) - } - }) - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 - * @tc.name : VideoRecorder start async api - * @tc.desc : VideoRecorder start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 to operate') - videoRecorder.start() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 called'); - sleep(3); - console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') - photoOutputAsync.capture(photosettings1) - console.info(TAG + 'Capture during Video - End.') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 - * @tc.name : VideoOutput stop async api - * @tc.desc : VideoOutput stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 to operate') - videoOutput.stop(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 success: ' + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 - * @tc.name : VideoRecorder stop async api - * @tc.desc : VideoRecorder stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 to operate') - videoRecorder.stop() - console.info(TAG + 'VideoRecorder stop stopVideo done.') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 PASSED') - expect(true).assertTrue() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 - * @tc.name : CaptureSession stop async api - * @tc.desc : CaptureSession stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 to operate') - await sleep(1) - captureSession.stop((err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession stop success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 - * @tc.name : CaptureSession release async api - * @tc.desc : CaptureSession release async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 to operate') - await sleep(1) - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession release success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering CaptureSession release data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : videooutput release api - * @tc.desc : videooutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - videoOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering videooutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering videooutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - previewOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering previewOutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutput.release PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering previewOutput.release ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/BUILD.gn b/multimedia/camera/cameraExceedWideAngle/BUILD.gn deleted file mode 100644 index a356254e9fbdc58ad635d6eca2244be8933337cc..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("camera_exceedwideangle_ets_hap") { - hap_profile = "./src/main/config.json" - deps = [ - ":camera_ets_assets", - ":camera_ets_resources", - ] - ets2abc = true - - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsCameraExceedWideAngleETSTest" - subsystem_name = "multimedia" - part_name = "multimedia_camera_framework" -} -ohos_js_assets("camera_ets_assets") { - source_dir = "./src/main/ets/MainAbility" -} -ohos_resources("camera_ets_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/camera/cameraExceedWideAngle/Test.json b/multimedia/camera/cameraExceedWideAngle/Test.json deleted file mode 100644 index ce558e4540f05ec6691299f5ffe1f5fc3b723883..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/Test.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "Configuration for camerastandard ExceedWideAngle Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "1000000", - "package": "com.open.harmony.multimedia.cameraewatest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "touch /data/media/01.mp4", - "chmod -R 777 /data/media" - - ], - "teardown-command":[ - - ] - }, - { - "test-file-name": [ - "ActsCameraExceedWideAngleETSTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/signature/openharmony_sx.p7b b/multimedia/camera/cameraExceedWideAngle/signature/openharmony_sx.p7b deleted file mode 100644 index 0625db92101ca16c7becfaf2d4008ea2e96078e1..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraExceedWideAngle/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/config.json b/multimedia/camera/cameraExceedWideAngle/src/main/config.json deleted file mode 100644 index 11d48a86f5e159efc215ce9bfe5fe678298a4561..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.multimedia.cameraewatest", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.multimedia.cameraewatest", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.multimedia.cameraewatest.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.CAMERA", - "reason": "use ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "use ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason": "use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "use ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "use ohos.permission.WRITE_MEDIA" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/app.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/app.ets deleted file mode 100644 index a9f8218978fad817d4519aa1b715da0e3f8ebbfc..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/pages/index.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index ca96b03e80e49976adf3f876fadb4d82d574c6ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend} from "deccjsunit/index" -import cameraKit from "../test/Camera.test" -import featureAbility from "@ohos.ability.featureAbility" - -let TAG = 'CameraModuleTest: ' -var mXComponentController: XComponentController = new XComponentController() -var surfaceId: any - -@Entry -@Component -struct CameraIndex { - @State isShowSettings: boolean = false - @State previewSize: string = '75%' - - aboutToAppear() { - console.info('--------------aboutToAppear--------------') - } - - build() { - Flex() { - XComponent({ - id: '', - type: 'surface', - libraryname: '', - controller: mXComponentController - }) - .onLoad(() => { - console.info('CameraModuleTest: OnLoad() is called!') - mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 }); - surfaceId = mXComponentController.getXComponentSurfaceId() - console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + surfaceId) - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - console.info(TAG + 'Entering expectExtend') - core.addService('expect', expectExtend) - console.info(TAG + 'Entering addService') - core.init() - console.info(TAG + 'Entering core.init()') - console.info(TAG + 'Entering subscribeEvent') - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - console.info(TAG + 'Entering configService') - cameraKit(surfaceId) - core.execute() - console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error)); - }) - }) - .width('1920px') - .height('1080px') - } - } -} diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/Camera.test.ets deleted file mode 100644 index 2743a3a6f94f359e98785fa0a21bf1518e7a9859..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/Camera.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraJSUnitEnum from './CameraJSUnitEnum.test.ets' -import cameraJSUnitCameraFormat from './CameraJSUnitCameraFormat.test.ets' -import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' -import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' -import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' -import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' - -let TAG = 'CameraModuleTest: ' - -export default function cameraKit(surfaceId: any) { - console.info(TAG + 'Entering cameraKit') - console.info(TAG + 'surfaceId: ' + surfaceId) - - cameraJSUnitEnum(surfaceId) - cameraJSUnitCameraFormat(surfaceId) - cameraJSUnitPhotoAsync(surfaceId) - cameraJSUnitPhotoPromise(surfaceId) - cameraJSUnitVideoAsync(surfaceId) - cameraJSUnitVideoPromise(surfaceId) -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets deleted file mode 100644 index b5631b504db4526f32d15ccbf90e1f857b315dbb..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ /dev/null @@ -1,2779 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitCameraFormat(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitCameraFormat', function () { - console.info(TAG + '----------CameraJsUnitCameraFormat--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 PASSED"); - } - } 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_CAMERA_MANAGER_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - var cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - var camerasArrayPromise = await cameraManager.getCameras(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 - * @tc.name : get camera if from camera-0 input async api - * @tc.desc : get camera if from camera-0 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100', 0, async function (done) { - camera0Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 data is not null || undefined"); - var CameraId0 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 PASSED with CameraID :" + CameraId0); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 - * @tc.name : get camera if from camera-0 input promise api - * @tc.desc : get camera if from camera-0 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100', 0, async function (done) { - var camera0IdPromise = await camera0InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); - if (camera0IdPromise != null && camera0IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 PASSED" + camera0IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-0 camerainput async api - * @tc.desc : Get supported video formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 - * @tc.name : Get supported video formats from camera-0 camerainput promise api - * @tc.desc : Get supported video formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on("focusStateChange", async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CAMERA-1 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-1 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera1InputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 - * @tc.name : get camera ID from camera-1 input async api - * @tc.desc : get camera ID from camera-1 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - camera1Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - var CameraId1 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 PASSED with CameraID : " + CameraId1); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 - * @tc.name : get camera ID from camera-1 input promise api - * @tc.desc : get camera ID from camera-1 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100', 0, async function (done) { - var camera1IdPromise = await camera1InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise: " + JSON.stringify(camera1IdPromise)); - if (camera1IdPromise != null && camera1IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 PASSED" + camera1IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-1 camerainput async api - * @tc.desc : Get supported video formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 - * @tc.name : Get supported video formats from camera-1 camerainput promise api - * @tc.desc : Get supported video formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-2 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraId async api - * @tc.desc : Create camerainput from camera-2 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-2 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera2Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[2].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraId promise api - * @tc.desc : Create camerainput from camera-2 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera2InputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise: " + JSON.stringify(camera2InputPromise)); - if (camera2InputPromise != null && camera2InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 - * @tc.name : get camera ID from camera-2 input async api - * @tc.desc : get camera ID from camera-2 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - camera2Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - var CameraId2 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 PASSED with CameraID : " + CameraId2); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 - * @tc.name : get camera ID from camera-2 input promise api - * @tc.desc : get camera ID from camera-2 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100', 0, async function (done) { - var camera2IdPromise = await camera2InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise: " + JSON.stringify(camera2IdPromise)); - if (camera2IdPromise != null && camera2IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 PASSED" + camera2IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-2 camerainput async api - * @tc.desc : Get supported video formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 - * @tc.name : Get supported video formats from camera-2 camerainput promise api - * @tc.desc : Get supported video formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-3 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraId async api - * @tc.desc : Create camerainput from camera-3 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-3 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera3Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[3].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraId promise api - * @tc.desc : Create camerainput from camera-3 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera3InputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise: " + JSON.stringify(camera3InputPromise)); - if (camera3InputPromise != null && camera3InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 - * @tc.name : get camera ID from camera-3 input async api - * @tc.desc : get camera ID from camera-3 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - camera3Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - var CameraId3 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 PASSED with CameraID : " + CameraId3); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 - * @tc.name : get camera ID from camera-3 input promise api - * @tc.desc : get camera ID from camera-3 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100', 0, async function (done) { - var camera3IdPromise = await camera3InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise: " + JSON.stringify(camera3IdPromise)); - if (camera3IdPromise != null && camera3IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 PASSED" + camera3IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-3 camerainput async api - * @tc.desc : Get supported video formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 - * @tc.name : Get supported video formats from camera-3 camerainput promise api - * @tc.desc : Get supported video formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE ULTRA ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype ultra wide async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype ultra wide async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype ultra wide promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype ultra wide promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) - .then(function () { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 FAILED"); - expect().assertFail(); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE ULTRA ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype ultra wide async api - * @tc.desc : Create camerainput from cameraposition back & cameratype ultra wide async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype ultra wide promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype ultra wide promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE ULTRA ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype ultra wide async api - * @tc.desc : Create camerainput from cameraposition front & cameratype ultra wide async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype ultra wide promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype ultra wide promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets deleted file mode 100644 index 3b990e106f896ed54704bdb813583aa6c359e1fb..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ /dev/null @@ -1,3606 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0Input; -var camera1Input; -var cameraManager; -var previewOutputAsync; -var photoOutputAsync; -var captureSession; -var surfaceId1; -var camerasArray; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoAsync', function () { - console.info(TAG + '----------CameraJsUnitPhotoAsync--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-Precision Control-Async-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Camera Manager success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering Camera Manager data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GetCameras success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering GetCameras data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GetCameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GetCameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GetCameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "cameraInput error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Create PreviewOutput instance api - * @tc.desc : Create PreviewOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - cameraObj.createPreviewOutput(surfaceId, async (err, data) => { - if (!err) { - console.info(TAG + " Entering createPreviewOutput success"); - if (data != null || data != undefined) { - console.info(TAG + " Entering createPreviewOutput data is not null || undefined"); - previewOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED" + previewOutputAsync); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 to operate"); - previewOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 - * @tc.name : Create CaptureSession instance api - * @tc.desc : Create CaptureSession instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 to operate"); - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - captureSession = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 - * @tc.name : Add Input with camera1Input api - * @tc.desc : Add Input with camera1Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 to operate"); - captureSession.addInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - photoOutputAsync.setMirror(false, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - captureSession.removeInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 to operate"); - captureSession.addInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputAsync.on("frameStart", async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputAsync.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 to operate"); - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 PASSED"); - } - else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings2 api - * @tc.desc : Photo output capture with photosettings2 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - photoOutputAsync.capture(photosettings3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings3 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - photoOutputAsync.capture(photosettings4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings4 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - camera0Input.getFocalLength(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_POINT to operate"); - camera0Input.setFocusPoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SET_FOCUS_POINT PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_POINT to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_POINT PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); - console.info(TAG + "GET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 to operate"); - camera0Input.setFocusPoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 to operate"); - camera0Input.setFocusPoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : GET_FOCUS_POINT_focus mode auto - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 -4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - camera0Input.setExposurePoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 mode auto - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 mode auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - camera0Input.setExposurePoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 mode continuous auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - camera0Input.setExposurePoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 -5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - camera0Input.setExposureBias(-5, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 6 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - camera0Input.setExposureBias(6, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 to operate"); - captureSession.stop(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.stop data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 to operate"); - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 previewOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 to operate"); - previewOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutputAsync.release success"); - console.info(TAG + "Entering previewOutputAsync.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets deleted file mode 100644 index c14442e53bbb82953bb57518e61b1a76791d112c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ /dev/null @@ -1,3283 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0InputPromise; -var cameraManagerPromise; -var previewOutputPromise; -var photoOutputPromise; -var CaptureSessionPromise; -var surfaceId1; -var camerasArrayPromise -var camera1InputPromise; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoPromise', function () { - console.info(TAG + '----------CameraJsUnitPhotoPromise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-PhotoMode-Promise-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - camerasArrayPromise = await cameraManagerPromise.getCameras(); - console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering Get Cameras success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering Get Cameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering Get Cameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering Get Cameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); - console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200--------------"); - camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); - console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during camera0InputPromise with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PreviewOutput instance promise api - * @tc.desc : Create PreviewOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId); - console.info(TAG + " Entering createPreviewOutput success"); - if (previewOutputPromise != null || previewOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering createPreviewOutput PASSED: " + JSON.stringify(previewOutputPromise)); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create CaptureSession instance promise api - * @tc.desc : Create Capturesession instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); - CaptureSessionPromise = await cameraObj.createCaptureSession(null); - console.info(TAG + "Entering createCaptureSession success"); - if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - CaptureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering Remove preview Output success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - await photoOutputPromise.setMirror(true).then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - await photoOutputPromise.setMirror(false) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); - } - console.info(TAG + "Entering beginConfig ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - // callback related API - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED :" + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 to operate"); - await CaptureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - await photoOutputPromise.capture(photosettings3) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 :" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - await photoOutputPromise.capture(photosettings4) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - await sleep(1000) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); - if (data == 2) { - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - }) - .catch((err) => { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100-4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with location settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400-5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - await camera0InputPromise.setExposureBias(-5) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - await camera0InputPromise.setExposureBias(6) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 ends here"); - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session stop captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.stop(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session release captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PhotoOutput release api - * @tc.desc : PhotoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await photoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - }); -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets deleted file mode 100644 index aa4466c90fbcc0482aff18bd91e25e3ae39d7b27..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ /dev/null @@ -1,3367 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera' -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = 'CameraModuleTest: ' -var cameraManagerPromise -var camerasArrayPromise -var camera0InputPromise -var previewOutputPromise -var videoRecorder -var photoOutputPromise -let fdPath; -let fileAsset; -let fdNumber; - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -var photosettings5 = { - rotation: 270, -} -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/01.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var surfaceId1 -var videoId -var videoOutputPromise -var captureSessionPromise - -export default function cameraJSUnitVideoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('01.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModePromise', function () { - console.info(TAG + '----------Camera-VideoMode-Promise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------') - cameraManagerPromise = await cameraObj.getCameraManager(null) - console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - await sleep(1) - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------') - camerasArrayPromise = await cameraManagerPromise.getCameras() - console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + 'Entering Get Cameras Promise success') - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArrayPromise[i].cameraPosition - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArrayPromise[i].cameraType - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------') - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) - console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 - * @tc.name : Create previewoutput promise api - * @tc.desc : Create previewoutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100--------------') - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) - console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) - if (previewOutputPromise != null && previewOutputPromise != undefined) { - console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') - expect(true).assertTrue(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is : " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : PreviewOutput callback onerror async api - * @tc.desc : PreviewOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 - * @tc.name : Create videooutput promise api - * @tc.desc : Create videooutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 to operate') - await getvideosurface() - await sleep(2) - videoOutputPromise = await cameraObj.createVideoOutput(videoId) - console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) - if (videoOutputPromise != null && videoOutputPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + 'VideoOutput Errorcallback is success') - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create capturesession promise api - * @tc.desc : Create capturesession promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate') - captureSessionPromise = await cameraObj.createCaptureSession(null) - console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) - if (captureSessionPromise != null && captureSessionPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback onerror async api - * @tc.desc : CaptureSession callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - captureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Create captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add video output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering Add video output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 to operate"); - await videoOutputPromise.getFrameRateRange() - .then(function (data) { - console.info(TAG + "Entering get frame rate range SUCCESS "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 PASSED : " + JSON.stringify(data)) - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLow promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 - * @tc.name : getVideoStabilizationModeMIDDLE - * @tc.desc : getVideoStabilizationModeMIDDLE promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.commitConfig(); - console.info(TAG + "Entering commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig PASSED"); - } - else { - expect().assertFail() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig ends here"); - } - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : PreviewOutput callback onframeend async api - * @tc.desc : PreviewOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStop frameEnd Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "Video frameStart Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success') - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message) - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 to operate"); - await captureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 to operate"); - await photoOutputPromise.setMirror(true) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 ends here"); - await sleep(1) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering get focus mode auto SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100_exposure mode locked - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 mode locked - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 mode locked - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 mode auto - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 mode continuous auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 - * @tc.name : VideoOutput start promise api - * @tc.desc : VideoOutput start promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 to operate') - await videoOutputPromise.start() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 - * @tc.name : VideoOutput stop promise api - * @tc.desc : VideoOutput stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 to operate') - await videoOutputPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 - * @tc.name : CaptureSession stop promise api - * @tc.desc : CaptureSession stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 to operate') - await captureSessionPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 - * @tc.name : CaptureSession release promise api - * @tc.desc : CaptureSession release promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 to operate') - await captureSessionPromise.release() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : videoOutput release api - * @tc.desc : videoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await videoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/element/string.json b/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/element/string.json deleted file mode 100644 index b93f540e29265a34f883a977c442fa85349b94ca..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/media/icon.png b/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/camera/cameraLongFocus/BUILD.gn b/multimedia/camera/cameraLongFocus/BUILD.gn deleted file mode 100644 index 2ddd840f3d0a8f0db5fc8867e4b4ffe35ac1bbfe..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("camera_longfocus_ets_hap") { - hap_profile = "./src/main/config.json" - deps = [ - ":camera_ets_assets", - ":camera_ets_resources", - ] - ets2abc = true - - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsCameraLongFocusETSTest" - subsystem_name = "multimedia" - part_name = "multimedia_camera_framework" -} -ohos_js_assets("camera_ets_assets") { - source_dir = "./src/main/ets/MainAbility" -} -ohos_resources("camera_ets_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/camera/cameraLongFocus/Test.json b/multimedia/camera/cameraLongFocus/Test.json deleted file mode 100644 index 096aad2898d094c26b18d14006473ca8996e6921..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/Test.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "Configuration for camerastandard LongFocus Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "1000000", - "package": "com.open.harmony.multimedia.cameralftest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "touch /data/media/01.mp4", - "chmod -R 777 /data/media" - - ], - "teardown-command":[ - - ] - }, - { - "test-file-name": [ - "ActsCameraLongFocusETSTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/signature/openharmony_sx.p7b b/multimedia/camera/cameraLongFocus/signature/openharmony_sx.p7b deleted file mode 100644 index 0625db92101ca16c7becfaf2d4008ea2e96078e1..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraLongFocus/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/app.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/app.ets deleted file mode 100644 index a9f8218978fad817d4519aa1b715da0e3f8ebbfc..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/pages/index.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index ca96b03e80e49976adf3f876fadb4d82d574c6ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend} from "deccjsunit/index" -import cameraKit from "../test/Camera.test" -import featureAbility from "@ohos.ability.featureAbility" - -let TAG = 'CameraModuleTest: ' -var mXComponentController: XComponentController = new XComponentController() -var surfaceId: any - -@Entry -@Component -struct CameraIndex { - @State isShowSettings: boolean = false - @State previewSize: string = '75%' - - aboutToAppear() { - console.info('--------------aboutToAppear--------------') - } - - build() { - Flex() { - XComponent({ - id: '', - type: 'surface', - libraryname: '', - controller: mXComponentController - }) - .onLoad(() => { - console.info('CameraModuleTest: OnLoad() is called!') - mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 }); - surfaceId = mXComponentController.getXComponentSurfaceId() - console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + surfaceId) - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - console.info(TAG + 'Entering expectExtend') - core.addService('expect', expectExtend) - console.info(TAG + 'Entering addService') - core.init() - console.info(TAG + 'Entering core.init()') - console.info(TAG + 'Entering subscribeEvent') - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - console.info(TAG + 'Entering configService') - cameraKit(surfaceId) - core.execute() - console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error)); - }) - }) - .width('1920px') - .height('1080px') - } - } -} diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/Camera.test.ets deleted file mode 100644 index 2743a3a6f94f359e98785fa0a21bf1518e7a9859..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/Camera.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraJSUnitEnum from './CameraJSUnitEnum.test.ets' -import cameraJSUnitCameraFormat from './CameraJSUnitCameraFormat.test.ets' -import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' -import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' -import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' -import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' - -let TAG = 'CameraModuleTest: ' - -export default function cameraKit(surfaceId: any) { - console.info(TAG + 'Entering cameraKit') - console.info(TAG + 'surfaceId: ' + surfaceId) - - cameraJSUnitEnum(surfaceId) - cameraJSUnitCameraFormat(surfaceId) - cameraJSUnitPhotoAsync(surfaceId) - cameraJSUnitPhotoPromise(surfaceId) - cameraJSUnitVideoAsync(surfaceId) - cameraJSUnitVideoPromise(surfaceId) -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets deleted file mode 100644 index 5986ddb31181d4715851f02c0487eddfbb306e1b..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ /dev/null @@ -1,2778 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitCameraFormat(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitCameraFormat', function () { - console.info(TAG + '----------CameraJsUnitCameraFormat--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 PASSED"); - } - } 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_CAMERA_MANAGER_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - var cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - var camerasArrayPromise = await cameraManager.getCameras(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 - * @tc.name : get camera if from camera-0 input async api - * @tc.desc : get camera if from camera-0 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100', 0, async function (done) { - camera0Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 data is not null || undefined"); - var CameraId0 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 PASSED with CameraID :" + CameraId0); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 - * @tc.name : get camera if from camera-0 input promise api - * @tc.desc : get camera if from camera-0 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100', 0, async function (done) { - var camera0IdPromise = await camera0InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); - if (camera0IdPromise != null && camera0IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 PASSED" + camera0IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-0 camerainput async api - * @tc.desc : Get supported video formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 - * @tc.name : Get supported video formats from camera-0 camerainput promise api - * @tc.desc : Get supported video formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on("focusStateChange", async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CAMERA-1 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-1 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera1InputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 - * @tc.name : get camera ID from camera-1 input async api - * @tc.desc : get camera ID from camera-1 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - camera1Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - var CameraId1 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 PASSED with CameraID : " + CameraId1); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 - * @tc.name : get camera ID from camera-1 input promise api - * @tc.desc : get camera ID from camera-1 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100', 0, async function (done) { - var camera1IdPromise = await camera1InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise: " + JSON.stringify(camera1IdPromise)); - if (camera1IdPromise != null && camera1IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 PASSED" + camera1IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-1 camerainput async api - * @tc.desc : Get supported video formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 - * @tc.name : Get supported video formats from camera-1 camerainput promise api - * @tc.desc : Get supported video formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-2 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraId async api - * @tc.desc : Create camerainput from camera-2 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-2 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera2Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[2].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraId promise api - * @tc.desc : Create camerainput from camera-2 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera2InputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise: " + JSON.stringify(camera2InputPromise)); - if (camera2InputPromise != null && camera2InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 - * @tc.name : get camera ID from camera-2 input async api - * @tc.desc : get camera ID from camera-2 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - camera2Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - var CameraId2 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 PASSED with CameraID : " + CameraId2); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 - * @tc.name : get camera ID from camera-2 input promise api - * @tc.desc : get camera ID from camera-2 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100', 0, async function (done) { - var camera2IdPromise = await camera2InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise: " + JSON.stringify(camera2IdPromise)); - if (camera2IdPromise != null && camera2IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 PASSED" + camera2IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-2 camerainput async api - * @tc.desc : Get supported video formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 - * @tc.name : Get supported video formats from camera-2 camerainput promise api - * @tc.desc : Get supported video formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-3 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraId async api - * @tc.desc : Create camerainput from camera-3 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-3 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera3Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[3].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraId promise api - * @tc.desc : Create camerainput from camera-3 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera3InputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise: " + JSON.stringify(camera3InputPromise)); - if (camera3InputPromise != null && camera3InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 - * @tc.name : get camera ID from camera-3 input async api - * @tc.desc : get camera ID from camera-3 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - camera3Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - var CameraId3 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 PASSED with CameraID : " + CameraId3); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 - * @tc.name : get camera ID from camera-3 input promise api - * @tc.desc : get camera ID from camera-3 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100', 0, async function (done) { - var camera3IdPromise = await camera3InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise: " + JSON.stringify(camera3IdPromise)); - if (camera3IdPromise != null && camera3IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 PASSED" + camera3IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-3 camerainput async api - * @tc.desc : Get supported video formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 - * @tc.name : Get supported video formats from camera-3 camerainput promise api - * @tc.desc : Get supported video formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE TELEPHOTO*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype telephoto async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype telephoto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype telephoto promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype telephoto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE TELEPHOTO*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype telephoto async api - * @tc.desc : Create camerainput from cameraposition back & cameratype telephoto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype telephoto promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype telephoto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE TELEPHOTO*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype telephoto async api - * @tc.desc : Create camerainput from cameraposition front & cameratype telephoto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 FAILED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype telephoto promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype telephoto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets deleted file mode 100644 index 54de11efdc95e7ad97d972b4081928b1e224b8ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitEnum(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJSUnitEnum', function () { - console.info(TAG + '----------CameraJSUnitEnum--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100 - * @tc.name : camera status ENAME - * @tc.desc : camera status ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100------------"); - console.info(TAG + "CameraStatus CAMERA_STATUS_APPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_APPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_APPEAR).assertEqual(0); - console.info(TAG + "CameraStatus CAMERA_STATUS_DISAPPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR).assertEqual(1); - console.info(TAG + "CameraStatus CAMERA_STATUS_AVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE).assertEqual(2); - console.info(TAG + "CameraStatus CAMERA_STATUS_UNAVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100 - * @tc.name : Camera position ENAME - * @tc.desc : Camera position ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100------------") - console.info(TAG + "CameraPosition CAMERA_POSITION_BACK : " + cameraObj.CameraPosition.CAMERA_POSITION_BACK); - expect(cameraObj.CameraPosition.CAMERA_POSITION_BACK).assertEqual(1); - console.info(TAG + "CameraPosition CAMERA_POSITION_FRONT : " + cameraObj.CameraPosition.CAMERA_POSITION_FRONT); - expect(cameraObj.CameraPosition.CAMERA_POSITION_FRONT).assertEqual(2); - console.info(TAG + "CameraPosition CAMERA_POSITION_UNSPECIFIED : " + cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED); - expect(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED).assertEqual(0); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100 - * @tc.name : camera type ENAME - * @tc.desc : camera type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100------------") - console.info(TAG + "CameraType CAMERA_TYPE_UNSPECIFIED : " + cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - expect(cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED).assertEqual(0); - console.info(TAG + "CameraType CAMERA_TYPE_WIDE_ANGLE : " + cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE); - expect(cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE).assertEqual(1); - console.info(TAG + 'CameraType CAMERA_TYPE_ULTRA_WIDE : ' + cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE); - expect(cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE).assertEqual(2); - console.info(TAG + 'CameraType CAMERA_TYPE_TELEPHOTO : ' + cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO); - expect(cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO).assertEqual(3); - console.info(TAG + 'CameraType CAMERA_TYPE_TRUE_DEPTH : ' + cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - expect(cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH).assertEqual(4); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100 - * @tc.name : connection type ENAME - * @tc.desc : connection type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100------------") - console.info(TAG + "ConnectionType CAMERA_CONNECTION_BUILT_IN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN).assertEqual(0); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_USB_PLUGIN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN).assertEqual(1); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_REMOTE : " + cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100 - * @tc.name : Flash Mode ENAME - * @tc.desc : Flash Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100------------") - console.info(TAG + "FlashMode FLASH_MODE_CLOSE : " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - console.info(TAG + "FlashMode FLASH_MODE_OPEN : " + cameraObj.FlashMode.FLASH_MODE_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - console.info(TAG + "FlashMode FLASH_MODE_AUTO : " + cameraObj.FlashMode.FLASH_MODE_AUTO); - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - console.info(TAG + "FlashMode FLASH_MODE_ALWAYS_OPEN : " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100 - * @tc.name : Focus Mode ENAME - * @tc.desc : Focus Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100------------") - console.info(TAG + "FocusMode FOCUS_MODE_MANUAL : " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0); - console.info(TAG + "FocusMode FOCUS_MODE_CONTINUOUS_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "FocusMode FOCUS_MODE_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "FocusMode FOCUS_MODE_LOCKED : " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100 - * @tc.name : Focus State ENAME - * @tc.desc : Focus State ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100------------") - console.info(TAG + "FocusState FOCUS_STATE_SCAN : " + cameraObj.FocusState.FOCUS_STATE_SCAN); - expect(cameraObj.FocusState.FOCUS_STATE_SCAN).assertEqual(0); - console.info(TAG + "FocusState FOCUS_STATE_FOCUSED : " + cameraObj.FocusState.FOCUS_STATE_FOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_FOCUSED).assertEqual(1); - console.info(TAG + "FocusState FOCUS_STATE_UNFOCUSED : " + cameraObj.FocusState.FOCUS_STATE_UNFOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_UNFOCUSED).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100 - * @tc.name : Image Rotation ENAME - * @tc.desc : Image Rotation ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100------------") - console.info(TAG + "ImageRotation ROTATION_0 : " + cameraObj.ImageRotation.ROTATION_0); - expect(cameraObj.ImageRotation.ROTATION_0).assertEqual(0); - console.info(TAG + "ImageRotation ROTATION_90 : " + cameraObj.ImageRotation.ROTATION_90); - expect(cameraObj.ImageRotation.ROTATION_90).assertEqual(90); - console.info(TAG + "ImageRotation ROTATION_180 : " + cameraObj.ImageRotation.ROTATION_180); - expect(cameraObj.ImageRotation.ROTATION_180).assertEqual(180); - console.info(TAG + "ImageRotation ROTATION_270 : " + cameraObj.ImageRotation.ROTATION_270); - expect(cameraObj.ImageRotation.ROTATION_270).assertEqual(270); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100 - * @tc.name : Quality Level ENAME - * @tc.desc : Quality Level ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100------------") - console.info(TAG + "QualityLevel QUALITY_LEVEL_HIGH : " + cameraObj.QualityLevel.QUALITY_LEVEL_HIGH); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_HIGH).assertEqual(0); - console.info(TAG + "QualityLevel QUALITY_LEVEL_MEDIUM : " + cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM).assertEqual(1); - console.info(TAG + "QualityLevel QUALITY_LEVEL_LOW : " + cameraObj.QualityLevel.QUALITY_LEVEL_LOW); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_LOW).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 - * @tc.name : CameraInputErrorCode ENAME - * @tc.desc : CameraInputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 : " + cameraObj.CameraInputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CameraInputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 - * @tc.name : CaptureSessionErrorCode ENAME - * @tc.desc : CaptureSessionErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 : " + cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 - * @tc.name : PreviewOutputErrorCode ENAME - * @tc.desc : PreviewOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 : " + cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 - * @tc.name : PhotoOutputErrorCode ENAME - * @tc.desc : PhotoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 : " + cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 - * @tc.name : VideoOutputErrorCode ENAME - * @tc.desc : VideoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 : " + cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets deleted file mode 100644 index 3b990e106f896ed54704bdb813583aa6c359e1fb..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ /dev/null @@ -1,3606 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0Input; -var camera1Input; -var cameraManager; -var previewOutputAsync; -var photoOutputAsync; -var captureSession; -var surfaceId1; -var camerasArray; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoAsync', function () { - console.info(TAG + '----------CameraJsUnitPhotoAsync--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-Precision Control-Async-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Camera Manager success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering Camera Manager data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GetCameras success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering GetCameras data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GetCameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GetCameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GetCameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "cameraInput error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Create PreviewOutput instance api - * @tc.desc : Create PreviewOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - cameraObj.createPreviewOutput(surfaceId, async (err, data) => { - if (!err) { - console.info(TAG + " Entering createPreviewOutput success"); - if (data != null || data != undefined) { - console.info(TAG + " Entering createPreviewOutput data is not null || undefined"); - previewOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED" + previewOutputAsync); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 to operate"); - previewOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 - * @tc.name : Create CaptureSession instance api - * @tc.desc : Create CaptureSession instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 to operate"); - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - captureSession = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 - * @tc.name : Add Input with camera1Input api - * @tc.desc : Add Input with camera1Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 to operate"); - captureSession.addInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - photoOutputAsync.setMirror(false, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - captureSession.removeInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 to operate"); - captureSession.addInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputAsync.on("frameStart", async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputAsync.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 to operate"); - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 PASSED"); - } - else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings2 api - * @tc.desc : Photo output capture with photosettings2 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - photoOutputAsync.capture(photosettings3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings3 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - photoOutputAsync.capture(photosettings4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings4 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - camera0Input.getFocalLength(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_POINT to operate"); - camera0Input.setFocusPoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SET_FOCUS_POINT PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_POINT to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_POINT PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); - console.info(TAG + "GET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 to operate"); - camera0Input.setFocusPoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 to operate"); - camera0Input.setFocusPoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : GET_FOCUS_POINT_focus mode auto - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 -4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - camera0Input.setExposurePoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 mode auto - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 mode auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - camera0Input.setExposurePoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 mode continuous auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - camera0Input.setExposurePoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 -5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - camera0Input.setExposureBias(-5, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 6 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - camera0Input.setExposureBias(6, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 to operate"); - captureSession.stop(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.stop data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 to operate"); - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 previewOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 to operate"); - previewOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutputAsync.release success"); - console.info(TAG + "Entering previewOutputAsync.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets deleted file mode 100644 index c14442e53bbb82953bb57518e61b1a76791d112c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ /dev/null @@ -1,3283 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0InputPromise; -var cameraManagerPromise; -var previewOutputPromise; -var photoOutputPromise; -var CaptureSessionPromise; -var surfaceId1; -var camerasArrayPromise -var camera1InputPromise; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoPromise', function () { - console.info(TAG + '----------CameraJsUnitPhotoPromise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-PhotoMode-Promise-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - camerasArrayPromise = await cameraManagerPromise.getCameras(); - console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering Get Cameras success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering Get Cameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering Get Cameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering Get Cameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); - console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200--------------"); - camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); - console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during camera0InputPromise with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PreviewOutput instance promise api - * @tc.desc : Create PreviewOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId); - console.info(TAG + " Entering createPreviewOutput success"); - if (previewOutputPromise != null || previewOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering createPreviewOutput PASSED: " + JSON.stringify(previewOutputPromise)); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create CaptureSession instance promise api - * @tc.desc : Create Capturesession instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); - CaptureSessionPromise = await cameraObj.createCaptureSession(null); - console.info(TAG + "Entering createCaptureSession success"); - if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - CaptureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering Remove preview Output success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - await photoOutputPromise.setMirror(true).then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - await photoOutputPromise.setMirror(false) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); - } - console.info(TAG + "Entering beginConfig ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - // callback related API - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED :" + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 to operate"); - await CaptureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - await photoOutputPromise.capture(photosettings3) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 :" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - await photoOutputPromise.capture(photosettings4) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - await sleep(1000) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); - if (data == 2) { - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - }) - .catch((err) => { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100-4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with location settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400-5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - await camera0InputPromise.setExposureBias(-5) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - await camera0InputPromise.setExposureBias(6) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 ends here"); - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session stop captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.stop(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session release captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PhotoOutput release api - * @tc.desc : PhotoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await photoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - }); -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets deleted file mode 100644 index 571ca690ff89ac2fbd3becb18f81fc97bc447bf8..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ /dev/null @@ -1,3800 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = "CameraModuleTest: "; -var cameraManager -var camerasArray -var camera0Input -var previewOutput -var photoOutputAsync -var videoRecorder -var surfaceId1 - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point = { x: 1, y: 1 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -let fdPath; -let fileAsset; -let fdNumber; -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/02.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var videoId -var videoOutput -var captureSession - -export default function cameraJSUnitVideoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('02.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModeAsync', function () { - console.info(TAG + '----------Camera-VideoMode-Async--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------') - await sleep(1) - cameraObj.getCameraManager(null, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Camera manager success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') - cameraManager = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------') - await sleep(1) - cameraManager.getCameras((err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Cameras success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Cameras data is not null || undefined') - camerasArray = data - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId - console.info(TAG + 'Entering Get Cameras camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArray[i].cameraPosition - console.info(TAG + 'Entering Get Cameras camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArray[i].cameraType - console.info(TAG + 'Entering Get Cameras camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArray[i].connectionType - console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined') - } - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info('--------------CAMERA-0 STARTS HERE--------------') - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------') - await sleep(1) - cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + 'Entering Create camera input data is not null || undefined') - camera0Input = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :' + camerasArray[0].cameraId) - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0Input error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 - * @tc.name : Create previewoutput async api - * @tc.desc : Create previewoutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createPreviewOutput(surfaceId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create preview output success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create preview output data is not null || undefined') - previewOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - previewOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 - * @tc.name : Create videooutput async api - * @tc.desc : Create videooutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 to operate') - await getvideosurface() - await sleep(2) - cameraObj.createVideoOutput(videoId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create videooutput success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create videooutput data is not null || undefined') - videoOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "VideoOutput Errorcallback is success") - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 - * @tc.name : Create capturesession async api - * @tc.desc : Create capturesession async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create capturesession success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create capturesession data is not null || undefined') - captureSession = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail() - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 - * @tc.name : Begin Config async api - * @tc.desc : Begin Config async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering Begin Config captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.beginConfig((err, data) => { - if (!err) { - console.info(TAG + 'Entering Begin Config success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput preview success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput video success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 ends here') - await sleep(1); - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(previewOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove video Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove video Output FAILED" + err.message); - console.info(TAG + "Entering Remove video Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - //framerate - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 to operate"); - videoOutput.getFrameRateRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get frame rate range success"); - expect(true).assertTrue(); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api_err - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Off success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLOw async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode low success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1) - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeMedium - * @tc.desc : getVideoStabilizationModeMedium async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode medium success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode High success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Auto success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 - * @tc.name : CommitConfig async api - * @tc.desc : CommitConfig async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CommitConfig success') - console.info(TAG + 'Entering CommitConfig data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //callback API - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate"); - previewOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - videoOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success'); - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 - * @tc.name : CaptureSession start async api - * @tc.desc : CaptureSession start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 to operate") - await sleep(1) - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering CaptureSession start success") - expect(true).assertTrue() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 PASSED") - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 ends here"); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100_exposure mode continuous auto - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 - * @tc.name : VideoOutput start async api - * @tc.desc : VideoOutput start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 videoOutput == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 to operate") - await sleep(1) - videoOutput.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 success: " + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 FAILED: " + err.message) - } - }) - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 - * @tc.name : VideoRecorder start async api - * @tc.desc : VideoRecorder start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 to operate') - videoRecorder.start() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 called'); - sleep(3); - console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') - photoOutputAsync.capture(photosettings1) - console.info(TAG + 'Capture during Video - End.') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 - * @tc.name : VideoOutput stop async api - * @tc.desc : VideoOutput stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 to operate') - videoOutput.stop(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 success: ' + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 - * @tc.name : VideoRecorder stop async api - * @tc.desc : VideoRecorder stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 to operate') - videoRecorder.stop() - console.info(TAG + 'VideoRecorder stop stopVideo done.') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 PASSED') - expect(true).assertTrue() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 - * @tc.name : CaptureSession stop async api - * @tc.desc : CaptureSession stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 to operate') - await sleep(1) - captureSession.stop((err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession stop success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 - * @tc.name : CaptureSession release async api - * @tc.desc : CaptureSession release async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 to operate') - await sleep(1) - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession release success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering CaptureSession release data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : videooutput release api - * @tc.desc : videooutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - videoOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering videooutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering videooutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - previewOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering previewOutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutput.release PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering previewOutput.release ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets deleted file mode 100644 index aa4466c90fbcc0482aff18bd91e25e3ae39d7b27..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ /dev/null @@ -1,3367 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera' -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = 'CameraModuleTest: ' -var cameraManagerPromise -var camerasArrayPromise -var camera0InputPromise -var previewOutputPromise -var videoRecorder -var photoOutputPromise -let fdPath; -let fileAsset; -let fdNumber; - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -var photosettings5 = { - rotation: 270, -} -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/01.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var surfaceId1 -var videoId -var videoOutputPromise -var captureSessionPromise - -export default function cameraJSUnitVideoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('01.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModePromise', function () { - console.info(TAG + '----------Camera-VideoMode-Promise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------') - cameraManagerPromise = await cameraObj.getCameraManager(null) - console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - await sleep(1) - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------') - camerasArrayPromise = await cameraManagerPromise.getCameras() - console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + 'Entering Get Cameras Promise success') - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArrayPromise[i].cameraPosition - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArrayPromise[i].cameraType - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------') - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) - console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 - * @tc.name : Create previewoutput promise api - * @tc.desc : Create previewoutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100--------------') - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) - console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) - if (previewOutputPromise != null && previewOutputPromise != undefined) { - console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') - expect(true).assertTrue(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is : " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : PreviewOutput callback onerror async api - * @tc.desc : PreviewOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 - * @tc.name : Create videooutput promise api - * @tc.desc : Create videooutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 to operate') - await getvideosurface() - await sleep(2) - videoOutputPromise = await cameraObj.createVideoOutput(videoId) - console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) - if (videoOutputPromise != null && videoOutputPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + 'VideoOutput Errorcallback is success') - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create capturesession promise api - * @tc.desc : Create capturesession promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate') - captureSessionPromise = await cameraObj.createCaptureSession(null) - console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) - if (captureSessionPromise != null && captureSessionPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback onerror async api - * @tc.desc : CaptureSession callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - captureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Create captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add video output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering Add video output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 to operate"); - await videoOutputPromise.getFrameRateRange() - .then(function (data) { - console.info(TAG + "Entering get frame rate range SUCCESS "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 PASSED : " + JSON.stringify(data)) - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLow promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 - * @tc.name : getVideoStabilizationModeMIDDLE - * @tc.desc : getVideoStabilizationModeMIDDLE promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.commitConfig(); - console.info(TAG + "Entering commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig PASSED"); - } - else { - expect().assertFail() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig ends here"); - } - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : PreviewOutput callback onframeend async api - * @tc.desc : PreviewOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStop frameEnd Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "Video frameStart Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success') - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message) - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 to operate"); - await captureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 to operate"); - await photoOutputPromise.setMirror(true) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 ends here"); - await sleep(1) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering get focus mode auto SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100_exposure mode locked - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 mode locked - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 mode locked - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 mode auto - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 mode continuous auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 - * @tc.name : VideoOutput start promise api - * @tc.desc : VideoOutput start promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 to operate') - await videoOutputPromise.start() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 - * @tc.name : VideoOutput stop promise api - * @tc.desc : VideoOutput stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 to operate') - await videoOutputPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 - * @tc.name : CaptureSession stop promise api - * @tc.desc : CaptureSession stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 to operate') - await captureSessionPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 - * @tc.name : CaptureSession release promise api - * @tc.desc : CaptureSession release promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 to operate') - await captureSessionPromise.release() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : videoOutput release api - * @tc.desc : videoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await videoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/resources/base/element/string.json b/multimedia/camera/cameraLongFocus/src/main/resources/base/element/string.json deleted file mode 100644 index b93f540e29265a34f883a977c442fa85349b94ca..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraLongFocus/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraLongFocus/src/main/resources/base/media/icon.png b/multimedia/camera/cameraLongFocus/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraLongFocus/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/camera/cameraUnspc/signature/openharmony_sx.p7b b/multimedia/camera/cameraUnspc/signature/openharmony_sx.p7b deleted file mode 100644 index 0625db92101ca16c7becfaf2d4008ea2e96078e1..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraUnspc/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/camera/cameraUnspc/src/main/config.json b/multimedia/camera/cameraUnspc/src/main/config.json deleted file mode 100644 index 542cbfcaf4349aa233264b4adfe922fd1fe808a7..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.multimedia.cameraunspctest", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.multimedia.cameraunspctest", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.multimedia.cameraunspctest.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.CAMERA", - "reason": "use ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "use ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason": "use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "use ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "use ohos.permission.WRITE_MEDIA" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/app.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/app.ets deleted file mode 100644 index a9f8218978fad817d4519aa1b715da0e3f8ebbfc..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/pages/index.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index ca96b03e80e49976adf3f876fadb4d82d574c6ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend} from "deccjsunit/index" -import cameraKit from "../test/Camera.test" -import featureAbility from "@ohos.ability.featureAbility" - -let TAG = 'CameraModuleTest: ' -var mXComponentController: XComponentController = new XComponentController() -var surfaceId: any - -@Entry -@Component -struct CameraIndex { - @State isShowSettings: boolean = false - @State previewSize: string = '75%' - - aboutToAppear() { - console.info('--------------aboutToAppear--------------') - } - - build() { - Flex() { - XComponent({ - id: '', - type: 'surface', - libraryname: '', - controller: mXComponentController - }) - .onLoad(() => { - console.info('CameraModuleTest: OnLoad() is called!') - mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 }); - surfaceId = mXComponentController.getXComponentSurfaceId() - console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + surfaceId) - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - console.info(TAG + 'Entering expectExtend') - core.addService('expect', expectExtend) - console.info(TAG + 'Entering addService') - core.init() - console.info(TAG + 'Entering core.init()') - console.info(TAG + 'Entering subscribeEvent') - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - console.info(TAG + 'Entering configService') - cameraKit(surfaceId) - core.execute() - console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error)); - }) - }) - .width('1920px') - .height('1080px') - } - } -} diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/Camera.test.ets deleted file mode 100644 index 2743a3a6f94f359e98785fa0a21bf1518e7a9859..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/Camera.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraJSUnitEnum from './CameraJSUnitEnum.test.ets' -import cameraJSUnitCameraFormat from './CameraJSUnitCameraFormat.test.ets' -import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' -import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' -import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' -import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' - -let TAG = 'CameraModuleTest: ' - -export default function cameraKit(surfaceId: any) { - console.info(TAG + 'Entering cameraKit') - console.info(TAG + 'surfaceId: ' + surfaceId) - - cameraJSUnitEnum(surfaceId) - cameraJSUnitCameraFormat(surfaceId) - cameraJSUnitPhotoAsync(surfaceId) - cameraJSUnitPhotoPromise(surfaceId) - cameraJSUnitVideoAsync(surfaceId) - cameraJSUnitVideoPromise(surfaceId) -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets deleted file mode 100644 index 1d88e45d9ae36d1b43346be7703db2d22ccef9f7..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ /dev/null @@ -1,3783 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitCameraFormat(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitCameraFormat', function () { - console.info(TAG + '----------CameraJsUnitCameraFormat--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 PASSED"); - } - } 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_CAMERA_MANAGER_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - var cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - var camerasArrayPromise = await cameraManager.getCameras(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 - * @tc.name : get camera if from camera-0 input async api - * @tc.desc : get camera if from camera-0 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100', 0, async function (done) { - camera0Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 data is not null || undefined"); - var CameraId0 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 PASSED with CameraID :" + CameraId0); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 - * @tc.name : get camera if from camera-0 input promise api - * @tc.desc : get camera if from camera-0 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100', 0, async function (done) { - var camera0IdPromise = await camera0InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); - if (camera0IdPromise != null && camera0IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 PASSED" + camera0IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-0 camerainput async api - * @tc.desc : Get supported video formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 - * @tc.name : Get supported video formats from camera-0 camerainput promise api - * @tc.desc : Get supported video formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera0InputPosBack = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera0InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera0InputPromisePosBack: " + JSON.stringify(camera0InputPromisePosBack)); - if (camera0InputPromisePosBack != null && camera0InputPromisePosBack != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera0InputPromisePosBack is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera0InputPosFront = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera0InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera0InputPromisePosFront: " + JSON.stringify(camera0InputPromisePosFront)); - if (camera0InputPromisePosFront != null && camera0InputPromisePosFront != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera0InputPromisePosFront is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on("focusStateChange", async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CAMERA-1 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-1 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera1InputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 - * @tc.name : get camera ID from camera-1 input async api - * @tc.desc : get camera ID from camera-1 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - camera1Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - var CameraId1 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 PASSED with CameraID : " + CameraId1); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 - * @tc.name : get camera ID from camera-1 input promise api - * @tc.desc : get camera ID from camera-1 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100', 0, async function (done) { - var camera1IdPromise = await camera1InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise: " + JSON.stringify(camera1IdPromise)); - if (camera1IdPromise != null && camera1IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 PASSED" + camera1IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-1 camerainput async api - * @tc.desc : Get supported video formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 - * @tc.name : Get supported video formats from camera-1 camerainput promise api - * @tc.desc : Get supported video formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition back & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-1 cameraposition back & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera1InputPosBack = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition back & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-1 cameraposition back & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera1InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera1InputPromisePosBack: " + JSON.stringify(camera1InputPromisePosBack)); - if (camera1InputPromisePosBack != null && camera1InputPromisePosBack != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera1InputPromisePosBack is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-1 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera1InputPosFront = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition front & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-1 cameraposition front & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera1InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera1InputPromisePosFront: " + JSON.stringify(camera1InputPromisePosFront)); - if (camera1InputPromisePosFront != null && camera1InputPromisePosFront != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera1InputPromisePosFront is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-2 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraId async api - * @tc.desc : Create camerainput from camera-2 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-2 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera2Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[2].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraId promise api - * @tc.desc : Create camerainput from camera-2 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera2InputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise: " + JSON.stringify(camera2InputPromise)); - if (camera2InputPromise != null && camera2InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 - * @tc.name : get camera ID from camera-2 input async api - * @tc.desc : get camera ID from camera-2 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - camera2Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - var CameraId2 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 PASSED with CameraID : " + CameraId2); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 - * @tc.name : get camera ID from camera-2 input promise api - * @tc.desc : get camera ID from camera-2 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100', 0, async function (done) { - var camera2IdPromise = await camera2InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise: " + JSON.stringify(camera2IdPromise)); - if (camera2IdPromise != null && camera2IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 PASSED" + camera2IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-2 camerainput async api - * @tc.desc : Get supported video formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 - * @tc.name : Get supported video formats from camera-2 camerainput promise api - * @tc.desc : Get supported video formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition back & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-2 cameraposition back & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera2InputPosBack = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition back & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-2 cameraposition back & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera2InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera2InputPromisePosBack: " + JSON.stringify(camera2InputPromisePosBack)); - if (camera2InputPromisePosBack != null && camera2InputPromisePosBack != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera2InputPromisePosBack is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-2 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera2InputPosFront = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition front & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-2 cameraposition front & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera2InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera2InputPromisePosFront: " + JSON.stringify(camera2InputPromisePosFront)); - if (camera2InputPromisePosFront != null && camera2InputPromisePosFront != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera2InputPromisePosFront is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-3 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraId async api - * @tc.desc : Create camerainput from camera-3 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-3 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera3Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[3].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraId promise api - * @tc.desc : Create camerainput from camera-3 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera3InputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise: " + JSON.stringify(camera3InputPromise)); - if (camera3InputPromise != null && camera3InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 - * @tc.name : get camera ID from camera-3 input async api - * @tc.desc : get camera ID from camera-3 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - camera3Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - var CameraId3 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 PASSED with CameraID : " + CameraId3); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 - * @tc.name : get camera ID from camera-3 input promise api - * @tc.desc : get camera ID from camera-3 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100', 0, async function (done) { - var camera3IdPromise = await camera3InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise: " + JSON.stringify(camera3IdPromise)); - if (camera3IdPromise != null && camera3IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 PASSED" + camera3IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-3 camerainput async api - * @tc.desc : Get supported video formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 - * @tc.name : Get supported video formats from camera-3 camerainput promise api - * @tc.desc : Get supported video formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition back & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-3 cameraposition back & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera3InputPosBack = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition back & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-3 cameraposition back & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera3InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera3InputPromisePosBack: " + JSON.stringify(camera3InputPromisePosBack)); - if (camera3InputPromisePosBack != null && camera3InputPromisePosBack != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 camera3InputPromisePosBack is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition front & cameratype unspecified async api - * @tc.desc : Create camerainput from camera-3 cameraposition front & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 data is not null || undefined"); - camera3InputPosFront = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition front & cameratype unspecified promise api - * @tc.desc : Create camerainput from camera-3 cameraposition front & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - camera3InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera3InputPromisePosFront: " + JSON.stringify(camera3InputPromisePosFront)); - if (camera3InputPromisePosFront != null && camera3InputPromisePosFront != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 camera3InputPromisePosFront is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE UNSPECIFIED*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype unspecified async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype unspecified async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100 success: "); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype unspecified promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype unspecified promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED) - .then(function () { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_0100 camInputPromise: "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_0100 FAILED"); - }) - .catch((err) => { - console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC PASSED : " + err.message); - expect(true).assertTrue(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 FAILED"); - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE ULTRA ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype ultra wide async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype ultra wide async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype ultra wide promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype ultra wide promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) - .then(function () { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 FAILED"); - expect().assertFail(); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE TELEPHOTO*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype telephoto async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype telephoto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype telephoto promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype telephoto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE TRUE DEAPTH*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype true deapth async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype true deapth async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype true deapth promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype true deapth promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition back & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE ULTRA ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype ultra wide async api - * @tc.desc : Create camerainput from cameraposition back & cameratype ultra wide async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype ultra wide promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype ultra wide promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE TELEPHOTO*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype telephoto async api - * @tc.desc : Create camerainput from cameraposition back & cameratype telephoto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype telephoto promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype telephoto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE TRUE DEAPTH*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype true deapth async api - * @tc.desc : Create camerainput from cameraposition back & cameratype true deapth async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype true deapth promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype true deapth promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE ULTRA ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype ultra wide async api - * @tc.desc : Create camerainput from cameraposition front & cameratype ultra wide async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype ultra wide promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype ultra wide promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE TELEPHOTO*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype telephoto async api - * @tc.desc : Create camerainput from cameraposition front & cameratype telephoto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 FAILED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype telephoto promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype telephoto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE TRUE DEAPTH*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype true deapth async api - * @tc.desc : Create camerainput from cameraposition front & cameratype true deapth async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype true deapth promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype true deapth promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets deleted file mode 100644 index 54de11efdc95e7ad97d972b4081928b1e224b8ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitEnum(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJSUnitEnum', function () { - console.info(TAG + '----------CameraJSUnitEnum--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100 - * @tc.name : camera status ENAME - * @tc.desc : camera status ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100------------"); - console.info(TAG + "CameraStatus CAMERA_STATUS_APPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_APPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_APPEAR).assertEqual(0); - console.info(TAG + "CameraStatus CAMERA_STATUS_DISAPPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR).assertEqual(1); - console.info(TAG + "CameraStatus CAMERA_STATUS_AVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE).assertEqual(2); - console.info(TAG + "CameraStatus CAMERA_STATUS_UNAVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100 - * @tc.name : Camera position ENAME - * @tc.desc : Camera position ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100------------") - console.info(TAG + "CameraPosition CAMERA_POSITION_BACK : " + cameraObj.CameraPosition.CAMERA_POSITION_BACK); - expect(cameraObj.CameraPosition.CAMERA_POSITION_BACK).assertEqual(1); - console.info(TAG + "CameraPosition CAMERA_POSITION_FRONT : " + cameraObj.CameraPosition.CAMERA_POSITION_FRONT); - expect(cameraObj.CameraPosition.CAMERA_POSITION_FRONT).assertEqual(2); - console.info(TAG + "CameraPosition CAMERA_POSITION_UNSPECIFIED : " + cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED); - expect(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED).assertEqual(0); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100 - * @tc.name : camera type ENAME - * @tc.desc : camera type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100------------") - console.info(TAG + "CameraType CAMERA_TYPE_UNSPECIFIED : " + cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - expect(cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED).assertEqual(0); - console.info(TAG + "CameraType CAMERA_TYPE_WIDE_ANGLE : " + cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE); - expect(cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE).assertEqual(1); - console.info(TAG + 'CameraType CAMERA_TYPE_ULTRA_WIDE : ' + cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE); - expect(cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE).assertEqual(2); - console.info(TAG + 'CameraType CAMERA_TYPE_TELEPHOTO : ' + cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO); - expect(cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO).assertEqual(3); - console.info(TAG + 'CameraType CAMERA_TYPE_TRUE_DEPTH : ' + cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - expect(cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH).assertEqual(4); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100 - * @tc.name : connection type ENAME - * @tc.desc : connection type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100------------") - console.info(TAG + "ConnectionType CAMERA_CONNECTION_BUILT_IN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN).assertEqual(0); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_USB_PLUGIN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN).assertEqual(1); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_REMOTE : " + cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100 - * @tc.name : Flash Mode ENAME - * @tc.desc : Flash Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100------------") - console.info(TAG + "FlashMode FLASH_MODE_CLOSE : " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - console.info(TAG + "FlashMode FLASH_MODE_OPEN : " + cameraObj.FlashMode.FLASH_MODE_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - console.info(TAG + "FlashMode FLASH_MODE_AUTO : " + cameraObj.FlashMode.FLASH_MODE_AUTO); - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - console.info(TAG + "FlashMode FLASH_MODE_ALWAYS_OPEN : " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100 - * @tc.name : Focus Mode ENAME - * @tc.desc : Focus Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100------------") - console.info(TAG + "FocusMode FOCUS_MODE_MANUAL : " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0); - console.info(TAG + "FocusMode FOCUS_MODE_CONTINUOUS_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "FocusMode FOCUS_MODE_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "FocusMode FOCUS_MODE_LOCKED : " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100 - * @tc.name : Focus State ENAME - * @tc.desc : Focus State ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100------------") - console.info(TAG + "FocusState FOCUS_STATE_SCAN : " + cameraObj.FocusState.FOCUS_STATE_SCAN); - expect(cameraObj.FocusState.FOCUS_STATE_SCAN).assertEqual(0); - console.info(TAG + "FocusState FOCUS_STATE_FOCUSED : " + cameraObj.FocusState.FOCUS_STATE_FOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_FOCUSED).assertEqual(1); - console.info(TAG + "FocusState FOCUS_STATE_UNFOCUSED : " + cameraObj.FocusState.FOCUS_STATE_UNFOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_UNFOCUSED).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100 - * @tc.name : Image Rotation ENAME - * @tc.desc : Image Rotation ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100------------") - console.info(TAG + "ImageRotation ROTATION_0 : " + cameraObj.ImageRotation.ROTATION_0); - expect(cameraObj.ImageRotation.ROTATION_0).assertEqual(0); - console.info(TAG + "ImageRotation ROTATION_90 : " + cameraObj.ImageRotation.ROTATION_90); - expect(cameraObj.ImageRotation.ROTATION_90).assertEqual(90); - console.info(TAG + "ImageRotation ROTATION_180 : " + cameraObj.ImageRotation.ROTATION_180); - expect(cameraObj.ImageRotation.ROTATION_180).assertEqual(180); - console.info(TAG + "ImageRotation ROTATION_270 : " + cameraObj.ImageRotation.ROTATION_270); - expect(cameraObj.ImageRotation.ROTATION_270).assertEqual(270); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100 - * @tc.name : Quality Level ENAME - * @tc.desc : Quality Level ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100------------") - console.info(TAG + "QualityLevel QUALITY_LEVEL_HIGH : " + cameraObj.QualityLevel.QUALITY_LEVEL_HIGH); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_HIGH).assertEqual(0); - console.info(TAG + "QualityLevel QUALITY_LEVEL_MEDIUM : " + cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM).assertEqual(1); - console.info(TAG + "QualityLevel QUALITY_LEVEL_LOW : " + cameraObj.QualityLevel.QUALITY_LEVEL_LOW); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_LOW).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 - * @tc.name : CameraInputErrorCode ENAME - * @tc.desc : CameraInputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 : " + cameraObj.CameraInputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CameraInputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 - * @tc.name : CaptureSessionErrorCode ENAME - * @tc.desc : CaptureSessionErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 : " + cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 - * @tc.name : PreviewOutputErrorCode ENAME - * @tc.desc : PreviewOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 : " + cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 - * @tc.name : PhotoOutputErrorCode ENAME - * @tc.desc : PhotoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 : " + cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 - * @tc.name : VideoOutputErrorCode ENAME - * @tc.desc : VideoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 : " + cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets deleted file mode 100644 index 3b990e106f896ed54704bdb813583aa6c359e1fb..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ /dev/null @@ -1,3606 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0Input; -var camera1Input; -var cameraManager; -var previewOutputAsync; -var photoOutputAsync; -var captureSession; -var surfaceId1; -var camerasArray; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoAsync', function () { - console.info(TAG + '----------CameraJsUnitPhotoAsync--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-Precision Control-Async-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Camera Manager success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering Camera Manager data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GetCameras success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering GetCameras data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GetCameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GetCameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GetCameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "cameraInput error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Create PreviewOutput instance api - * @tc.desc : Create PreviewOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - cameraObj.createPreviewOutput(surfaceId, async (err, data) => { - if (!err) { - console.info(TAG + " Entering createPreviewOutput success"); - if (data != null || data != undefined) { - console.info(TAG + " Entering createPreviewOutput data is not null || undefined"); - previewOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED" + previewOutputAsync); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 to operate"); - previewOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 - * @tc.name : Create CaptureSession instance api - * @tc.desc : Create CaptureSession instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 to operate"); - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - captureSession = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 - * @tc.name : Add Input with camera1Input api - * @tc.desc : Add Input with camera1Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 to operate"); - captureSession.addInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - photoOutputAsync.setMirror(false, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - captureSession.removeInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 to operate"); - captureSession.addInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputAsync.on("frameStart", async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputAsync.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 to operate"); - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 PASSED"); - } - else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings2 api - * @tc.desc : Photo output capture with photosettings2 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - photoOutputAsync.capture(photosettings3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings3 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - photoOutputAsync.capture(photosettings4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings4 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - camera0Input.getFocalLength(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_POINT to operate"); - camera0Input.setFocusPoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SET_FOCUS_POINT PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_POINT to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_POINT PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); - console.info(TAG + "GET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 to operate"); - camera0Input.setFocusPoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 to operate"); - camera0Input.setFocusPoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : GET_FOCUS_POINT_focus mode auto - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 -4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - camera0Input.setExposurePoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 mode auto - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 mode auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - camera0Input.setExposurePoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 mode continuous auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - camera0Input.setExposurePoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 -5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - camera0Input.setExposureBias(-5, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 6 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - camera0Input.setExposureBias(6, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 to operate"); - captureSession.stop(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.stop data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 to operate"); - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 previewOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 to operate"); - previewOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutputAsync.release success"); - console.info(TAG + "Entering previewOutputAsync.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets deleted file mode 100644 index c14442e53bbb82953bb57518e61b1a76791d112c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ /dev/null @@ -1,3283 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0InputPromise; -var cameraManagerPromise; -var previewOutputPromise; -var photoOutputPromise; -var CaptureSessionPromise; -var surfaceId1; -var camerasArrayPromise -var camera1InputPromise; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoPromise', function () { - console.info(TAG + '----------CameraJsUnitPhotoPromise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-PhotoMode-Promise-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - camerasArrayPromise = await cameraManagerPromise.getCameras(); - console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering Get Cameras success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering Get Cameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering Get Cameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering Get Cameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); - console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200--------------"); - camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); - console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during camera0InputPromise with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PreviewOutput instance promise api - * @tc.desc : Create PreviewOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId); - console.info(TAG + " Entering createPreviewOutput success"); - if (previewOutputPromise != null || previewOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering createPreviewOutput PASSED: " + JSON.stringify(previewOutputPromise)); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create CaptureSession instance promise api - * @tc.desc : Create Capturesession instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); - CaptureSessionPromise = await cameraObj.createCaptureSession(null); - console.info(TAG + "Entering createCaptureSession success"); - if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - CaptureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering Remove preview Output success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - await photoOutputPromise.setMirror(true).then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - await photoOutputPromise.setMirror(false) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); - } - console.info(TAG + "Entering beginConfig ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - // callback related API - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED :" + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 to operate"); - await CaptureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - await photoOutputPromise.capture(photosettings3) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 :" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - await photoOutputPromise.capture(photosettings4) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - await sleep(1000) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); - if (data == 2) { - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - }) - .catch((err) => { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100-4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with location settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400-5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - await camera0InputPromise.setExposureBias(-5) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - await camera0InputPromise.setExposureBias(6) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 ends here"); - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session stop captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.stop(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session release captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PhotoOutput release api - * @tc.desc : PhotoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await photoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - }); -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets deleted file mode 100644 index 571ca690ff89ac2fbd3becb18f81fc97bc447bf8..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ /dev/null @@ -1,3800 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = "CameraModuleTest: "; -var cameraManager -var camerasArray -var camera0Input -var previewOutput -var photoOutputAsync -var videoRecorder -var surfaceId1 - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point = { x: 1, y: 1 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -let fdPath; -let fileAsset; -let fdNumber; -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/02.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var videoId -var videoOutput -var captureSession - -export default function cameraJSUnitVideoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('02.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModeAsync', function () { - console.info(TAG + '----------Camera-VideoMode-Async--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------') - await sleep(1) - cameraObj.getCameraManager(null, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Camera manager success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') - cameraManager = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------') - await sleep(1) - cameraManager.getCameras((err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Cameras success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Cameras data is not null || undefined') - camerasArray = data - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId - console.info(TAG + 'Entering Get Cameras camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArray[i].cameraPosition - console.info(TAG + 'Entering Get Cameras camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArray[i].cameraType - console.info(TAG + 'Entering Get Cameras camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArray[i].connectionType - console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined') - } - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info('--------------CAMERA-0 STARTS HERE--------------') - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------') - await sleep(1) - cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + 'Entering Create camera input data is not null || undefined') - camera0Input = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :' + camerasArray[0].cameraId) - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0Input error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 - * @tc.name : Create previewoutput async api - * @tc.desc : Create previewoutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createPreviewOutput(surfaceId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create preview output success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create preview output data is not null || undefined') - previewOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - previewOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 - * @tc.name : Create videooutput async api - * @tc.desc : Create videooutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 to operate') - await getvideosurface() - await sleep(2) - cameraObj.createVideoOutput(videoId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create videooutput success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create videooutput data is not null || undefined') - videoOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "VideoOutput Errorcallback is success") - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 - * @tc.name : Create capturesession async api - * @tc.desc : Create capturesession async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create capturesession success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create capturesession data is not null || undefined') - captureSession = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail() - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 - * @tc.name : Begin Config async api - * @tc.desc : Begin Config async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering Begin Config captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.beginConfig((err, data) => { - if (!err) { - console.info(TAG + 'Entering Begin Config success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput preview success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput video success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 ends here') - await sleep(1); - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(previewOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove video Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove video Output FAILED" + err.message); - console.info(TAG + "Entering Remove video Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - //framerate - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 to operate"); - videoOutput.getFrameRateRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get frame rate range success"); - expect(true).assertTrue(); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api_err - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Off success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLOw async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode low success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1) - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeMedium - * @tc.desc : getVideoStabilizationModeMedium async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode medium success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode High success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Auto success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 - * @tc.name : CommitConfig async api - * @tc.desc : CommitConfig async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CommitConfig success') - console.info(TAG + 'Entering CommitConfig data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //callback API - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate"); - previewOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - videoOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success'); - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 - * @tc.name : CaptureSession start async api - * @tc.desc : CaptureSession start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 to operate") - await sleep(1) - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering CaptureSession start success") - expect(true).assertTrue() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 PASSED") - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 ends here"); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100_exposure mode continuous auto - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 - * @tc.name : VideoOutput start async api - * @tc.desc : VideoOutput start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 videoOutput == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 to operate") - await sleep(1) - videoOutput.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 success: " + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 FAILED: " + err.message) - } - }) - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 - * @tc.name : VideoRecorder start async api - * @tc.desc : VideoRecorder start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 to operate') - videoRecorder.start() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 called'); - sleep(3); - console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') - photoOutputAsync.capture(photosettings1) - console.info(TAG + 'Capture during Video - End.') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 - * @tc.name : VideoOutput stop async api - * @tc.desc : VideoOutput stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 to operate') - videoOutput.stop(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 success: ' + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 - * @tc.name : VideoRecorder stop async api - * @tc.desc : VideoRecorder stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 to operate') - videoRecorder.stop() - console.info(TAG + 'VideoRecorder stop stopVideo done.') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 PASSED') - expect(true).assertTrue() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 - * @tc.name : CaptureSession stop async api - * @tc.desc : CaptureSession stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 to operate') - await sleep(1) - captureSession.stop((err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession stop success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 - * @tc.name : CaptureSession release async api - * @tc.desc : CaptureSession release async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 to operate') - await sleep(1) - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession release success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering CaptureSession release data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : videooutput release api - * @tc.desc : videooutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - videoOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering videooutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering videooutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - previewOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering previewOutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutput.release PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering previewOutput.release ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets deleted file mode 100644 index aa4466c90fbcc0482aff18bd91e25e3ae39d7b27..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ /dev/null @@ -1,3367 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera' -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = 'CameraModuleTest: ' -var cameraManagerPromise -var camerasArrayPromise -var camera0InputPromise -var previewOutputPromise -var videoRecorder -var photoOutputPromise -let fdPath; -let fileAsset; -let fdNumber; - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -var photosettings5 = { - rotation: 270, -} -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/01.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var surfaceId1 -var videoId -var videoOutputPromise -var captureSessionPromise - -export default function cameraJSUnitVideoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('01.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModePromise', function () { - console.info(TAG + '----------Camera-VideoMode-Promise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------') - cameraManagerPromise = await cameraObj.getCameraManager(null) - console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - await sleep(1) - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------') - camerasArrayPromise = await cameraManagerPromise.getCameras() - console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + 'Entering Get Cameras Promise success') - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArrayPromise[i].cameraPosition - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArrayPromise[i].cameraType - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------') - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) - console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 - * @tc.name : Create previewoutput promise api - * @tc.desc : Create previewoutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100--------------') - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) - console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) - if (previewOutputPromise != null && previewOutputPromise != undefined) { - console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') - expect(true).assertTrue(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is : " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : PreviewOutput callback onerror async api - * @tc.desc : PreviewOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 - * @tc.name : Create videooutput promise api - * @tc.desc : Create videooutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 to operate') - await getvideosurface() - await sleep(2) - videoOutputPromise = await cameraObj.createVideoOutput(videoId) - console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) - if (videoOutputPromise != null && videoOutputPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + 'VideoOutput Errorcallback is success') - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create capturesession promise api - * @tc.desc : Create capturesession promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate') - captureSessionPromise = await cameraObj.createCaptureSession(null) - console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) - if (captureSessionPromise != null && captureSessionPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback onerror async api - * @tc.desc : CaptureSession callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - captureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Create captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add video output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering Add video output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 to operate"); - await videoOutputPromise.getFrameRateRange() - .then(function (data) { - console.info(TAG + "Entering get frame rate range SUCCESS "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 PASSED : " + JSON.stringify(data)) - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLow promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 - * @tc.name : getVideoStabilizationModeMIDDLE - * @tc.desc : getVideoStabilizationModeMIDDLE promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.commitConfig(); - console.info(TAG + "Entering commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig PASSED"); - } - else { - expect().assertFail() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig ends here"); - } - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : PreviewOutput callback onframeend async api - * @tc.desc : PreviewOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStop frameEnd Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "Video frameStart Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success') - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message) - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 to operate"); - await captureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 to operate"); - await photoOutputPromise.setMirror(true) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 ends here"); - await sleep(1) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering get focus mode auto SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100_exposure mode locked - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 mode locked - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 mode locked - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 mode auto - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 mode continuous auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 - * @tc.name : VideoOutput start promise api - * @tc.desc : VideoOutput start promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 to operate') - await videoOutputPromise.start() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 - * @tc.name : VideoOutput stop promise api - * @tc.desc : VideoOutput stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 to operate') - await videoOutputPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 - * @tc.name : CaptureSession stop promise api - * @tc.desc : CaptureSession stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 to operate') - await captureSessionPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 - * @tc.name : CaptureSession release promise api - * @tc.desc : CaptureSession release promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 to operate') - await captureSessionPromise.release() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : videoOutput release api - * @tc.desc : videoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await videoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/resources/base/element/string.json b/multimedia/camera/cameraUnspc/src/main/resources/base/element/string.json deleted file mode 100644 index b93f540e29265a34f883a977c442fa85349b94ca..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraUnspc/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraUnspc/src/main/resources/base/media/icon.png b/multimedia/camera/cameraUnspc/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraUnspc/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/camera/cameraWideAngle/BUILD.gn b/multimedia/camera/cameraWideAngle/BUILD.gn deleted file mode 100644 index 0df71860f37f82527bc2a3631968d98bd358a279..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("camera_wideangle_ets_hap") { - hap_profile = "./src/main/config.json" - deps = [ - ":camera_ets_assets", - ":camera_ets_resources", - ] - ets2abc = true - - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsCameraWideAngleETSTest" - subsystem_name = "multimedia" - part_name = "multimedia_camera_framework" -} -ohos_js_assets("camera_ets_assets") { - source_dir = "./src/main/ets/MainAbility" -} -ohos_resources("camera_ets_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/camera/cameraWideAngle/Test.json b/multimedia/camera/cameraWideAngle/Test.json deleted file mode 100644 index 558fadf916a24046da66427c70353ab2cc627bf0..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/Test.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "Configuration for camerastandard WideAngle Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "1000000", - "package": "com.open.harmony.multimedia.camerawatest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "touch /data/media/01.mp4", - "chmod -R 777 /data/media" - - ], - "teardown-command":[ - - ] - }, - { - "test-file-name": [ - "ActsCameraWideAngleETSTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/signature/openharmony_sx.p7b b/multimedia/camera/cameraWideAngle/signature/openharmony_sx.p7b deleted file mode 100644 index 0625db92101ca16c7becfaf2d4008ea2e96078e1..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraWideAngle/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/camera/cameraWideAngle/src/main/config.json b/multimedia/camera/cameraWideAngle/src/main/config.json deleted file mode 100644 index 39ed1a3a5491a553103e5a38b067daea85f3d1c8..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.multimedia.camerawatest", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.multimedia.camerawatest", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.multimedia.camerawatest.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.CAMERA", - "reason": "use ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "use ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason": "use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "use ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "use ohos.permission.WRITE_MEDIA" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/app.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/app.ets deleted file mode 100644 index a9f8218978fad817d4519aa1b715da0e3f8ebbfc..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/pages/index.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index ca96b03e80e49976adf3f876fadb4d82d574c6ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend} from "deccjsunit/index" -import cameraKit from "../test/Camera.test" -import featureAbility from "@ohos.ability.featureAbility" - -let TAG = 'CameraModuleTest: ' -var mXComponentController: XComponentController = new XComponentController() -var surfaceId: any - -@Entry -@Component -struct CameraIndex { - @State isShowSettings: boolean = false - @State previewSize: string = '75%' - - aboutToAppear() { - console.info('--------------aboutToAppear--------------') - } - - build() { - Flex() { - XComponent({ - id: '', - type: 'surface', - libraryname: '', - controller: mXComponentController - }) - .onLoad(() => { - console.info('CameraModuleTest: OnLoad() is called!') - mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 }); - surfaceId = mXComponentController.getXComponentSurfaceId() - console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + surfaceId) - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - console.info(TAG + 'Entering expectExtend') - core.addService('expect', expectExtend) - console.info(TAG + 'Entering addService') - core.init() - console.info(TAG + 'Entering core.init()') - console.info(TAG + 'Entering subscribeEvent') - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - console.info(TAG + 'Entering configService') - cameraKit(surfaceId) - core.execute() - console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error)); - }) - }) - .width('1920px') - .height('1080px') - } - } -} diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/Camera.test.ets deleted file mode 100644 index 2743a3a6f94f359e98785fa0a21bf1518e7a9859..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/Camera.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraJSUnitEnum from './CameraJSUnitEnum.test.ets' -import cameraJSUnitCameraFormat from './CameraJSUnitCameraFormat.test.ets' -import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' -import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' -import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' -import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' - -let TAG = 'CameraModuleTest: ' - -export default function cameraKit(surfaceId: any) { - console.info(TAG + 'Entering cameraKit') - console.info(TAG + 'surfaceId: ' + surfaceId) - - cameraJSUnitEnum(surfaceId) - cameraJSUnitCameraFormat(surfaceId) - cameraJSUnitPhotoAsync(surfaceId) - cameraJSUnitPhotoPromise(surfaceId) - cameraJSUnitVideoAsync(surfaceId) - cameraJSUnitVideoPromise(surfaceId) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets deleted file mode 100644 index 92d853350bf5e5587f20cd0d6a2c755309601aea..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ /dev/null @@ -1,2778 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitCameraFormat(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitCameraFormat', function () { - console.info(TAG + '----------CameraJsUnitCameraFormat--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 PASSED"); - } - } 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_CAMERA_MANAGER_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - var cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - var camerasArrayPromise = await cameraManager.getCameras(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 - * @tc.name : get camera if from camera-0 input async api - * @tc.desc : get camera if from camera-0 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100', 0, async function (done) { - camera0Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 data is not null || undefined"); - var CameraId0 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 PASSED with CameraID :" + CameraId0); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 - * @tc.name : get camera if from camera-0 input promise api - * @tc.desc : get camera if from camera-0 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100', 0, async function (done) { - var camera0IdPromise = await camera0InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); - if (camera0IdPromise != null && camera0IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 PASSED" + camera0IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-0 camerainput async api - * @tc.desc : Get supported video formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 - * @tc.name : Get supported video formats from camera-0 camerainput promise api - * @tc.desc : Get supported video formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on("focusStateChange", async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CAMERA-1 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-1 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera1InputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 - * @tc.name : get camera ID from camera-1 input async api - * @tc.desc : get camera ID from camera-1 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - camera1Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - var CameraId1 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 PASSED with CameraID : " + CameraId1); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 - * @tc.name : get camera ID from camera-1 input promise api - * @tc.desc : get camera ID from camera-1 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100', 0, async function (done) { - var camera1IdPromise = await camera1InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise: " + JSON.stringify(camera1IdPromise)); - if (camera1IdPromise != null && camera1IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 camera1IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 PASSED" + camera1IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-1 camerainput async api - * @tc.desc : Get supported video formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 - * @tc.name : Get supported video formats from camera-1 camerainput promise api - * @tc.desc : Get supported video formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromise = await camera1InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromise)); - if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromise: " + cam1FormatPromise[i]); - expect(cam1FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosBack)); - if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); - expect(cam1FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput async api - * @tc.desc : Get supported preview formats from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-1 camerainput promise api - * @tc.desc : Get supported preview formats from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-1 camerainput async api - * @tc.desc : Get supported photo format from camera-1 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera1InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-1 camerainput promise api - * @tc.desc : Get supported photo format from camera-1 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam1FormatPromisePosFront)); - if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); - expect(cam1FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-2 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraId async api - * @tc.desc : Create camerainput from camera-2 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-2 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera2Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[2].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraId promise api - * @tc.desc : Create camerainput from camera-2 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera2InputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise: " + JSON.stringify(camera2InputPromise)); - if (camera2InputPromise != null && camera2InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera2InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 - * @tc.name : get camera ID from camera-2 input async api - * @tc.desc : get camera ID from camera-2 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - camera2Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - var CameraId2 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 PASSED with CameraID : " + CameraId2); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 - * @tc.name : get camera ID from camera-2 input promise api - * @tc.desc : get camera ID from camera-2 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100', 0, async function (done) { - var camera2IdPromise = await camera2InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise: " + JSON.stringify(camera2IdPromise)); - if (camera2IdPromise != null && camera2IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 camera2IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 PASSED" + camera2IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-2 camerainput async api - * @tc.desc : Get supported video formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 - * @tc.name : Get supported video formats from camera-2 camerainput promise api - * @tc.desc : Get supported video formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromise = await camera2InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromise)); - if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromise: " + cam2FormatPromise[i]); - expect(cam2FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosBack)); - if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); - expect(cam2FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput async api - * @tc.desc : Get supported preview formats from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-2 camerainput promise api - * @tc.desc : Get supported preview formats from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-2 camerainput async api - * @tc.desc : Get supported photo format from camera-2 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera2InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-2 camerainput promise api - * @tc.desc : Get supported photo format from camera-2 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam2FormatPromisePosFront)); - if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); - expect(cam2FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-3 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraId async api - * @tc.desc : Create camerainput from camera-3 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-3 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera3Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[3].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraId promise api - * @tc.desc : Create camerainput from camera-3 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera3InputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise: " + JSON.stringify(camera3InputPromise)); - if (camera3InputPromise != null && camera3InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera3InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 - * @tc.name : get camera ID from camera-3 input async api - * @tc.desc : get camera ID from camera-3 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - camera3Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - var CameraId3 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 PASSED with CameraID : " + CameraId3); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 - * @tc.name : get camera ID from camera-3 input promise api - * @tc.desc : get camera ID from camera-3 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100', 0, async function (done) { - var camera3IdPromise = await camera3InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise: " + JSON.stringify(camera3IdPromise)); - if (camera3IdPromise != null && camera3IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 camera3IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 PASSED" + camera3IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 - * @tc.name : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100--------------"); - var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); - if (cameraInputPromise != null && cameraInputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 cameraInputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-3 camerainput async api - * @tc.desc : Get supported video formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 - * @tc.name : Get supported video formats from camera-3 camerainput promise api - * @tc.desc : Get supported video formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromise = await camera3InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromise)); - if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromise: " + cam3FormatPromise[i]); - expect(cam3FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosBack)); - if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); - expect(cam3FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput async api - * @tc.desc : Get supported preview formats from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-3 camerainput promise api - * @tc.desc : Get supported preview formats from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-3 camerainput async api - * @tc.desc : Get supported photo format from camera-3 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera3InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-3 camerainput promise api - * @tc.desc : Get supported photo format from camera-3 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam3FormatPromisePosFront)); - if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); - expect(cam3FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition unspecified & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition unspecified & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 FAILED"); - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition back & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 - * @tc.name : Create camerainput from cameraposition back & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition back & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets deleted file mode 100644 index 54de11efdc95e7ad97d972b4081928b1e224b8ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input, camera0InputPosBack, camera0InputPosFront; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; -// CAMERA-1 Variables -var camera1Input, camera1InputPosBack, camera1InputPosFront; -var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; -// CAMERA-2 Variables -var camera2Input, camera2InputPosBack, camera2InputPosFront; -var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; -// CAMERA-3 Variables -var camera3Input, camera3InputPosBack, camera3InputPosFront; -var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; - -export default function cameraJSUnitEnum(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJSUnitEnum', function () { - console.info(TAG + '----------CameraJSUnitEnum--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100 - * @tc.name : camera status ENAME - * @tc.desc : camera status ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100------------"); - console.info(TAG + "CameraStatus CAMERA_STATUS_APPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_APPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_APPEAR).assertEqual(0); - console.info(TAG + "CameraStatus CAMERA_STATUS_DISAPPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR).assertEqual(1); - console.info(TAG + "CameraStatus CAMERA_STATUS_AVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE).assertEqual(2); - console.info(TAG + "CameraStatus CAMERA_STATUS_UNAVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100 - * @tc.name : Camera position ENAME - * @tc.desc : Camera position ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100------------") - console.info(TAG + "CameraPosition CAMERA_POSITION_BACK : " + cameraObj.CameraPosition.CAMERA_POSITION_BACK); - expect(cameraObj.CameraPosition.CAMERA_POSITION_BACK).assertEqual(1); - console.info(TAG + "CameraPosition CAMERA_POSITION_FRONT : " + cameraObj.CameraPosition.CAMERA_POSITION_FRONT); - expect(cameraObj.CameraPosition.CAMERA_POSITION_FRONT).assertEqual(2); - console.info(TAG + "CameraPosition CAMERA_POSITION_UNSPECIFIED : " + cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED); - expect(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED).assertEqual(0); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100 - * @tc.name : camera type ENAME - * @tc.desc : camera type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100------------") - console.info(TAG + "CameraType CAMERA_TYPE_UNSPECIFIED : " + cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - expect(cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED).assertEqual(0); - console.info(TAG + "CameraType CAMERA_TYPE_WIDE_ANGLE : " + cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE); - expect(cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE).assertEqual(1); - console.info(TAG + 'CameraType CAMERA_TYPE_ULTRA_WIDE : ' + cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE); - expect(cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE).assertEqual(2); - console.info(TAG + 'CameraType CAMERA_TYPE_TELEPHOTO : ' + cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO); - expect(cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO).assertEqual(3); - console.info(TAG + 'CameraType CAMERA_TYPE_TRUE_DEPTH : ' + cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - expect(cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH).assertEqual(4); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100 - * @tc.name : connection type ENAME - * @tc.desc : connection type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100------------") - console.info(TAG + "ConnectionType CAMERA_CONNECTION_BUILT_IN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN).assertEqual(0); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_USB_PLUGIN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN).assertEqual(1); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_REMOTE : " + cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100 - * @tc.name : Flash Mode ENAME - * @tc.desc : Flash Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100------------") - console.info(TAG + "FlashMode FLASH_MODE_CLOSE : " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - console.info(TAG + "FlashMode FLASH_MODE_OPEN : " + cameraObj.FlashMode.FLASH_MODE_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - console.info(TAG + "FlashMode FLASH_MODE_AUTO : " + cameraObj.FlashMode.FLASH_MODE_AUTO); - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - console.info(TAG + "FlashMode FLASH_MODE_ALWAYS_OPEN : " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100 - * @tc.name : Focus Mode ENAME - * @tc.desc : Focus Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100------------") - console.info(TAG + "FocusMode FOCUS_MODE_MANUAL : " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0); - console.info(TAG + "FocusMode FOCUS_MODE_CONTINUOUS_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "FocusMode FOCUS_MODE_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "FocusMode FOCUS_MODE_LOCKED : " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100 - * @tc.name : Focus State ENAME - * @tc.desc : Focus State ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100------------") - console.info(TAG + "FocusState FOCUS_STATE_SCAN : " + cameraObj.FocusState.FOCUS_STATE_SCAN); - expect(cameraObj.FocusState.FOCUS_STATE_SCAN).assertEqual(0); - console.info(TAG + "FocusState FOCUS_STATE_FOCUSED : " + cameraObj.FocusState.FOCUS_STATE_FOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_FOCUSED).assertEqual(1); - console.info(TAG + "FocusState FOCUS_STATE_UNFOCUSED : " + cameraObj.FocusState.FOCUS_STATE_UNFOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_UNFOCUSED).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100 - * @tc.name : Image Rotation ENAME - * @tc.desc : Image Rotation ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100------------") - console.info(TAG + "ImageRotation ROTATION_0 : " + cameraObj.ImageRotation.ROTATION_0); - expect(cameraObj.ImageRotation.ROTATION_0).assertEqual(0); - console.info(TAG + "ImageRotation ROTATION_90 : " + cameraObj.ImageRotation.ROTATION_90); - expect(cameraObj.ImageRotation.ROTATION_90).assertEqual(90); - console.info(TAG + "ImageRotation ROTATION_180 : " + cameraObj.ImageRotation.ROTATION_180); - expect(cameraObj.ImageRotation.ROTATION_180).assertEqual(180); - console.info(TAG + "ImageRotation ROTATION_270 : " + cameraObj.ImageRotation.ROTATION_270); - expect(cameraObj.ImageRotation.ROTATION_270).assertEqual(270); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100 - * @tc.name : Quality Level ENAME - * @tc.desc : Quality Level ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100------------") - console.info(TAG + "QualityLevel QUALITY_LEVEL_HIGH : " + cameraObj.QualityLevel.QUALITY_LEVEL_HIGH); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_HIGH).assertEqual(0); - console.info(TAG + "QualityLevel QUALITY_LEVEL_MEDIUM : " + cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM).assertEqual(1); - console.info(TAG + "QualityLevel QUALITY_LEVEL_LOW : " + cameraObj.QualityLevel.QUALITY_LEVEL_LOW); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_LOW).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 - * @tc.name : CameraInputErrorCode ENAME - * @tc.desc : CameraInputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 : " + cameraObj.CameraInputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CameraInputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 - * @tc.name : CaptureSessionErrorCode ENAME - * @tc.desc : CaptureSessionErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 : " + cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 - * @tc.name : PreviewOutputErrorCode ENAME - * @tc.desc : PreviewOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 : " + cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 - * @tc.name : PhotoOutputErrorCode ENAME - * @tc.desc : PhotoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 : " + cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 - * @tc.name : VideoOutputErrorCode ENAME - * @tc.desc : VideoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 : " + cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets deleted file mode 100644 index 3b990e106f896ed54704bdb813583aa6c359e1fb..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ /dev/null @@ -1,3606 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0Input; -var camera1Input; -var cameraManager; -var previewOutputAsync; -var photoOutputAsync; -var captureSession; -var surfaceId1; -var camerasArray; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoAsync', function () { - console.info(TAG + '----------CameraJsUnitPhotoAsync--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-Precision Control-Async-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Camera Manager success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering Camera Manager data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering GetCameras success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering GetCameras data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering GetCameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering GetCameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering GetCameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 - * @tc.name : Create camerainput from camera-1 cameraId async api - * @tc.desc : Create camerainput from camera-1 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200', 0, async function (done) { - cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 data is not null || undefined"); - camera1Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 PASSED with CameraID :" + camerasArray[1].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "cameraInput error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - } - await sleep(1000); - done(); - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Create PreviewOutput instance api - * @tc.desc : Create PreviewOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - cameraObj.createPreviewOutput(surfaceId, async (err, data) => { - if (!err) { - console.info(TAG + " Entering createPreviewOutput success"); - if (data != null || data != undefined) { - console.info(TAG + " Entering createPreviewOutput data is not null || undefined"); - previewOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED" + previewOutputAsync); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 to operate"); - previewOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 - * @tc.name : Create CaptureSession instance api - * @tc.desc : Create CaptureSession instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 to operate"); - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createCaptureSession success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - captureSession = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 - * @tc.name : Add Input with camera1Input api - * @tc.desc : Add Input with camera1Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 to operate"); - captureSession.addInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 to operate"); - captureSession.addOutput(previewOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Preview : Success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - photoOutputAsync.setMirror(false, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 - * @tc.name : CaptureSession_Begin config api - * @tc.desc : CaptureSession_Begin config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 to operate"); - captureSession.beginConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering beginConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering BeginConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 beginConfig PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - captureSession.removeInput(camera1Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering Addinput captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 to operate"); - captureSession.addInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddInput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddInput data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 addInput PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + "Entering commitConfig success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering CommitConfig data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputAsync.on("frameStart", async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStart frameStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputAsync.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 to operate"); - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 PASSED"); - } - else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings2 api - * @tc.desc : Photo output capture with photosettings2 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - photoOutputAsync.capture(photosettings3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings3 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - photoOutputAsync.capture(photosettings4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings4 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - } - }) - await sleep(1000); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - camera0Input.getFocalLength(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering SET_FOCUS_POINT to operate"); - camera0Input.setFocusPoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SET_FOCUS_POINT PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { - console.info(TAG + "Entering GET_FOCUS_POINT to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "GET_FOCUS_POINT PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); - console.info(TAG + "GET_FOCUS_POINT ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 to operate"); - camera0Input.setFocusPoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 to operate"); - camera0Input.setFocusPoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : GET_FOCUS_POINT_focus mode auto - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 -4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - camera0Input.setExposurePoint(Point1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 mode auto - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 mode auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - camera0Input.setExposurePoint(Point2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 mode continuous auto - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - camera0Input.setExposurePoint(Point3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 to operate"); - photoOutputAsync.capture(photosettings2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings2"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 -5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - camera0Input.setExposureBias(-5, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 mode locked - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 6 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - camera0Input.setExposureBias(6, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 to operate"); - captureSession.stop(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.stop data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 to operate"); - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering captureSession.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering captureSession.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100', 0, async function (done) { - if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 previewOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 to operate"); - previewOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutputAsync.release success"); - console.info(TAG + "Entering previewOutputAsync.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - }) - await sleep(1000); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets deleted file mode 100644 index c14442e53bbb82953bb57518e61b1a76791d112c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ /dev/null @@ -1,3283 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables -var camera0InputPromise; -var cameraManagerPromise; -var previewOutputPromise; -var photoOutputPromise; -var CaptureSessionPromise; -var surfaceId1; -var camerasArrayPromise -var camera1InputPromise; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } - -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -export default function cameraJSUnitPhotoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitPhotoPromise', function () { - console.info(TAG + '----------CameraJsUnitPhotoPromise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - console.info(TAG + "----------Camera-PhotoMode-Promise-------------"); - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - camerasArrayPromise = await cameraManagerPromise.getCameras(); - console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering Get Cameras success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering Get Cameras camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering Get Cameras camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering Get Cameras camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); - console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 - * @tc.name : Create camerainput from camera-1 cameraId promise api - * @tc.desc : Create camerainput from camera-1 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200--------------"); - camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); - console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); - if (camera1InputPromise != null && camera1InputPromise != undefined) { - console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during camera0InputPromise with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PreviewOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PreviewOutput instance promise api - * @tc.desc : Create PreviewOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId); - console.info(TAG + " Entering createPreviewOutput success"); - if (previewOutputPromise != null || previewOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering createPreviewOutput PASSED: " + JSON.stringify(previewOutputPromise)); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1000) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create CaptureSession instance promise api - * @tc.desc : Create Capturesession instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); - CaptureSessionPromise = await cameraObj.createCaptureSession(null); - console.info(TAG + "Entering createCaptureSession success"); - if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { - console.info(TAG + "Entering createCaptureSession data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //Capturesession callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); - CaptureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering Remove preview Output success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview Output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); - await photoOutputPromise.setMirror(true).then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 - * @tc.name : setMirror false - * @tc.desc : setMirror false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); - await photoOutputPromise.setMirror(false) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'false'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 FAILED : " + err.message); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await CaptureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering beginConfig FAILED"); - } - console.info(TAG + "Entering beginConfig ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 to operate"); - const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); - const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); - const promise = await CaptureSessionPromise.commitConfig(); - console.info(TAG + "Entering commit config commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig ends here"); - } - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - // callback related API - //preview callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED :" + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 to operate"); - await CaptureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //Location - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); - await photoOutputPromise.capture(photosettings3) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 :" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); - await photoOutputPromise.capture(photosettings4) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); - await sleep(1000) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); - } - await sleep(1000); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1000); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); - if (data == 2) { - console.info(TAG + "Current FocusMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); - } - }) - .catch((err) => { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); - }); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100-4 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 to operate"); - photoOutputPromise.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 to operate"); - await photoOutputPromise.capture(photosettings1) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 - * @tc.name : Photo output capture with photosettings api - * @tc.desc : Photo output capture with photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - await photoOutputPromise.capture(photosettings2) - .then(function (data) { - console.info(TAG + "Entering photoOutput capture with location settings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); - expect(true).assertTrue(); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); - }); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400-5 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); - await camera0InputPromise.setExposureBias(-5) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); - await camera0InputPromise.setExposureBias(6) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 ends here"); - await sleep(1000); - done(); - }) - - /*CaptureSession APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 - * @tc.name : capture session stop api - * @tc.desc : capture session stop api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session stop captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.stop(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : capture session release api - * @tc.desc : capture session release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering capture session release captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await CaptureSessionPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PhotoOutput release api - * @tc.desc : PhotoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await photoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - } - await sleep(1000); - done(); - }) - }); -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets deleted file mode 100644 index 571ca690ff89ac2fbd3becb18f81fc97bc447bf8..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ /dev/null @@ -1,3800 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = "CameraModuleTest: "; -var cameraManager -var camerasArray -var camera0Input -var previewOutput -var photoOutputAsync -var videoRecorder -var surfaceId1 - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point = { x: 1, y: 1 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -let fdPath; -let fileAsset; -let fdNumber; -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/02.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var videoId -var videoOutput -var captureSession - -export default function cameraJSUnitVideoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('02.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModeAsync', function () { - console.info(TAG + '----------Camera-VideoMode-Async--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------') - await sleep(1) - cameraObj.getCameraManager(null, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Camera manager success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') - cameraManager = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------') - await sleep(1) - cameraManager.getCameras((err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Cameras success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Cameras data is not null || undefined') - camerasArray = data - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId - console.info(TAG + 'Entering Get Cameras camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArray[i].cameraPosition - console.info(TAG + 'Entering Get Cameras camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArray[i].cameraType - console.info(TAG + 'Entering Get Cameras camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArray[i].connectionType - console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined') - } - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info('--------------CAMERA-0 STARTS HERE--------------') - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------') - await sleep(1) - cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + 'Entering Create camera input data is not null || undefined') - camera0Input = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :' + camerasArray[0].cameraId) - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0Input error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 - * @tc.name : Create previewoutput async api - * @tc.desc : Create previewoutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createPreviewOutput(surfaceId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create preview output success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create preview output data is not null || undefined') - previewOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - previewOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 - * @tc.name : Create videooutput async api - * @tc.desc : Create videooutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 to operate') - await getvideosurface() - await sleep(2) - cameraObj.createVideoOutput(videoId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create videooutput success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create videooutput data is not null || undefined') - videoOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "VideoOutput Errorcallback is success") - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 - * @tc.name : Create capturesession async api - * @tc.desc : Create capturesession async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create capturesession success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create capturesession data is not null || undefined') - captureSession = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail() - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 - * @tc.name : Begin Config async api - * @tc.desc : Begin Config async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering Begin Config captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.beginConfig((err, data) => { - if (!err) { - console.info(TAG + 'Entering Begin Config success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput preview success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput video success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 ends here') - await sleep(1); - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(previewOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove video Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove video Output FAILED" + err.message); - console.info(TAG + "Entering Remove video Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - //framerate - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 to operate"); - videoOutput.getFrameRateRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get frame rate range success"); - expect(true).assertTrue(); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api_err - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Off success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLOw async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode low success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1) - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeMedium - * @tc.desc : getVideoStabilizationModeMedium async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode medium success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode High success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Auto success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 - * @tc.name : CommitConfig async api - * @tc.desc : CommitConfig async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CommitConfig success') - console.info(TAG + 'Entering CommitConfig data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //callback API - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate"); - previewOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - videoOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success'); - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 - * @tc.name : CaptureSession start async api - * @tc.desc : CaptureSession start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 to operate") - await sleep(1) - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering CaptureSession start success") - expect(true).assertTrue() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 PASSED") - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 ends here"); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100_exposure mode continuous auto - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 - * @tc.name : VideoOutput start async api - * @tc.desc : VideoOutput start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 videoOutput == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 to operate") - await sleep(1) - videoOutput.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 success: " + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 FAILED: " + err.message) - } - }) - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 - * @tc.name : VideoRecorder start async api - * @tc.desc : VideoRecorder start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 to operate') - videoRecorder.start() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 called'); - sleep(3); - console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') - photoOutputAsync.capture(photosettings1) - console.info(TAG + 'Capture during Video - End.') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 - * @tc.name : VideoOutput stop async api - * @tc.desc : VideoOutput stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 to operate') - videoOutput.stop(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 success: ' + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 - * @tc.name : VideoRecorder stop async api - * @tc.desc : VideoRecorder stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 to operate') - videoRecorder.stop() - console.info(TAG + 'VideoRecorder stop stopVideo done.') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 PASSED') - expect(true).assertTrue() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 - * @tc.name : CaptureSession stop async api - * @tc.desc : CaptureSession stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 to operate') - await sleep(1) - captureSession.stop((err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession stop success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 - * @tc.name : CaptureSession release async api - * @tc.desc : CaptureSession release async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 to operate') - await sleep(1) - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession release success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering CaptureSession release data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : videooutput release api - * @tc.desc : videooutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - videoOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering videooutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering videooutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - previewOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering previewOutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutput.release PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering previewOutput.release ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets deleted file mode 100644 index aa4466c90fbcc0482aff18bd91e25e3ae39d7b27..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ /dev/null @@ -1,3367 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera' -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = 'CameraModuleTest: ' -var cameraManagerPromise -var camerasArrayPromise -var camera0InputPromise -var previewOutputPromise -var videoRecorder -var photoOutputPromise -let fdPath; -let fileAsset; -let fdNumber; - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -var photosettings5 = { - rotation: 270, -} -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/01.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var surfaceId1 -var videoId -var videoOutputPromise -var captureSessionPromise - -export default function cameraJSUnitVideoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('01.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModePromise', function () { - console.info(TAG + '----------Camera-VideoMode-Promise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------') - cameraManagerPromise = await cameraObj.getCameraManager(null) - console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - await sleep(1) - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------') - camerasArrayPromise = await cameraManagerPromise.getCameras() - console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + 'Entering Get Cameras Promise success') - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArrayPromise[i].cameraPosition - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArrayPromise[i].cameraType - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------') - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) - console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 - * @tc.name : Create previewoutput promise api - * @tc.desc : Create previewoutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100--------------') - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) - console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) - if (previewOutputPromise != null && previewOutputPromise != undefined) { - console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') - expect(true).assertTrue(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is : " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : PreviewOutput callback onerror async api - * @tc.desc : PreviewOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 - * @tc.name : Create videooutput promise api - * @tc.desc : Create videooutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 to operate') - await getvideosurface() - await sleep(2) - videoOutputPromise = await cameraObj.createVideoOutput(videoId) - console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) - if (videoOutputPromise != null && videoOutputPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + 'VideoOutput Errorcallback is success') - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create capturesession promise api - * @tc.desc : Create capturesession promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate') - captureSessionPromise = await cameraObj.createCaptureSession(null) - console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) - if (captureSessionPromise != null && captureSessionPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback onerror async api - * @tc.desc : CaptureSession callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - captureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Create captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add video output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering Add video output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 to operate"); - await videoOutputPromise.getFrameRateRange() - .then(function (data) { - console.info(TAG + "Entering get frame rate range SUCCESS "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 PASSED : " + JSON.stringify(data)) - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLow promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 - * @tc.name : getVideoStabilizationModeMIDDLE - * @tc.desc : getVideoStabilizationModeMIDDLE promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.commitConfig(); - console.info(TAG + "Entering commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig PASSED"); - } - else { - expect().assertFail() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig ends here"); - } - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : PreviewOutput callback onframeend async api - * @tc.desc : PreviewOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStop frameEnd Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "Video frameStart Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success') - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message) - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 to operate"); - await captureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 to operate"); - await photoOutputPromise.setMirror(true) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 ends here"); - await sleep(1) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering get focus mode auto SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100_exposure mode locked - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 mode locked - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 mode locked - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 mode auto - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 mode continuous auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 - * @tc.name : VideoOutput start promise api - * @tc.desc : VideoOutput start promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 to operate') - await videoOutputPromise.start() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 - * @tc.name : VideoOutput stop promise api - * @tc.desc : VideoOutput stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 to operate') - await videoOutputPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 - * @tc.name : CaptureSession stop promise api - * @tc.desc : CaptureSession stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 to operate') - await captureSessionPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 - * @tc.name : CaptureSession release promise api - * @tc.desc : CaptureSession release promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 to operate') - await captureSessionPromise.release() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : videoOutput release api - * @tc.desc : videoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await videoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/resources/base/element/string.json b/multimedia/camera/cameraWideAngle/src/main/resources/base/element/string.json deleted file mode 100644 index b93f540e29265a34f883a977c442fa85349b94ca..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngle/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngle/src/main/resources/base/media/icon.png b/multimedia/camera/cameraWideAngle/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraWideAngle/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/camera/cameraWideAngleRK/BUILD.gn b/multimedia/camera/cameraWideAngleRK/BUILD.gn deleted file mode 100644 index 34a4764ea623955fa547f02be64dd07658fc5e10..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("camera_wideanglerk_ets_hap") { - hap_profile = "./src/main/config.json" - deps = [ - ":camera_ets_assets", - ":camera_ets_resources", - ] - ets2abc = true - - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsCameraWideAngleRKETSTest" - subsystem_name = "multimedia" - part_name = "multimedia_camera_framework" -} -ohos_js_assets("camera_ets_assets") { - source_dir = "./src/main/ets/MainAbility" -} -ohos_resources("camera_ets_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/camera/cameraWideAngleRK/Test.json b/multimedia/camera/cameraWideAngleRK/Test.json deleted file mode 100644 index b83f183916aa5333ab93da1173561e76b4e9241c..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/Test.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "Configuration for camerastandard WideAngleRK Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "1000000", - "package": "com.open.harmony.multimedia.camerawarktest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "touch /data/media/01.mp4", - "chmod -R 777 /data/media" - - ], - "teardown-command":[ - - ] - }, - { - "test-file-name": [ - "ActsCameraWideAngleRKETSTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/signature/openharmony_sx.p7b b/multimedia/camera/cameraWideAngleRK/signature/openharmony_sx.p7b deleted file mode 100644 index 0625db92101ca16c7becfaf2d4008ea2e96078e1..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraWideAngleRK/signature/openharmony_sx.p7b and /dev/null differ diff --git a/multimedia/camera/cameraWideAngleRK/src/main/config.json b/multimedia/camera/cameraWideAngleRK/src/main/config.json deleted file mode 100644 index f357f71f1be5e9b272b4f741c22ff78e5198403b..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.multimedia.camerawarktest", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.multimedia.camerawarktest", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.multimedia.camerawarktest.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.CAMERA", - "reason": "use ohos.permission.CAMERA" - }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "use ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason": "use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_MEDIA", - "reason": "use ohos.permission.READ_MEDIA" - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "use ohos.permission.WRITE_MEDIA" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/app.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/app.ets deleted file mode 100644 index a9f8218978fad817d4519aa1b715da0e3f8ebbfc..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/pages/index.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index ca96b03e80e49976adf3f876fadb4d82d574c6ef..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend} from "deccjsunit/index" -import cameraKit from "../test/Camera.test" -import featureAbility from "@ohos.ability.featureAbility" - -let TAG = 'CameraModuleTest: ' -var mXComponentController: XComponentController = new XComponentController() -var surfaceId: any - -@Entry -@Component -struct CameraIndex { - @State isShowSettings: boolean = false - @State previewSize: string = '75%' - - aboutToAppear() { - console.info('--------------aboutToAppear--------------') - } - - build() { - Flex() { - XComponent({ - id: '', - type: 'surface', - libraryname: '', - controller: mXComponentController - }) - .onLoad(() => { - console.info('CameraModuleTest: OnLoad() is called!') - mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 }); - surfaceId = mXComponentController.getXComponentSurfaceId() - console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + surfaceId) - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - console.info(TAG + 'Entering expectExtend') - core.addService('expect', expectExtend) - console.info(TAG + 'Entering addService') - core.init() - console.info(TAG + 'Entering core.init()') - console.info(TAG + 'Entering subscribeEvent') - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - console.info(TAG + 'Entering configService') - cameraKit(surfaceId) - core.execute() - console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error)); - }) - }) - .width('1920px') - .height('1080px') - } - } -} diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/Camera.test.ets deleted file mode 100644 index 2743a3a6f94f359e98785fa0a21bf1518e7a9859..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/Camera.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraJSUnitEnum from './CameraJSUnitEnum.test.ets' -import cameraJSUnitCameraFormat from './CameraJSUnitCameraFormat.test.ets' -import cameraJSUnitPhotoAsync from './CameraJSUnitPhotoAsync.test.ets' -import cameraJSUnitPhotoPromise from './CameraJSUnitPhotoPromise.test.ets' -import cameraJSUnitVideoAsync from './CameraJSUnitVideoAsync.test.ets' -import cameraJSUnitVideoPromise from './CameraJSUnitVideoPromise.test.ets' - -let TAG = 'CameraModuleTest: ' - -export default function cameraKit(surfaceId: any) { - console.info(TAG + 'Entering cameraKit') - console.info(TAG + 'surfaceId: ' + surfaceId) - - cameraJSUnitEnum(surfaceId) - cameraJSUnitCameraFormat(surfaceId) - cameraJSUnitPhotoAsync(surfaceId) - cameraJSUnitPhotoPromise(surfaceId) - cameraJSUnitVideoAsync(surfaceId) - cameraJSUnitVideoPromise(surfaceId) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets deleted file mode 100644 index 89d94d2fe68a3bc833bde4c7fca420c21476d022..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets +++ /dev/null @@ -1,874 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -// CAMERA-0 Variables -var camera0Input; -var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; - -export default function cameraJSUnitCameraFormat(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJsUnitCameraFormat', function () { - console.info(TAG + '----------CameraJsUnitCameraFormat--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_0100 PASSED"); - } - } 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_CAMERA_MANAGER_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); - var cameraManagerPromise = await cameraObj.getCameraManager(null); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Get camera from cameramanager to get array of camera promise api - * @tc.desc : Get camera from cameramanager to get array of camera promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); - var camerasArrayPromise = await cameraManager.getCameras(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(camerasArrayPromise)); - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArrayPromise[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArrayPromise[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); - camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 camera0InputPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 - * @tc.name : get camera if from camera-0 input async api - * @tc.desc : get camera if from camera-0 input async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100', 0, async function (done) { - camera0Input.getCameraId(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 data is not null || undefined"); - var CameraId0 = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 PASSED with CameraID :" + CameraId0); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 - * @tc.name : get camera if from camera-0 input promise api - * @tc.desc : get camera if from camera-0 input promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100', 0, async function (done) { - var camera0IdPromise = await camera0InputPromise.getCameraId(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); - if (camera0IdPromise != null && camera0IdPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 camera0IdPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 PASSED" + camera0IdPromise); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_ID_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported video formats from camera-0 camerainput async api - * @tc.desc : Get supported video formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedVideoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 success"); - if (data != null && data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 - * @tc.name : Get supported video formats from camera-0 camerainput promise api - * @tc.desc : Get supported video formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_VIDEO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromise)); - if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromise.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromise: " + cam0FormatPromise[i]); - expect(cam0FormatPromise[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosBack)); - if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); - expect(cam0FormatPromisePosBack[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput async api - * @tc.desc : Get supported preview formats from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 success"); - if (data != null || data.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(1003); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 - * @tc.name : Get supported preview formats from camera-0 camerainput promise api - * @tc.desc : Get supported preview formats from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(1003); - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info("CameraModuleTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 - * @tc.name : Get supported photo format from camera-0 camerainput async api - * @tc.desc : Get supported photo format from camera-0 camerainput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100--------------"); - camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 data is not null || undefined"); - for (var i = 0; i < data.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 cameraFormat: " + data[i]); - expect(data[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 PASSED"); - } - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 FAILED: " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 - * @tc.name : Get supported photo format from camera-0 camerainput promise api - * @tc.desc : Get supported photo format from camera-0 camerainput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100--------------"); - var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100: " + JSON.stringify(cam0FormatPromisePosFront)); - if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 is not null || undefined"); - for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); - expect(cam0FormatPromisePosFront[i]).assertEqual(2000); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_PHOTO_FORMATS_PROMISE_0100 ends here"); - await sleep(1000); - done(); - }) - - - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); - camera0InputPromise.on("focusStateChange", async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE WIDE ANGLE*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype wide angle async api - * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100--------------"); - cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 success"); - var camInput = data; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 camInput: " + JSON.stringify(camInput)); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 FAILED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 PASSED: " + err.message); - expect(true).assertTrue(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 - * @tc.name : Create camerainput from cameraposition front & cameratype wide angle promise api - * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100--------------"); - await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) - .then(function () { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 PASSED : " + err.message); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets deleted file mode 100644 index 407b13482e0dcd7b1391e5f98c599b465fdc5bc4..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ /dev/null @@ -1,497 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import image from '@ohos.multimedia.image'; -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -const TAG = "CameraModuleTest: "; - -// Define global variables - -var cameraManager; -var surfaceId1; -var camerasArray; - -var camera0Input; - -export default function cameraJSUnitEnum(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(ms) { - console.info(TAG + "Entering sleep -> Promise constructor"); - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - describe('CameraJSUnitEnum', function () { - console.info(TAG + '----------CameraJSUnitEnum--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5000); - console.info('beforeEach case'); - }) - - afterEach(async function () { - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); - cameraObj.getCameraManager(null, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 data is not null || undefined"); - cameraManager = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); - cameraManager.getCameras(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); - camerasArray = data; - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); - var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); - var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); - var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); - } - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); - } - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100', 0, async function (done) { - console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100--------------"); - cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 data is not null || undefined"); - camera0Input = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 PASSED with CameraID :" + camerasArray[0].cameraId); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 ends here"); - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100 - * @tc.name : camera status ENAME - * @tc.desc : camera status ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100------------"); - console.info(TAG + "CameraStatus CAMERA_STATUS_APPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_APPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_APPEAR).assertEqual(0); - console.info(TAG + "CameraStatus CAMERA_STATUS_DISAPPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR); - expect(cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR).assertEqual(1); - console.info(TAG + "CameraStatus CAMERA_STATUS_AVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_AVAILABLE).assertEqual(2); - console.info(TAG + "CameraStatus CAMERA_STATUS_UNAVAILABLE : " + cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE) - expect(cameraObj.CameraStatus.CAMERA_STATUS_UNAVAILABLE).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100 - * @tc.name : Camera position ENAME - * @tc.desc : Camera position ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100------------") - console.info(TAG + "CameraPosition CAMERA_POSITION_BACK : " + cameraObj.CameraPosition.CAMERA_POSITION_BACK); - expect(cameraObj.CameraPosition.CAMERA_POSITION_BACK).assertEqual(1); - console.info(TAG + "CameraPosition CAMERA_POSITION_FRONT : " + cameraObj.CameraPosition.CAMERA_POSITION_FRONT); - expect(cameraObj.CameraPosition.CAMERA_POSITION_FRONT).assertEqual(2); - console.info(TAG + "CameraPosition CAMERA_POSITION_UNSPECIFIED : " + cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED); - expect(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED).assertEqual(0); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100 - * @tc.name : camera type ENAME - * @tc.desc : camera type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100------------") - console.info(TAG + "CameraType CAMERA_TYPE_UNSPECIFIED : " + cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); - expect(cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED).assertEqual(0); - console.info(TAG + "CameraType CAMERA_TYPE_WIDE_ANGLE : " + cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE); - expect(cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE).assertEqual(1); - console.info(TAG + 'CameraType CAMERA_TYPE_ULTRA_WIDE : ' + cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE); - expect(cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE).assertEqual(2); - console.info(TAG + 'CameraType CAMERA_TYPE_TELEPHOTO : ' + cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO); - expect(cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO).assertEqual(3); - console.info(TAG + 'CameraType CAMERA_TYPE_TRUE_DEPTH : ' + cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) - expect(cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH).assertEqual(4); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100 - * @tc.name : connection type ENAME - * @tc.desc : connection type ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100------------") - console.info(TAG + "ConnectionType CAMERA_CONNECTION_BUILT_IN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN).assertEqual(0); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_USB_PLUGIN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN).assertEqual(1); - console.info(TAG + "ConnectionType CAMERA_CONNECTION_REMOTE : " + cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE); - expect(cameraObj.ConnectionType.CAMERA_CONNECTION_REMOTE).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100 - * @tc.name : Flash Mode ENAME - * @tc.desc : Flash Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100------------") - console.info(TAG + "FlashMode FLASH_MODE_CLOSE : " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - console.info(TAG + "FlashMode FLASH_MODE_OPEN : " + cameraObj.FlashMode.FLASH_MODE_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - console.info(TAG + "FlashMode FLASH_MODE_AUTO : " + cameraObj.FlashMode.FLASH_MODE_AUTO); - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - console.info(TAG + "FlashMode FLASH_MODE_ALWAYS_OPEN : " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100 - * @tc.name : Focus Mode ENAME - * @tc.desc : Focus Mode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100------------") - console.info(TAG + "FocusMode FOCUS_MODE_MANUAL : " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0); - console.info(TAG + "FocusMode FOCUS_MODE_CONTINUOUS_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "FocusMode FOCUS_MODE_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "FocusMode FOCUS_MODE_LOCKED : " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - expect(cameraObj.FocusMode.FOCUS_MODE_LOCKED).assertEqual(3); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100 - * @tc.name : Focus State ENAME - * @tc.desc : Focus State ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100------------") - console.info(TAG + "FocusState FOCUS_STATE_SCAN : " + cameraObj.FocusState.FOCUS_STATE_SCAN); - expect(cameraObj.FocusState.FOCUS_STATE_SCAN).assertEqual(0); - console.info(TAG + "FocusState FOCUS_STATE_FOCUSED : " + cameraObj.FocusState.FOCUS_STATE_FOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_FOCUSED).assertEqual(1); - console.info(TAG + "FocusState FOCUS_STATE_UNFOCUSED : " + cameraObj.FocusState.FOCUS_STATE_UNFOCUSED); - expect(cameraObj.FocusState.FOCUS_STATE_UNFOCUSED).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100 - * @tc.name : Image Rotation ENAME - * @tc.desc : Image Rotation ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100------------") - console.info(TAG + "ImageRotation ROTATION_0 : " + cameraObj.ImageRotation.ROTATION_0); - expect(cameraObj.ImageRotation.ROTATION_0).assertEqual(0); - console.info(TAG + "ImageRotation ROTATION_90 : " + cameraObj.ImageRotation.ROTATION_90); - expect(cameraObj.ImageRotation.ROTATION_90).assertEqual(90); - console.info(TAG + "ImageRotation ROTATION_180 : " + cameraObj.ImageRotation.ROTATION_180); - expect(cameraObj.ImageRotation.ROTATION_180).assertEqual(180); - console.info(TAG + "ImageRotation ROTATION_270 : " + cameraObj.ImageRotation.ROTATION_270); - expect(cameraObj.ImageRotation.ROTATION_270).assertEqual(270); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100 - * @tc.name : Quality Level ENAME - * @tc.desc : Quality Level ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100------------") - console.info(TAG + "QualityLevel QUALITY_LEVEL_HIGH : " + cameraObj.QualityLevel.QUALITY_LEVEL_HIGH); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_HIGH).assertEqual(0); - console.info(TAG + "QualityLevel QUALITY_LEVEL_MEDIUM : " + cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM).assertEqual(1); - console.info(TAG + "QualityLevel QUALITY_LEVEL_LOW : " + cameraObj.QualityLevel.QUALITY_LEVEL_LOW); - expect(cameraObj.QualityLevel.QUALITY_LEVEL_LOW).assertEqual(2); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 - * @tc.name : CameraInputErrorCode ENAME - * @tc.desc : CameraInputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 : " + cameraObj.CameraInputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CameraInputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 - * @tc.name : CaptureSessionErrorCode ENAME - * @tc.desc : CaptureSessionErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_CAPTURESESSIONERRORCODE_0100 : " + cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN); - expect(cameraObj.CaptureSessionErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 - * @tc.name : PreviewOutputErrorCode ENAME - * @tc.desc : PreviewOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PREVIEWOUTPUTERRORCODE_0100 : " + cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PreviewOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 - * @tc.name : PhotoOutputErrorCode ENAME - * @tc.desc : PhotoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_PHOTOOUTPUTERRORCODE_0100 : " + cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.PhotoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 - * @tc.name : VideoOutputErrorCode ENAME - * @tc.desc : VideoOutputErrorCode ENAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100------------") - console.info(TAG + "QualityLevel SUB_MULTIMEDIA_VIDEOOUTPUTERRORCODE_0100 : " + cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN); - expect(cameraObj.VideoOutputErrorCode.ERROR_UNKNOWN).assertEqual(-1); - await sleep(1000); - done(); - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets deleted file mode 100644 index 571ca690ff89ac2fbd3becb18f81fc97bc447bf8..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ /dev/null @@ -1,3800 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera'; -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = "CameraModuleTest: "; -var cameraManager -var camerasArray -var camera0Input -var previewOutput -var photoOutputAsync -var videoRecorder -var surfaceId1 - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point = { x: 1, y: 1 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -let fdPath; -let fileAsset; -let fdNumber; -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/02.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var videoId -var videoOutput -var captureSession - -export default function cameraJSUnitVideoAsync(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('02.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModeAsync', function () { - console.info(TAG + '----------Camera-VideoMode-Async--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------') - await sleep(1) - cameraObj.getCameraManager(null, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Camera manager success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') - cameraManager = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - cameraManager.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManager is success"); - if (data != null || data != undefined) { - console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Camera status Callback FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_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 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------') - await sleep(1) - cameraManager.getCameras((err, data) => { - if (!err) { - console.info(TAG + 'Entering Get Cameras success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Get Cameras data is not null || undefined') - camerasArray = data - if (camerasArray != null && camerasArray.length > 0) { - for (var i = 0; i < camerasArray.length; i++) { - // Get the variables from camera object - var cameraId = camerasArray[i].cameraId - console.info(TAG + 'Entering Get Cameras camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArray[i].cameraPosition - console.info(TAG + 'Entering Get Cameras camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArray[i].cameraType - console.info(TAG + 'Entering Get Cameras camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArray[i].connectionType - console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined') - } - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 - * @tc.name : Create camerainput from camera-0 cameraId async api - * @tc.desc : Create camerainput from camera-0 cameraId async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { - console.info('--------------CAMERA-0 STARTS HERE--------------') - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------') - await sleep(1) - cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + 'Entering Create camera input data is not null || undefined') - camera0Input = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :' + camerasArray[0].cameraId) - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0Input.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0Input error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 - * @tc.name : Create previewoutput async api - * @tc.desc : Create previewoutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createPreviewOutput(surfaceId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create preview output success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create preview output data is not null || undefined') - previewOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Preview output callback on error api - * @tc.desc : Preview output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - previewOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Create PhotoOutput instance api - * @tc.desc : Create PhotoOutput instance api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - cameraObj.createPhotoOutput(surfaceId1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering createPhotoOutput success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); - photoOutputAsync = data; - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputAsync.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Error during PhotoOutput with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 - * @tc.name : Create videooutput async api - * @tc.desc : Create videooutput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 to operate') - await getvideosurface() - await sleep(2) - cameraObj.createVideoOutput(videoId, (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create videooutput success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create videooutput data is not null || undefined') - videoOutput = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 PASSED') - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "VideoOutput Errorcallback is success") - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 - * @tc.name : Create capturesession async api - * @tc.desc : Create capturesession async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate') - await sleep(1) - cameraObj.createCaptureSession(null, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering Create capturesession success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering Create capturesession data is not null || undefined') - captureSession = data - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail() - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback on error api - * @tc.desc : CaptureSession callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate"); - captureSession.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 - * @tc.name : Begin Config async api - * @tc.desc : Begin Config async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering Begin Config captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.beginConfig((err, data) => { - if (!err) { - console.info(TAG + 'Entering Begin Config success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput preview success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput video success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 ends here') - await sleep(1); - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeInput(camera0Input, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove input success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove Input FAILED" + err.message); - console.info(TAG + "Entering Remove Input ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(previewOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove preview Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove preview Output FAILED" + err.message); - console.info(TAG + "Entering Remove Preview Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove photo Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering Remove photo Output FAILED" + err.message); - console.info(TAG + "Entering Remove photo Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - } - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); - captureSession.removeOutput(videoOutput, async (err, data) => { - if (!err) { - console.info(TAG + "Entering remove video Output success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering Remove video Output FAILED" + err.message); - console.info(TAG + "Entering Remove video Output ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 - * @tc.name : AddInput async api - * @tc.desc : AddInput async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddInput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addInput(camera0Input, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddInput success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 - * @tc.name : AddOutput preview async api - * @tc.desc : AddOutput preview async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(previewOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 to operate"); - captureSession.addOutput(photoOutputAsync, async (err, data) => { - if (!err) { - console.info(TAG + "Entering AddOutput_Photo success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 - * @tc.name : AddOutput video async api - * @tc.desc : AddOutput video async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering AddOutput captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 to operate') - await sleep(1) - captureSession.addOutput(videoOutput, (err, data) => { - if (!err) { - console.info(TAG + 'Entering AddOutput success') - console.info(TAG + 'Entering AddOutput data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 ends here') - done() - }) - await sleep(1) - done() - } - }) - - //framerate - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 to operate"); - videoOutput.getFrameRateRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get frame rate range success"); - expect(true).assertTrue(); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api_err - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED") - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range FAILED"); - expect().assertFail(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 to operate"); - videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { - if (!err) { - console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); - console.info(TAG + "Entering set frame rate range PASSED") - expect(true).assertTrue(); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Off success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLOw async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode low success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1) - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeMedium - * @tc.desc : getVideoStabilizationModeMedium async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode medium success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode High success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 to operate"); - captureSession.getActiveVideoStabilizationMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering get Video Stabilization Mode Auto success"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 - * @tc.name : CommitConfig async api - * @tc.desc : CommitConfig async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 to operate') - await sleep(1) - captureSession.commitConfig(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CommitConfig success') - console.info(TAG + 'Entering CommitConfig data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0Input.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //callback API - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : Preview capture callback on frame end api - * @tc.desc : Preview capture callback on frame end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate"); - previewOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "Photo Capture Callback on CaptureStart is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputAsync.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputAsync.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "frameShutter callback with captureId: " + data.captureId); - console.info(TAG + "frameShutter callback with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - videoOutput.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutput.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success'); - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 - * @tc.name : CaptureSession start async api - * @tc.desc : CaptureSession start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 to operate") - await sleep(1) - captureSession.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering CaptureSession start success") - expect(true).assertTrue() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 PASSED") - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "hasFlash called.") - camera0Input.hasFlash(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 is: " + data); - expect(data).assertEqual(true); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 ends here"); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 success"); - if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 success"); - if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode auto is supported-camera0Input api - * @tc.desc : check if flash mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 success"); - if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 PASSED"); - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); - camera0Input.getFlashMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 success"); - if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 data is not null || undefined: "); - expect(true).assertTrue(); - console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED"); - } - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 - * @tc.name : get zoom ratio camera-0 cameraId api - * @tc.desc : get zoom ratio camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100--------------"); - camera0Input.getZoomRatioRange(async (err, data) => { - if (!err) { - if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 Success " + data) - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 FAILED: " + err.message); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(1, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_1_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(2, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 PASSED "); - } - else { - expect().assertFail(); - console.info(TAG + "GET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - } else { - expect().assertFail(); - console.info(TAG + "SET_ZOOM_2_ASYNC FAILED" + err.message); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(3, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_3_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(4, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_4_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(5, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_5_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100', 0, async function (done) { - camera0Input.setZoomRatio(6, (err, data) => { - if (!err) { - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - camera0Input.getZoomRatio((err, data1) => { - if (!err) { - console.info(TAG + "getZoomRatio success : " + data1); - expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 PASSED "); - } - else { - console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - } else { - console.info(TAG + "SET_ZOOM_6_ASYNC FAILED" + err.message); - expect().assertFail(); - } - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode locked is supported-camera0Input api - * @tc.desc : check if focus mode locked is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); - if (data != null || data != undefined) { - console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); - expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : ") - expect().assertFail(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); - console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode manual is supported-camera0Input api - * @tc.desc : check if focus mode manual is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 FAILED " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode continuous is supported-camera0Input api - * @tc.desc : check if focus mode continuous is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : set focus Point locked camera0 api - * @tc.desc : set focus Point locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 - * @tc.name : check if focus mode auto is supported-camera0Input api - * @tc.desc : check if focus mode auto is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); - camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 SUCCESS "); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); - expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED: "); - } - } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (data != null || data != undefined) { - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED") - } - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getFocusMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); - console.info(TAG + "Current FocusMode is: " + data); - expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.setFocusPoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 to operate"); - camera0Input.getFocusPoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); - console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100_exposure mode continuous auto - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 to operate"); - camera0Input.getExposureBiasRange(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias range SUCCESS"); - console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 to operate"); - camera0Input.setExposureBias(-4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure Mode SUCCESS"); - console.info(TAG + "Get Exposure Mode data is not null || undefined: "); - console.info(TAG + "Current ExposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 to operate"); - camera0Input.setExposureBias(1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 to operate"); - camera0Input.getExposureMode(async (err, data) => { - if (!err) { - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.setExposurePoint(Point, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 - * @tc.name : get exposure point camera0 api - * @tc.desc : get exposure point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 to operate"); - camera0Input.getExposurePoint(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure point SUCCESS"); - console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 to operate"); - camera0Input.setExposureBias(4, async (err, data) => { - if (!err) { - console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 PASSED") - expect(true).assertTrue(); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 - * @tc.name : get exposure bias value camera0 api - * @tc.desc : get exposure bias value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 to operate"); - camera0Input.getExposureValue(async (err, data) => { - if (!err) { - console.info(TAG + "Entering Get Exposure bias value SUCCESS"); - console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 to operate"); - photoOutputAsync.isMirrorSupported(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 to operate"); - photoOutputAsync.setMirror(true, async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - } else { - expect().assertFail(); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 - * @tc.name : VideoOutput start async api - * @tc.desc : VideoOutput start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 videoOutput == null || undefined") - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 to operate") - await sleep(1) - videoOutput.start(async (err, data) => { - if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 success: " + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 FAILED: " + err.message) - } - }) - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 - * @tc.name : VideoRecorder start async api - * @tc.desc : VideoRecorder start async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 to operate') - videoRecorder.start() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 called'); - sleep(3); - console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') - photoOutputAsync.capture(photosettings1) - console.info(TAG + 'Capture during Video - End.') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 - * @tc.name : VideoOutput stop async api - * @tc.desc : VideoOutput stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 to operate') - videoOutput.stop(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 success: ' + JSON.stringify(data)) - if (data == undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 FAILED: ' + err.message) - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 - * @tc.name : VideoRecorder stop async api - * @tc.desc : VideoRecorder stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) { - if (videoRecorder == null || videoRecorder == undefined) { - console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 to operate') - videoRecorder.stop() - console.info(TAG + 'VideoRecorder stop stopVideo done.') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 PASSED') - expect(true).assertTrue() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 - * @tc.name : CaptureSession stop async api - * @tc.desc : CaptureSession stop async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 to operate') - await sleep(1) - captureSession.stop((err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession stop success') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 PASSED') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 ends here') - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 - * @tc.name : CaptureSession release async api - * @tc.desc : CaptureSession release async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100', 0, async function (done) { - if (captureSession == null || captureSession == undefined) { - console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 to operate') - await sleep(1) - captureSession.release(async (err, data) => { - if (!err) { - console.info(TAG + 'Entering CaptureSession release success') - if (data != null || data != undefined) { - console.info(TAG + 'Entering CaptureSession release data is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 PASSED') - } - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 FAILED: ' + err.message) - expect().assertFail(); - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 ends here') - await sleep(1) - done() - }) - await sleep(1) - done() - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : videooutput release api - * @tc.desc : videooutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - videoOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering videooutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering videooutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : previewOutput release api - * @tc.desc : previewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - previewOutput.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering previewOutput.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering previewOutput.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering previewOutput.release PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering previewOutput.release ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 - * @tc.name : photoOutput release api - * @tc.desc : photoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 photoOutputAsync == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 to operate"); - photoOutputAsync.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutputAsync.release success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 PASSED"); - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering photoOutputAsync.release ends here"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 - * @tc.name : camera Input release api - * @tc.desc : camera Input release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { - if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); - camera0Input.release(async (err, data) => { - if (!err) { - console.info(TAG + "Entering camera0Input.release success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering camera0Input.release data is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); - await sleep(1); - done(); - } - }) - await sleep(1); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets deleted file mode 100644 index aa4466c90fbcc0482aff18bd91e25e3ae39d7b27..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ /dev/null @@ -1,3367 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import cameraObj from '@ohos.multimedia.camera' -import media from '@ohos.multimedia.media' -import image from '@ohos.multimedia.image'; -import mediaLibrary from '@ohos.multimedia.mediaLibrary' -import fileio from '@ohos.fileio'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import bundle from '@ohos.bundle' - -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; - -let TAG = 'CameraModuleTest: ' -var cameraManagerPromise -var camerasArrayPromise -var camera0InputPromise -var previewOutputPromise -var videoRecorder -var photoOutputPromise -let fdPath; -let fileAsset; -let fdNumber; - -var minFrameRate_Grp0=12; -var maxFrameRate_Grp0=12; -var minFrameRate_Mix=14; -var maxFrameRate_Mix=15; -var minFrameRate_Err1=11; -var maxFrameRate_Err1=31; -var minFrameRate_Err2=14; -var maxFrameRate_Err2=28; -var minFrameRate_Err3=16; -var maxFrameRate_Err3=25; -var minFrameRate_Grp20=30; -var maxFrameRate_Grp20=30; - -var Point1 = { x: 1, y: 1 } -var Point2 = { x: 2, y: 2 } -var Point3 = { x: 3, y: 3 } -var photosettings1 = { - rotation: 0, - quality: 0, - location: { - latitude: 12.9705, - longitude: 77.7329, - altitude: 920.0000, - }, -} -var photosettings2 = { - rotation: 90, - quality: 1, - location: { - latitude: 20, - longitude: 78, - altitude: 8586, - }, -} - -var photosettings3 = { - quality: 2, - location: { - latitude: 0, - longitude: 0, - altitude: 0, - }, -} -var photosettings4 = { - rotation: 180, - location: { - latitude: -1, - longitude: -1, - altitude: -1, - }, -} - -var photosettings5 = { - rotation: 270, -} -let configFile = { - audioBitrate: 48000, - audioChannels: 2, - audioCodec: 'audio/mp4a-latm', - audioSampleRate: 48000, - durationTime: 1000, - fileFormat: 'mp4', - videoBitrate: 48000, - videoCodec: 'video/mp4v-es', - videoFrameWidth: 640, - videoFrameHeight: 480, - videoFrameRate: 30 -} - -let videoConfig = { - audioSourceType: 1, - videoSourceType: 0, - profile: configFile, - url: 'file:///data/media/01.mp4', - orientationHint: 0, - location: { latitude: 30, longitude: 130 }, - maxSize: 100, - maxDuration: 500 -} -var surfaceId1 -var videoId -var videoOutputPromise -var captureSessionPromise - -export default function cameraJSUnitVideoPromise(surfaceId: any) { - - async function getImageReceiverSurfaceId() { - console.log(TAG + 'Entering create Image receiver') - var receiver = image.createImageReceiver(640, 480, 4, 8) - console.log(TAG + 'before receiver check') - if (receiver !== undefined) { - console.log(TAG + 'Receiver is ok') - surfaceId1 = await receiver.getReceivingSurfaceId() - console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) - } else { - console.log(TAG + 'Receiver is not ok') - } - } - - function sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(1) - }, time * 1000) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - async function applyPermission() { - let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); - let atManager = abilityAccessCtrl.createAtManager(); - if (atManager != null) { - let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); - let permissionName1 = 'ohos.permission.CAMERA'; - let permissionName2 = 'ohos.permission.MICROPHONE'; - let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; - let permissionName4 = 'ohos.permission.READ_MEDIA'; - let permissionName5 = 'ohos.permission.WRITE_MEDIA'; - await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); - }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); - }); - await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); - } - } - - async function getFd(pathName) { - let displayName = pathName; - const mediaTest = mediaLibrary.getMediaLibrary(); - let fileKeyObj = mediaLibrary.FileKey; - let mediaType = mediaLibrary.MediaType.VIDEO; - 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); - fileAsset = await fetchFileResult.getAllObject(); - fdNumber = await fileAsset[0].open('Rw'); - fdPath = "fd://" + fdNumber.toString(); - } - } - - async function closeFd() { - if (fileAsset != null) { - await fileAsset[0].close(fdNumber).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'); - } - } - - async function getvideosurface() { - await getFd('01.mp4'); - 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') - videoId = id - console.info(TAG + 'getInputSurface surfaceId: ' + JSON.stringify(videoId)) - }) - }) - } - - describe('VideoModePromise', function () { - console.info(TAG + '----------Camera-VideoMode-Promise--------------') - - beforeAll(async function () { - await applyPermission(); - console.info('beforeAll case'); - }) - - beforeEach(function () { - sleep(5); - console.info('beforeEach case'); - }) - - afterEach(async function () { - await closeFd(); - console.info('afterEach case'); - }) - - afterAll(function () { - console.info('afterAll case'); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------') - cameraManagerPromise = await cameraObj.getCameraManager(null) - console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) - if (cameraManagerPromise != null && cameraManagerPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 - * @tc.name : camera status callback on CameraManager async api - * @tc.desc : camera status callback on CameraManager async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { - if (cameraManagerPromise == null || cameraManagerPromise == undefined) { - console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') - await sleep(1) - cameraManagerPromise.on('cameraStatus', async (err, data) => { - if (!err) { - console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Status: " + data.status); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 - * @tc.name : Create camera manager instance promise api - * @tc.desc : Create camera manager instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------') - camerasArrayPromise = await cameraManagerPromise.getCameras() - console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) - if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { - console.info(TAG + 'Entering Get Cameras Promise success') - for (var i = 0; i < camerasArrayPromise.length; i++) { - // Get the variables from camera object - var cameraId = camerasArrayPromise[i].cameraId - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Id: ' + cameraId) - var cameraPosition = camerasArrayPromise[i].cameraPosition - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Position: ' + cameraPosition) - var cameraType = camerasArrayPromise[i].cameraType - console.info(TAG + 'Entering Get Cameras Promise camera' + i + 'Type: ' + cameraType) - var connectionType = camerasArrayPromise[i].connectionType - console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) - } - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /*CAMERA-0 Scripts*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 - * @tc.name : Create camerainput from camera-0 cameraId promise api - * @tc.desc : Create camerainput from camera-0 cameraId promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------') - camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) - console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) - if (camera0InputPromise != null && camera0InputPromise != undefined) { - console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); - camera0InputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "camera0InputPromise error callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 - * @tc.name : Create previewoutput promise api - * @tc.desc : Create previewoutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100--------------') - previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) - console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) - if (previewOutputPromise != null && previewOutputPromise != undefined) { - console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') - expect(true).assertTrue(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 ends here') - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : FocusStateChange callback api - * @tc.desc : FocusStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('focusStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "FocusState callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current FocusState is : " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 - * @tc.name : ExposureStateChange callback api - * @tc.desc : ExposureStateChange callback api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); - camera0InputPromise.on('exposureStateChange', async (err, data) => { - if (!err) { - console.info(TAG + "ExposureStateChange callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "Current ExposureStateChange is: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : PreviewOutput callback onerror async api - * @tc.desc : PreviewOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 - * @tc.name : Create videooutput promise api - * @tc.desc : Create videooutput promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 to operate') - await getvideosurface() - await sleep(2) - videoOutputPromise = await cameraObj.createVideoOutput(videoId) - console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) - if (videoOutputPromise != null && videoOutputPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 PASSED') - } else { - expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : VideoOutput callback onerror async api - * @tc.desc : VideoOutput callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + 'VideoOutput Errorcallback is success') - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1) - done() - }) - await sleep(1) - done(); - } - }) - - /*PhotoOutput APIs test script*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Create PhotoOutput instance promise api - * @tc.desc : Create PhotoOutput instance promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - console.info(TAG + 'Entering getImageReceiverSurfaceId') - await getImageReceiverSurfaceId() - await sleep(1) - photoOutputPromise = await cameraObj.createPhotoOutput(surfaceId1); - console.info(TAG + "Entering createPhotoOutput success"); - if (photoOutputPromise != null || photoOutputPromise != undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering createPhotoOutput ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 - * @tc.name : Photo output callback on error api - * @tc.desc : Photo output callback on error api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); - photoOutputPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + "PhotoOutputError callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 - * @tc.name : Create capturesession promise api - * @tc.desc : Create capturesession promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate') - captureSessionPromise = await cameraObj.createCaptureSession(null) - console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) - if (captureSessionPromise != null && captureSessionPromise != undefined) { - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED') - } else { - expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED') - } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here'); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 - * @tc.name : CaptureSession callback onerror async api - * @tc.desc : CaptureSession callback onerror async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate') - await sleep(1) - captureSessionPromise.on('error', async (err, data) => { - if (!err) { - console.info(TAG + " captureSession errorcallback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /*CaptureSession APIs*/ - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : CaptureSession_Begin config promise api - * @tc.desc : CaptureSession_Begin config promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Create captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.beginConfig(); - console.info(TAG + "Entering beginConfig success:"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add Input captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering Add Input success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add preview output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering Add preview output : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 FAILED : "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add video output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering Add video output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering Add output with photo output success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 - * @tc.name : remove input api - * @tc.desc : remove input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove preview Output api - * @tc.desc : Remove preview Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove photo Output api - * @tc.desc : Remove photo Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 - * @tc.name : Remove video Output api - * @tc.desc : Remove video Output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); - const Promise = await captureSessionPromise.removeOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 - * @tc.name : Add Input with camera0Input api - * @tc.desc : Add Input with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 to operate"); - const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput success"); - if (Promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 - * @tc.name : Add output with camera0Input api - * @tc.desc : Add output with camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 : Success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 FAILED"); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 - * @tc.name : Add output with photo output api - * @tc.desc : Add output with photo output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 FAILED "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 - * @tc.name : Add output with video output api - * @tc.desc : Add output with video output api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 to operate"); - const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 FAILED: "); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 - * @tc.name : get frame rate range camera0 api - * @tc.desc : get frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 to operate"); - await videoOutputPromise.getFrameRateRange() - .then(function (data) { - console.info(TAG + "Entering get frame rate range SUCCESS "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 PASSED : " + JSON.stringify(data)) - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 FAILED"); - }) - .catch((err) => { - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 PASSED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 - * @tc.name : set frame rate range camera0 api - * @tc.desc : set frame rate range promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 to operate"); - await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) - .then(function (data) { - console.info(TAG + "Entering setFrameRateRange SUCCESS"); - console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 - * @tc.name : getVideoStabilizationModeOff - * @tc.desc : getVideoStabilizationModeOff promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 - * @tc.name : getVideoStabilizationModeLow - * @tc.desc : getVideoStabilizationModeLow promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 - * @tc.name : getVideoStabilizationModeMIDDLE - * @tc.desc : getVideoStabilizationModeMIDDLE promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 - * @tc.name : getVideoStabilizationModeHigh - * @tc.desc : getVideoStabilizationModeHigh promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 - * @tc.name : getVideoStabilizationModeAuto - * @tc.desc : getVideoStabilizationModeAuto promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 to operate"); - await captureSessionPromise.getActiveVideoStabilizationMode() - .then(function (data){ - console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); - console.info(TAG + "Current VideoStabilizationMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 - * @tc.name : commit config api - * @tc.desc : commit config api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering Commit config captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 to operate"); - const promise = await captureSessionPromise.commitConfig(); - console.info(TAG + "Entering commitConfig success"); - if (promise == undefined) { - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig PASSED"); - } - else { - expect().assertFail() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig ends here"); - } - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : Preview output callback on frame start api - * @tc.desc : Preview output callback on frame start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); - previewOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : PreviewOutput callback onframeend async api - * @tc.desc : PreviewOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 previewOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - previewOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + "PreviewStop frameEnd Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 - * @tc.name : VideoOutput callback onframestart async api - * @tc.desc : VideoOutput callback onframestart async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameStart', async (err, data) => { - if (!err) { - console.info(TAG + "Video frameStart Callback is success"); - if (data != null || data != undefined) { - expect(true).assertTrue(); - } - } else { - expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 - * @tc.name : VideoOutput callback onframeend async api - * @tc.desc : VideoOutput callback onframeend async api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') - await sleep(1) - videoOutputPromise.on('frameEnd', async (err, data) => { - if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success') - if (data != null || data != undefined) { - expect(true).assertTrue() - } - } else { - expect().assertFail() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message) - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - //Capture callback - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 - * @tc.name : Photo capture callback on capture start api - * @tc.desc : Photo capture callback on capture start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureStart', async (err, data) => { - if (!err) { - console.info(TAG + "CaptureStart Callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 - * @tc.name : Photo capture callback on capture end api - * @tc.desc : Photo capture callback on capture end api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); - photoOutputPromise.on('captureEnd', async (err, data) => { - if (!err) { - console.info(TAG + "captureEnd callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "captureEnd callback with captureId: " + data.captureId); - console.info(TAG + "captureEnd callback with frameCount: " + data.frameCount); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 - * @tc.name : Photo capture callback on frame shutter api - * @tc.desc : Photo capture callback on frame shutter api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); - photoOutputPromise.on('frameShutter', async (err, data) => { - if (!err) { - console.info(TAG + "frameShutter callback is success"); - if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with timestamp: " + data.timestamp); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); - } - await sleep(1); - done(); - }) - await sleep(1); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 - * @tc.name : capture session start api - * @tc.desc : capture session start api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering capture session start captureSession == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 to operate"); - await captureSessionPromise.start(); - console.info(TAG + "Entering captureSession start success"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 - * @tc.name : isMirrorSupported - * @tc.desc : isMirrorSupported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 to operate"); - await photoOutputPromise.isMirrorSupported() - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 is success"); - console.info(TAG + "isMirrorSupported : " + data); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 - * @tc.name : setMirror true - * @tc.desc : setMirror true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100', 0, async function (done) { - if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 to operate"); - await photoOutputPromise.setMirror(true) - .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 is success:"); - console.info(TAG + "setMirror is : " + 'True'); - expect(true).assertTrue(); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 FAILED : " + err.message); - }); - await sleep(1); - done(); - } - await sleep(1); - done(); - }) - - //FLASH Function API scripts - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 - * @tc.name : check if has flash-camera0Input api - * @tc.desc : check if has flash-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100--------------"); - console.info(TAG + 'hasFlash called.') - var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 success"); - if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 is: " + JSON.stringify(hasFlashPromise)); - expect(hasFlashPromise).assertEqual(true); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 FAILED : "); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 ends here"); - await sleep(1) - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode open is supported-camera0Input api - * @tc.desc : check if flash mode open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); - expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : set flash mode open camera0 api - * @tc.desc : set flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) - if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 - * @tc.name : get flash mode open camera0 api - * @tc.desc : get flash mode open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); - var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 success: " + JSON.stringify(GetFMOpen)); - if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 to operate"); - var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); - console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); - expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : set flash mode always open camera0 api - * @tc.desc : set flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) - if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 - * @tc.name : get flash mode always open camera0 api - * @tc.desc : get flash mode always open camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); - var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 success"); - if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode always open is supported-camera0Input api - * @tc.desc : check if flash mode always open is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMAutoSupported != null || isFMAutoSupported != undefined) { - console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); - console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); - expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : set flash mode auto camera0 api - * @tc.desc : set flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) - if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 - * @tc.name : get flash mode auto camera0 api - * @tc.desc : get flash mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); - var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 success"); - if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMAuto); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 - * @tc.name : check if flash mode close is supported-camera0Input api - * @tc.desc : check if flash mode close is supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 to operate"); - var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 SUCCESS "); - if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); - expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : set flash mode close camera0 api - * @tc.desc : set flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) - if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED") - expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 - * @tc.name : get flash mode close camera0 api - * @tc.desc : get flash mode close camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); - var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 success"); - if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 data is not null || undefined: "); - console.info(TAG + "Current FlashMode is: " + GetFMClose); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - //ZOOM Function - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 - * @tc.name : get zoom ratio camera-0 cameraId api promise api - * @tc.desc : get zoom ratio camera-0 cameraId api promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100--------------"); - var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); - if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 setZoomRatioPromise is not null || undefined"); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 PASSED"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 FAILED"); - expect().assertFail(); - } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(1); - console.info(TAG + "setZoomRatio success: 1"); - console.info(TAG + "getZoomRatio called") - var getpromise1 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise1); - if (getpromise1 != null && getpromise1 != undefined) { - expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(2); - console.info(TAG + "setZoomRatio success: 2"); - console.info(TAG + "getZoomRatio called") - var getpromise2 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise2); - if (getpromise2 != null && getpromise2 != undefined) { - expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(3); - console.info(TAG + "setZoomRatio success: 3"); - console.info(TAG + "getZoomRatio called") - var getpromise3 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise3); - if (getpromise3 != null && getpromise3 != undefined) { - expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(4); - console.info(TAG + "setZoomRatio success: 4"); - console.info(TAG + "getZoomRatio called") - var getpromise4 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise4); - if (getpromise4 != null && getpromise4 != undefined) { - expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(5); - console.info(TAG + "setZoomRatio success: 5"); - console.info(TAG + "getZoomRatio called") - var getpromise5 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise5); - if (getpromise5 != null && getpromise5 != undefined) { - expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 - * @tc.name : Zoom camera-0 cameraId api - * @tc.desc : Zoom camera-0 cameraId api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { - var setpromise = await camera0InputPromise.setZoomRatio(6); - console.info(TAG + "setZoomRatio success: 6"); - console.info(TAG + "getZoomRatio called") - var getpromise6 = await camera0InputPromise.getZoomRatio(); - console.info(TAG + "getZoomRatio success: " + getpromise6); - if (getpromise6 != null && getpromise6 != undefined) { - expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); - expect().assertFail(); - } - await sleep(1); - done(); - }) - - // FOCUS promise API's - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode locked supported-camera0Input api - * @tc.desc : check is focus mode locked supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 to operate"); - var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering is focus mode locked supported SUCCESS "); - if (isFMLockedSupported != null || isFMLockedSupported != undefined) { - console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); - console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); - expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 PASSED"); - } - else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : set focus mode locked camera0 api - * @tc.desc : set focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) - .then(function (data) { - console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : ") - expect().assertFail(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED : " + err.message); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 - * @tc.name : get focus mode locked camera0 api - * @tc.desc : get focus mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode locked success: "); - if (data == 0) { - console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 - * @tc.name : get focal length camera0 api - * @tc.desc : get focal length camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 to operate"); - await camera0InputPromise.getFocalLength() - .then(function (data) { - console.info(TAG + "Current focallength is: " + JSON.stringify(data)); - expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 - * @tc.name : is focusmode manual supported - * @tc.desc : is focusmode manual supported - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 to operate"); - var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); - if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { - console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); - expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : set focus mode manual camera0 api - * @tc.desc : set focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) - .then(function (data) { - console.info(TAG + "setFocusManual: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 - * @tc.name : get focus mode manual camera0 api - * @tc.desc : get focus mode manual camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode manual SUCCESS"); - if (data == 0) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); - }); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 FAILED " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode continuous supported-camera0Input api - * @tc.desc : check is focus mode continuous supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 to operate"); - var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); - console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); - expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : set focus mode continuous camera0 api - * @tc.desc : set focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) - .then(function (data) { - console.info(TAG + "setFocusCont: " + JSON.stringify(data)) - console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 - * @tc.name : get focus mode continuous camera0 api - * @tc.desc : get focus mode continuous camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); - await camera0InputPromise.getFocusMode() - .then(function (data) { - console.info(TAG + "Entering get focus mode continuous SUCCESS"); - if (data == 1) { - console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED"); - } - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 - * @tc.name : check is focus mode auto supported-camera0Input api - * @tc.desc : check is focus mode auto supported-camera0Input api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); - var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); - if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { - console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); - console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); - expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED: "); - } - else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : set focus mode auto camera0 api - * @tc.desc : set focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) - .then(function () { - console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) - console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED") - expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 - * @tc.name : get focus mode auto camera0 api - * @tc.desc : get focus mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); - var getfocusmodepromise = await camera0InputPromise.getFocusMode(); - console.info(TAG + "Entering get focus mode auto SUCCESS"); - if (getfocusmodepromise == 2) { - console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED"); - } - else { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); - } - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 - * @tc.name : set focus Point camera0 api - * @tc.desc : set focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering set focus mode locked to operate"); - await camera0InputPromise.setFocusPoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 PASSED"); - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 - * @tc.name : get focus Point camera0 api - * @tc.desc : get focus Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getFocusPoint() - .then(function (data) { - console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 - * @tc.name : get exposure mode locked camera0 api - * @tc.desc : get exposure mode locked camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode locked SUCCESS"); - console.info(TAG + "Current ExposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.setExposurePoint(Point1) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 mode locked - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100_exposure mode locked - * @tc.name : get exposure bias range camera0 api - * @tc.desc : get exposure bias range camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureBiasRange() - .then(function (data) { - console.info(TAG + "Entering getExposureBiasRange SUCCESS"); - console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 mode locked - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 to operate"); - await camera0InputPromise.setExposureBias(-4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 mode locked - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 - * @tc.name : get exposure mode auto camera0 api - * @tc.desc : get exposure mode auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.setExposurePoint(Point2) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 mode auto - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 mode auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 to operate"); - await camera0InputPromise.setExposureBias(1) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 mode auto - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 - * @tc.name : get exposure mode continuous auto camera0 api - * @tc.desc : get exposure mode continuous auto camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 to operate"); - await camera0InputPromise.getExposureMode() - .then(function (data) { - console.info(TAG + "Entering get exposure mode auto SUCCESS"); - console.info(TAG + "Current exposureMode is: " + data); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : set exposure Point camera0 api - * @tc.desc : set exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.setExposurePoint(Point3) - .then(function (data) { - console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 - * @tc.name : get exposure Point camera0 api - * @tc.desc : get exposure Point camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 to operate"); - await camera0InputPromise.getExposurePoint() - .then(function (data) { - console.info(TAG + "Entering getExposurePoint SUCCESS"); - console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); - expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 mode continuous auto - * @tc.name : set exposure bias camera0 api - * @tc.desc : set exposure bias camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 to operate"); - await camera0InputPromise.setExposureBias(4) - .then(function (data) { - console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 PASSED") - expect(true).assertTrue(); - }) - .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 FAILED : " + err.message); - expect().assertFail(); - }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 - * @tc.name : get exposure value camera0 api - * @tc.desc : get exposure value camera0 api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 to operate"); - await camera0InputPromise.getExposureValue() - .then(function (data) { - console.info(TAG + "Entering getExposureValue SUCCESS"); - console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); - expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 PASSED"); - }) - .catch((err) => { - expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 FAILED : " + err.message); - }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 ends here"); - await sleep(1); - done(); - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 - * @tc.name : VideoOutput start promise api - * @tc.desc : VideoOutput start promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 to operate') - await videoOutputPromise.start() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 - * @tc.name : VideoOutput stop promise api - * @tc.desc : VideoOutput stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 to operate') - await videoOutputPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 - * @tc.name : CaptureSession stop promise api - * @tc.desc : CaptureSession stop promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 to operate') - await captureSessionPromise.stop() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 - * @tc.name : CaptureSession release promise api - * @tc.desc : CaptureSession release promise api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100', 0, async function (done) { - if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') - } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 to operate') - await captureSessionPromise.release() - expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 ends here') - await sleep(1) - done() - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : videoOutput release api - * @tc.desc : videoOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await videoOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : PreviewOutput release api - * @tc.desc : PreviewOutput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await previewOutputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 - * @tc.name : cameraInput release api - * @tc.desc : cameraInput release api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { - if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); - await camera0InputPromise.release(); - expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); - await sleep(1); - done(); - } - await sleep(1) - done() - }) - }) -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/resources/base/element/string.json b/multimedia/camera/cameraWideAngleRK/src/main/resources/base/element/string.json deleted file mode 100644 index b93f540e29265a34f883a977c442fa85349b94ca..0000000000000000000000000000000000000000 --- a/multimedia/camera/cameraWideAngleRK/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/camera/cameraWideAngleRK/src/main/resources/base/media/icon.png b/multimedia/camera/cameraWideAngleRK/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/multimedia/camera/cameraWideAngleRK/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/multimedia/camera/cameraUnspc/BUILD.gn b/multimedia/camera/camera_js_standard/BUILD.gn similarity index 89% rename from multimedia/camera/cameraUnspc/BUILD.gn rename to multimedia/camera/camera_js_standard/BUILD.gn index bfda218c07ea11ee8bd6c07df2f8cdbf6f274809..21272074965d41b6d1bd0f2363476e32b8215e1b 100644 --- a/multimedia/camera/cameraUnspc/BUILD.gn +++ b/multimedia/camera/camera_js_standard/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("camera_unspc_ets_hap") { +ohos_js_hap_suite("camera_standard_ets_hap") { hap_profile = "./src/main/config.json" deps = [ ":camera_ets_assets", @@ -21,9 +21,9 @@ ohos_js_hap_suite("camera_unspc_ets_hap") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsCameraUnspcETSTest" + hap_name = "ActsCameraStandardETSTest" subsystem_name = "multimedia" - part_name = "multimedia_camera_framework" + part_name = "multimedia_camera_standard" } ohos_js_assets("camera_ets_assets") { source_dir = "./src/main/ets/MainAbility" diff --git a/multimedia/camera/cameraUnspc/Test.json b/multimedia/camera/camera_js_standard/Test.json similarity index 60% rename from multimedia/camera/cameraUnspc/Test.json rename to multimedia/camera/camera_js_standard/Test.json index 33822703896da4c78c8e3680c235e8cb7b269f50..3fd2d5eef616abf4458239e7f0dfea64939c35f7 100644 --- a/multimedia/camera/cameraUnspc/Test.json +++ b/multimedia/camera/camera_js_standard/Test.json @@ -1,18 +1,16 @@ { - "description": "Configuration for camerastandard unspc Tests", + "description": "Configuration for camerastandard Tests", "driver": { "type": "JSUnitTest", "test-timeout": "1000000", - "package": "com.open.harmony.multimedia.cameraunspctest", + "package": "com.open.harmony.multimedia.cameratest", "shell-timeout": "60000" }, "kits": [ { "type": "ShellKit", "run-command": [ - "touch /data/media/01.mp4", - "chmod -R 777 /data/media" - + "rm -rf /storage/media/100/local/files/Videos/*" ], "teardown-command":[ @@ -20,7 +18,7 @@ }, { "test-file-name": [ - "ActsCameraUnspcETSTest.hap" + "ActsCameraStandardETSTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/multimedia/camera/cameraDepthOffield/signature/openharmony_sx.p7b b/multimedia/camera/camera_js_standard/signature/openharmony_sx.p7b similarity index 100% rename from multimedia/camera/cameraDepthOffield/signature/openharmony_sx.p7b rename to multimedia/camera/camera_js_standard/signature/openharmony_sx.p7b diff --git a/multimedia/camera/cameraLongFocus/src/main/config.json b/multimedia/camera/camera_js_standard/src/main/config.json similarity index 92% rename from multimedia/camera/cameraLongFocus/src/main/config.json rename to multimedia/camera/camera_js_standard/src/main/config.json index acc3652c309d3f7a36fc16d24d8ad28f44699329..ffcb306fe09b51a92036aeab1ae3e9c656c20b13 100644 --- a/multimedia/camera/cameraLongFocus/src/main/config.json +++ b/multimedia/camera/camera_js_standard/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.open.harmony.multimedia.cameralftest", + "bundleName": "com.open.harmony.multimedia.cameratest", "vendor": "open", "version": { "code": 1000000, @@ -14,9 +14,9 @@ }, "deviceConfig": {}, "module": { - "package": "com.open.harmony.multimedia.cameralftest", + "package": "com.open.harmony.multimedia.cameratest", "name": ".MyApplication", - "mainAbility": "com.open.harmony.multimedia.cameralftest.MainAbility", + "mainAbility": "com.open.harmony.multimedia.cameratest.MainAbility", "deviceType": [ "phone" ], diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/app.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/app.ets similarity index 100% rename from multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/app.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/app.ets diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/pages/index.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/pages/index.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/pages/index.ets diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/Camera.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets similarity index 100% rename from multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/Camera.test.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/Camera.test.ets diff --git a/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..182488137831939e02e00be5f7c09e189b2fc8ff --- /dev/null +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitCameraFormat.test.ets @@ -0,0 +1,5382 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import cameraObj from '@ohos.multimedia.camera'; +import image from '@ohos.multimedia.image'; +import fileio from '@ohos.fileio'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl' +import bundle from '@ohos.bundle' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; + +const TAG = "CameraModuleTest: "; + +// Define global variables + +var cameraManager; +var surfaceId1; +var camerasArray; + +// CAMERA-0 Variables +var camera0Input, camera0InputPosBack, camera0InputPosFront; +var camera0InputPromise, camera0InputPromisePosBack, camera0InputPromisePosFront; +// CAMERA-1 Variables +var camera1Input, camera1InputPosBack, camera1InputPosFront; +var camera1InputPromise, camera1InputPromisePosBack, camera1InputPromisePosFront; +// CAMERA-2 Variables +var camera2Input, camera2InputPosBack, camera2InputPosFront; +var camera2InputPromise, camera2InputPromisePosBack, camera2InputPromisePosFront; +// CAMERA-3 Variables +var camera3Input, camera3InputPosBack, camera3InputPosFront; +var camera3InputPromise, camera3InputPromisePosBack, camera3InputPromisePosFront; + +export default function cameraJSUnitCameraFormat(surfaceId: any) { + + async function getImageReceiverSurfaceId() { + console.log(TAG + 'Entering create Image receiver') + var receiver = image.createImageReceiver(640, 480, 4, 8) + console.log(TAG + 'before receiver check') + if (receiver !== undefined) { + console.log(TAG + 'Receiver is ok') + surfaceId1 = await receiver.getReceivingSurfaceId() + console.log(TAG + 'Received id: ' + JSON.stringify(surfaceId1)) + } else { + console.log(TAG + 'Receiver is not ok') + } + } + + function sleep(ms) { + console.info(TAG + "Entering sleep -> Promise constructor"); + return new Promise(resolve => setTimeout(resolve, ms)); + } + + async function applyPermission() { + let appInfo = await bundle.getApplicationInfo('com.open.harmony.multimedia.cameratest', 0, 100); + let atManager = abilityAccessCtrl.createAtManager(); + if (atManager != null) { + let tokenID = appInfo.accessTokenId; + console.info('[permission] case accessTokenID is ' + tokenID); + let permissionName1 = 'ohos.permission.CAMERA'; + let permissionName2 = 'ohos.permission.MICROPHONE'; + let permissionName3 = 'ohos.permission.MEDIA_LOCATION'; + let permissionName4 = 'ohos.permission.READ_MEDIA'; + let permissionName5 = 'ohos.permission.WRITE_MEDIA'; + await atManager.grantUserGrantedPermission(tokenID, permissionName1, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName2, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName3, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName4, 1).then((result) => { + console.info('[permission] case grantUserGrantedPermission success :' + result); + }).catch((err) => { + console.info('[permission] case grantUserGrantedPermission failed :' + err); + }); + await atManager.grantUserGrantedPermission(tokenID, permissionName5, 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'); + } + } + + describe('CameraJsUnitCameraFormat', function () { + console.info(TAG + '----------CameraJsUnitCameraFormat--------------') + + beforeAll(async function () { + await applyPermission(); + console.info('beforeAll case'); + }) + + beforeEach(function () { + sleep(5000); + console.info('beforeEach case'); + }) + + afterEach(async function () { + console.info('afterEach case'); + }) + + afterAll(function () { + console.info('afterAll case'); + }) + + /** + * @tc.number : GET_CAMERA_MANAGER_TC_001 + * @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 0 + */ + it('GET_CAMERA_MANAGER_TC_001', 0, async function (done) { + console.info("--------------GET_CAMERA_MANAGER_TC_001--------------"); + cameraObj.getCameraManager(null, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 data is not null || undefined"); + cameraManager = data; + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_MANAGER_PROMISE_TC_002 + * @tc.name : Create camera manager instance promise api + * @tc.desc : Create camera manager instance promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_MANAGER_PROMISE_TC_002', 0, async function (done) { + console.info("--------------GET_CAMERA_MANAGER_PROMISE_TC_002--------------"); + var cameraManagerPromise = await cameraObj.getCameraManager(null); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE_TC_002 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); + if (cameraManagerPromise != null && cameraManagerPromise != undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE_TC_002 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE_TC_002 FAILED"); + } + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE_TC_002 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERAS_TC_003 + * @tc.name : Get camera from cameramanager to get array of camera async api + * @tc.desc : Get camera from cameramanager to get array of camera async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERAS_TC_003', 0, async function (done) { + console.info("--------------GET_CAMERAS_TC_003--------------"); + cameraManager.getCameras(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_CAMERAS_TC_003 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_CAMERAS_TC_003 data is not null || undefined"); + camerasArray = data; + if (camerasArray != null && camerasArray.length > 0) { + for (var i = 0; i < camerasArray.length; i++) { + // Get the variables from camera object + var cameraId = camerasArray[i].cameraId; + console.info(TAG + "Entering GET_CAMERAS_TC_003 camera" + i + "Id: " + cameraId); + var cameraPosition = camerasArray[i].cameraPosition; + console.info(TAG + "Entering GET_CAMERAS_TC_003 camera" + i + "Position: " + cameraPosition); + var cameraType = camerasArray[i].cameraType; + console.info(TAG + "Entering GET_CAMERAS_TC_003 camera" + i + "Type: " + cameraType); + var connectionType = camerasArray[i].connectionType + console.info(TAG + "Entering GET_CAMERAS_TC_003 connection" + i + "Type: " + connectionType); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERAS_TC_003 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERAS_TC_003 FAILED cameraArray is null || undefined"); + } + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERAS_TC_003 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_CAMERAS_TC_003 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERAS_PROMISE_TC_004 + * @tc.name : Get camera from cameramanager to get array of camera promise api + * @tc.desc : Get camera from cameramanager to get array of camera promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERAS_PROMISE_TC_004', 0, async function (done) { + console.info("--------------GET_CAMERAS_PROMISE_TC_004--------------"); + var camerasArrayPromise = await cameraManager.getCameras(); + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004: " + JSON.stringify(camerasArrayPromise)); + if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 success"); + for (var i = 0; i < camerasArrayPromise.length; i++) { + // Get the variables from camera object + var cameraId = camerasArrayPromise[i].cameraId; + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 camera" + i + "Id: " + cameraId); + var cameraPosition = camerasArrayPromise[i].cameraPosition; + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 camera" + i + "Position: " + cameraPosition); + var cameraType = camerasArrayPromise[i].cameraType; + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 camera" + i + "Type: " + cameraType); + var connectionType = camerasArrayPromise[i].connectionType + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 connection" + i + "Type: " + connectionType); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 FAILED"); + } + console.info(TAG + "Entering GET_CAMERAS_PROMISE_TC_004 ends here"); + await sleep(1000); + done(); + }) + + /*CAMERA-0 Scripts*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_TC_005 + * @tc.name : Create camerainput from camera-0 cameraId async api + * @tc.desc : Create camerainput from camera-0 cameraId async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_TC_005', 0, async function (done) { + console.info("--------------CAMERA-0 STARTS HERE--------------"); + console.info("--------------CREATE_CAMERA_INPUT_TC_005--------------"); + cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 data is not null || undefined"); + camera0Input = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 PASSED with CameraID :" + camerasArray[0].cameraId); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 FAILED: " + err.message); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_005 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_PROMISE_TC_006 + * @tc.name : Create camerainput from camera-0 cameraId promise api + * @tc.desc : Create camerainput from camera-0 cameraId promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_PROMISE_TC_006', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_PROMISE_TC_006--------------"); + camera0InputPromise = await cameraManager.createCameraInput(camerasArray[0].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_006 camera0InputPromise: " + JSON.stringify(camera0InputPromise)); + if (camera0InputPromise != null && camera0InputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_006 camera0InputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_006 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_006 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_006 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_TC_007 + * @tc.name : get camera if from camera-0 input async api + * @tc.desc : get camera if from camera-0 input async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_TC_007', 0, async function (done) { + camera0Input.getCameraId(async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_TC_007 data is not null || undefined"); + var CameraId0 = data; + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_TC_007 PASSED with CameraID :" + CameraId0); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_TC_007 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_CAMERA_ID_TC_007 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_PROMISE_TC_008 + * @tc.name : get camera if from camera-0 input promise api + * @tc.desc : get camera if from camera-0 input promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_PROMISE_TC_008', 0, async function (done) { + var camera0IdPromise = await camera0InputPromise.getCameraId(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_TC_008 camera0IdPromise: " + JSON.stringify(camera0IdPromise)); + if (camera0IdPromise != null && camera0IdPromise != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_TC_008 camera0IdPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_TC_008 PASSED" + camera0IdPromise); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_TC_008 FAILED"); + } + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_TC_008 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_011 + * @tc.name : Get supported preview formats from camera-0 camerainput async api + * @tc.desc : Get supported preview formats from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_011', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_011--------------"); + camera0InputPromise.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 success"); + if (data != null && data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_011 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 + * @tc.name : Get supported preview formats from camera-0 camerainput promise api + * @tc.desc : Get supported preview formats from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012--------------"); + var cam0FormatPromise = await camera0InputPromise.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012: " + JSON.stringify(cam0FormatPromise)); + if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 is not null || undefined"); + for (var i = 0; i < cam0FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 cam0FormatPromise: " + cam0FormatPromise[i]); + expect(cam0FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_012 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_TC_013 + * @tc.name : Get supported video formats from camera-0 camerainput async api + * @tc.desc : Get supported video formats from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_TC_013', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_TC_013--------------"); + camera0InputPromise.getSupportedVideoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 success"); + if (data != null && data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_TC_013 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 + * @tc.name : Get supported video formats from camera-0 camerainput promise api + * @tc.desc : Get supported video formats from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014--------------"); + var cam0FormatPromise = await camera0InputPromise.getSupportedVideoFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014: " + JSON.stringify(cam0FormatPromise)); + if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 is not null || undefined"); + for (var i = 0; i < cam0FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 cam0FormatPromise: " + cam0FormatPromise[i]); + expect(cam0FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_TC_014 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 + * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015--------------"); + camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_015 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 + * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016--------------"); + var sizeArrayPromise = await camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 sizeArrayPromise"); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 PASSED"); + } else { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_016 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_017 + * @tc.name : Get supported photo format from camera-0 camerainput async api + * @tc.desc : Get supported photo format from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_017', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_017--------------"); + camera0InputPromise.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_017 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 + * @tc.name : Get supported photo format from camera-0 camerainput promise api + * @tc.desc : Get supported photo format from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018--------------"); + var cam0FormatPromise = await camera0InputPromise.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018: " + JSON.stringify(cam0FormatPromise)); + if (cam0FormatPromise != null && cam0FormatPromise.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 is not null || undefined"); + for (var i = 0; i < cam0FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 cam0FormatPromise: " + cam0FormatPromise[i]); + expect(cam0FormatPromise[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_018 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 + * @tc.name : Get supported sizes from camera-0 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-0 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019--------------"); + camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_019 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020 + * @tc.name : Get supported sizes from camera-0 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-0 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020--------------"); + var sizeArrayPromise = await camera0InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_020 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 + * @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 data is not null || undefined"); + camera0InputPosBack = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_021 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022 + * @tc.name : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-0 cameraposition back & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022--------------"); + camera0InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022 camera0InputPromisePosBack: " + JSON.stringify(camera0InputPromisePosBack)); + if (camera0InputPromisePosBack != null && camera0InputPromisePosBack != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022 camera0InputPromisePosBack is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_022 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_023 + * @tc.name : Get supported preview formats from camera-0 camerainput async api + * @tc.desc : Get supported preview formats from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_023', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_023--------------"); + camera0InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_023 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 + * @tc.name : Get supported preview formats from camera-0 camerainput promise api + * @tc.desc : Get supported preview formats from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024--------------"); + var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024: " + JSON.stringify(cam0FormatPromisePosBack)); + if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 is not null || undefined"); + for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); + expect(cam0FormatPromisePosBack[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_024 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 + * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025--------------"); + camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_025 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 + * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026--------------"); + var sizeArrayPromise = await camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_026 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_027 + * @tc.name : Get supported photo format from camera-0 camerainput async api + * @tc.desc : Get supported photo format from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_027', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_027--------------"); + camera0InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_027 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 + * @tc.name : Get supported photo format from camera-0 camerainput promise api + * @tc.desc : Get supported photo format from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028--------------"); + var cam0FormatPromisePosBack = await camera0InputPromisePosBack.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028: " + JSON.stringify(cam0FormatPromisePosBack)); + if (cam0FormatPromisePosBack != null && cam0FormatPromisePosBack.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 is not null || undefined"); + for (var i = 0; i < cam0FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 cam0FormatPromisePosBack: " + cam0FormatPromisePosBack[i]); + expect(cam0FormatPromisePosBack[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_028 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 + * @tc.name : Get supported sizes from camera-0 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-0 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029--------------"); + camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_029 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030 + * @tc.name : Get supported sizes from camera-0 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-0 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030--------------"); + var sizeArrayPromise = await camera0InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_030 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 + * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 data is not null || undefined"); + camera0InputPosFront = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_031 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032 + * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032--------------"); + camera0InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032 camera0InputPromisePosFront: " + JSON.stringify(camera0InputPromisePosFront)); + if (camera0InputPromisePosFront != null && camera0InputPromisePosFront != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032 camera0InputPromisePosFront is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_032 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_033 + * @tc.name : Get supported preview formats from camera-0 camerainput async api + * @tc.desc : Get supported preview formats from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_033', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_033--------------"); + camera0InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_033 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 + * @tc.name : Get supported preview formats from camera-0 camerainput promise api + * @tc.desc : Get supported preview formats from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034--------------"); + var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034: " + JSON.stringify(cam0FormatPromisePosFront)); + if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 is not null || undefined"); + for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); + expect(cam0FormatPromisePosFront[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_034 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 + * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035--------------"); + camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_035 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 + * @tc.name : Get supported sizes using camera-0 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-0 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036--------------"); + var sizeArrayPromise = await camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_036 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_037 + * @tc.name : Get supported photo format from camera-0 camerainput async api + * @tc.desc : Get supported photo format from camera-0 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_037', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_037--------------"); + camera0InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_037 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 + * @tc.name : Get supported photo format from camera-0 camerainput promise api + * @tc.desc : Get supported photo format from camera-0 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038--------------"); + var cam0FormatPromisePosFront = await camera0InputPromisePosFront.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038: " + JSON.stringify(cam0FormatPromisePosFront)); + if (cam0FormatPromisePosFront != null && cam0FormatPromisePosFront.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 is not null || undefined"); + for (var i = 0; i < cam0FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 cam0FormatPromisePosFront: " + cam0FormatPromisePosFront[i]); + expect(cam0FormatPromisePosFront[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_038 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 + * @tc.name : Get supported sizes from camera-0 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-0 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039--------------"); + camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_039 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040 + * @tc.name : Get supported sizes from camera-0 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-0 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040--------------"); + var sizeArrayPromise = await camera0InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_040 ends here"); + console.info("--------------CAMERA-0 ENDS HERE--------------"); + await sleep(1000); + done(); + }) + */ + + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { + if (camera0InputPromise == null || camera0InputPromise == undefined) { + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT previewOutput == null || undefined"); + } else { + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); + camera0InputPromise.on("focusStateChange", async (err, data) => { + if (!err) { + console.info(TAG + "FocusState callback is success"); + if (data != null || data != undefined) { + console.info(TAG + "Current FocusState is: " + data); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /*CAMERA-1 Scripts*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_TC_041 + * @tc.name : Create camerainput from camera-1 cameraId async api + * @tc.desc : Create camerainput from camera-1 cameraId async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_TC_041', 0, async function (done) { + console.info("--------------CAMERA-1 STARTS HERE--------------"); + console.info("--------------CREATE_CAMERA_INPUT_TC_041--------------"); + cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_041 data is not null || undefined"); + camera1Input = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_041 PASSED with CameraID :" + camerasArray[1].cameraId); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_041 FAILED: " + err.message); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_041 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_PROMISE_TC_042 + * @tc.name : Create camerainput from camera-1 cameraId promise api + * @tc.desc : Create camerainput from camera-1 cameraId promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_PROMISE_TC_042', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_PROMISE_TC_042--------------"); + camera1InputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_042 camera1InputPromise: " + JSON.stringify(camera1InputPromise)); + if (camera1InputPromise != null && camera1InputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_042 camera1InputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_042 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_042 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_042 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_CAMINPUT1_TC_43 + * @tc.name : get camera ID from camera-1 input async api + * @tc.desc : get camera ID from camera-1 input async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_CAMINPUT1_TC_43', 0, async function (done) { + camera1Input.getCameraId(async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT1_TC_43 data is not null || undefined"); + var CameraId1 = data; + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT1_TC_43 PASSED with CameraID : " + CameraId1); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT1_TC_43 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT1_TC_43 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44 + * @tc.name : get camera ID from camera-1 input promise api + * @tc.desc : get camera ID from camera-1 input promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44', 0, async function (done) { + var camera1IdPromise = await camera1InputPromise.getCameraId(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44 camera1IdPromise: " + JSON.stringify(camera1IdPromise)); + if (camera1IdPromise != null && camera1IdPromise != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44 camera1IdPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44 PASSED" + camera1IdPromise); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44 FAILED"); + } + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT1_TC_44 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045 + * @tc.name : Create camerainput from camera-1 cameraposition & cameratype async api + * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045--------------"); + cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045 data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_045 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046 + * @tc.name : Create camerainput from camera-1 cameraposition & cameratype promise api + * @tc.desc : Create camerainput from camera-1 cameraposition & cameratype promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046--------------"); + var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[1].cameraPosition, camerasArray[1].cameraType); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); + if (cameraInputPromise != null && cameraInputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046 cameraInputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_046 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_047 + * @tc.name : Get supported preview formats from camera-1 camerainput async api + * @tc.desc : Get supported preview formats from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_047', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_047--------------"); + camera1InputPromise.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_047 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 + * @tc.name : Get supported preview formats from camera-1 camerainput promise api + * @tc.desc : Get supported preview formats from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048--------------"); + var cam1FormatPromise = await camera1InputPromise.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048: " + JSON.stringify(cam1FormatPromise)); + if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 is not null || undefined"); + for (var i = 0; i < cam1FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 cam1FormatPromise: " + cam1FormatPromise[i]); + expect(cam1FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_048 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 + * @tc.name : Get supported video formats from camera-1 camerainput async api + * @tc.desc : Get supported video formats from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049--------------"); + camera1InputPromise.getSupportedVideoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT1_TC_049 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 + * @tc.name : Get supported video formats from camera-1 camerainput promise api + * @tc.desc : Get supported video formats from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050--------------"); + var cam1FormatPromise = await camera1InputPromise.getSupportedVideoFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050: " + JSON.stringify(cam1FormatPromise)); + if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 is not null || undefined"); + for (var i = 0; i < cam1FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 cam1FormatPromise: " + cam1FormatPromise[i]); + expect(cam1FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT1_TC_050 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 + * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051--------------"); + camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_051 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 + * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052--------------"); + var sizeArrayPromise = await camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_052 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_053 + * @tc.name : Get supported photo format from camera-1 camerainput async api + * @tc.desc : Get supported photo format from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_053', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_053--------------"); + camera1InputPromise.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_053 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 + * @tc.name : Get supported photo format from camera-1 camerainput promise api + * @tc.desc : Get supported photo format from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054--------------"); + var cam1FormatPromise = await camera1InputPromise.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054: " + JSON.stringify(cam1FormatPromise)); + if (cam1FormatPromise != null && cam1FormatPromise.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 is not null || undefined"); + for (var i = 0; i < cam1FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 cam1FormatPromise: " + cam1FormatPromise[i]); + expect(cam1FormatPromise[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_054 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 + * @tc.name : Get supported sizes from camera-1 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-1 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055--------------"); + camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_055 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056 + * @tc.name : Get supported sizes from camera-1 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-1 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056--------------"); + var sizeArrayPromise = await camera1InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_056 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057 + * @tc.name : Create camerainput from camera-1 cameraposition back & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-1 cameraposition back & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057 data is not null || undefined"); + camera1InputPosBack = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_057 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058 + * @tc.name : Create camerainput from camera-1 cameraposition back & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-1 cameraposition back & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058--------------"); + camera1InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058 camera1InputPromisePosBack: " + JSON.stringify(camera1InputPromisePosBack)); + if (camera1InputPromisePosBack != null && camera1InputPromisePosBack != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058 camera1InputPromisePosBack is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_058 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_059 + * @tc.name : Get supported preview formats from camera-1 camerainput async api + * @tc.desc : Get supported preview formats from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_059', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_059--------------"); + camera1InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_059 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 + * @tc.name : Get supported preview formats from camera-1 camerainput promise api + * @tc.desc : Get supported preview formats from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060--------------"); + var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060: " + JSON.stringify(cam1FormatPromisePosBack)); + if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 is not null || undefined"); + for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); + expect(cam1FormatPromisePosBack[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_060 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 + * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061--------------"); + camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_061 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 + * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062--------------"); + var sizeArrayPromise = await camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_062 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_063 + * @tc.name : Get supported photo format from camera-1 camerainput async api + * @tc.desc : Get supported photo format from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_063', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_063--------------"); + camera1InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_063 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 + * @tc.name : Get supported photo format from camera-1 camerainput promise api + * @tc.desc : Get supported photo format from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064--------------"); + var cam1FormatPromisePosBack = await camera1InputPromisePosBack.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064: " + JSON.stringify(cam1FormatPromisePosBack)); + if (cam1FormatPromisePosBack != null && cam1FormatPromisePosBack.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 is not null || undefined"); + for (var i = 0; i < cam1FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 cam1FormatPromisePosBack: " + cam1FormatPromisePosBack[i]); + expect(cam1FormatPromisePosBack[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_064 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 + * @tc.name : Get supported sizes from camera-1 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-1 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065--------------"); + camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_065 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066 + * @tc.name : Get supported sizes from camera-1 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-1 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066--------------"); + var sizeArrayPromise = await camera1InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_066 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067 + * @tc.name : Create camerainput from camera-1 cameraposition front & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-1 cameraposition front & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067 data is not null || undefined"); + camera1InputPosFront = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_067 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068 + * @tc.name : Create camerainput from camera-1 cameraposition front & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-1 cameraposition front & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068--------------"); + camera1InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068 camera1InputPromisePosFront: " + JSON.stringify(camera1InputPromisePosFront)); + if (camera1InputPromisePosFront != null && camera1InputPromisePosFront != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068 camera1InputPromisePosFront is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_068 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_069 + * @tc.name : Get supported preview formats from camera-1 camerainput async api + * @tc.desc : Get supported preview formats from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_069', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_069--------------"); + camera1InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_069 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 + * @tc.name : Get supported preview formats from camera-1 camerainput promise api + * @tc.desc : Get supported preview formats from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070--------------"); + var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070: " + JSON.stringify(cam1FormatPromisePosFront)); + if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 is not null || undefined"); + for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); + expect(cam1FormatPromisePosFront[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_070 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 + * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071--------------"); + camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_071 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 + * @tc.name : Get supported sizes using camera-1 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-1 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072--------------"); + var sizeArrayPromise = await camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_072 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_073 + * @tc.name : Get supported photo format from camera-1 camerainput async api + * @tc.desc : Get supported photo format from camera-1 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_073', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_073--------------"); + camera1InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_073 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 + * @tc.name : Get supported photo format from camera-1 camerainput promise api + * @tc.desc : Get supported photo format from camera-1 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074--------------"); + var cam1FormatPromisePosFront = await camera1InputPromisePosFront.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074: " + JSON.stringify(cam1FormatPromisePosFront)); + if (cam1FormatPromisePosFront != null && cam1FormatPromisePosFront.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 is not null || undefined"); + for (var i = 0; i < cam1FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 cam1FormatPromisePosFront: " + cam1FormatPromisePosFront[i]); + expect(cam1FormatPromisePosFront[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_074 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 + * @tc.name : Get supported sizes from camera-1 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-1 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075--------------"); + camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_075 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076 + * @tc.name : Get supported sizes from camera-1 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-1 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076--------------"); + var sizeArrayPromise = await camera1InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_076 ends here"); + console.info("--------------CAMERA-1 ENDS HERE--------------"); + await sleep(1000); + done(); + }) + */ + + /*CAMERA-2 Scripts*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_TC_077 + * @tc.name : Create camerainput from camera-2 cameraId async api + * @tc.desc : Create camerainput from camera-2 cameraId async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_TC_077', 0, async function (done) { + console.info("--------------CAMERA-2 STARTS HERE--------------"); + console.info("--------------CREATE_CAMERA_INPUT_TC_077--------------"); + cameraManager.createCameraInput(camerasArray[2].cameraId, async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_077 data is not null || undefined"); + camera2Input = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_077 PASSED with CameraID :" + camerasArray[2].cameraId); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_077 FAILED: " + err.message); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_077 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_PROMISE_TC_078 + * @tc.name : Create camerainput from camera-2 cameraId promise api + * @tc.desc : Create camerainput from camera-2 cameraId promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_PROMISE_TC_078', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_PROMISE_TC_078--------------"); + camera2InputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_078 camera2InputPromise: " + JSON.stringify(camera2InputPromise)); + if (camera2InputPromise != null && camera2InputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_078 camera2InputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_078 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_078 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_078 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_CAMINPUT2_TC_079 + * @tc.name : get camera ID from camera-2 input async api + * @tc.desc : get camera ID from camera-2 input async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_CAMINPUT2_TC_079', 0, async function (done) { + camera2Input.getCameraId(async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT2_TC_079 data is not null || undefined"); + var CameraId2 = data; + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT2_TC_079 PASSED with CameraID : " + CameraId2); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT2_TC_079 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT2_TC_079 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080 + * @tc.name : get camera ID from camera-2 input promise api + * @tc.desc : get camera ID from camera-2 input promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080', 0, async function (done) { + var camera2IdPromise = await camera2InputPromise.getCameraId(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080 camera2IdPromise: " + JSON.stringify(camera2IdPromise)); + if (camera2IdPromise != null && camera2IdPromise != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080 camera2IdPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080 PASSED" + camera2IdPromise); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080 FAILED"); + } + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT2_TC_080 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081 + * @tc.name : Create camerainput from camera-2 cameraposition & cameratype async api + * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081--------------"); + cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081 data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_081 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082 + * @tc.name : Create camerainput from camera-2 cameraposition & cameratype promise api + * @tc.desc : Create camerainput from camera-2 cameraposition & cameratype promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082--------------"); + var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[2].cameraPosition, camerasArray[2].cameraType); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); + if (cameraInputPromise != null && cameraInputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082 cameraInputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_082 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_083 + * @tc.name : Get supported preview formats from camera-2 camerainput async api + * @tc.desc : Get supported preview formats from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_083', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_083--------------"); + camera2InputPromise.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_083 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 + * @tc.name : Get supported preview formats from camera-2 camerainput promise api + * @tc.desc : Get supported preview formats from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084--------------"); + var cam2FormatPromise = await camera2InputPromise.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084: " + JSON.stringify(cam2FormatPromise)); + if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 is not null || undefined"); + for (var i = 0; i < cam2FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 cam2FormatPromise: " + cam2FormatPromise[i]); + expect(cam2FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_084 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 + * @tc.name : Get supported video formats from camera-2 camerainput async api + * @tc.desc : Get supported video formats from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85--------------"); + camera2InputPromise.getSupportedVideoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT2_TC_85 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 + * @tc.name : Get supported video formats from camera-2 camerainput promise api + * @tc.desc : Get supported video formats from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086--------------"); + var cam2FormatPromise = await camera2InputPromise.getSupportedVideoFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086: " + JSON.stringify(cam2FormatPromise)); + if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 is not null || undefined"); + for (var i = 0; i < cam2FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 cam2FormatPromise: " + cam2FormatPromise[i]); + expect(cam2FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT2_TC_086 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 + * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087--------------"); + camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_087 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 + * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088--------------"); + var sizeArrayPromise = await camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_088 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_089 + * @tc.name : Get supported photo format from camera-2 camerainput async api + * @tc.desc : Get supported photo format from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_089', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_089--------------"); + camera2InputPromise.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_089 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 + * @tc.name : Get supported photo format from camera-2 camerainput promise api + * @tc.desc : Get supported photo format from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090--------------"); + var cam2FormatPromise = await camera2InputPromise.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090: " + JSON.stringify(cam2FormatPromise)); + if (cam2FormatPromise != null && cam2FormatPromise.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 is not null || undefined"); + for (var i = 0; i < cam2FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 cam2FormatPromise: " + cam2FormatPromise[i]); + expect(cam2FormatPromise[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_090 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 + * @tc.name : Get supported sizes from camera-2 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-2 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091--------------"); + camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_091 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092 + * @tc.name : Get supported sizes from camera-2 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-2 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092--------------"); + var sizeArrayPromise = await camera2InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_092 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093 + * @tc.name : Create camerainput from camera-2 cameraposition back & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-2 cameraposition back & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093 data is not null || undefined"); + camera2InputPosBack = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_093 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094 + * @tc.name : Create camerainput from camera-2 cameraposition back & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-2 cameraposition back & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094--------------"); + camera2InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094 camera2InputPromisePosBack: " + JSON.stringify(camera2InputPromisePosBack)); + if (camera2InputPromisePosBack != null && camera2InputPromisePosBack != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094 camera2InputPromisePosBack is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_094 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_095 + * @tc.name : Get supported preview formats from camera-2 camerainput async api + * @tc.desc : Get supported preview formats from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_095', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_095--------------"); + camera2InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_095 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 + * @tc.name : Get supported preview formats from camera-2 camerainput promise api + * @tc.desc : Get supported preview formats from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096--------------"); + var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096: " + JSON.stringify(cam2FormatPromisePosBack)); + if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 is not null || undefined"); + for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); + expect(cam2FormatPromisePosBack[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_096 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 + * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097--------------"); + camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_097 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 + * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098--------------"); + var sizeArrayPromise = await camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_098 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_099 + * @tc.name : Get supported photo format from camera-2 camerainput async api + * @tc.desc : Get supported photo format from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_099', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_099--------------"); + camera2InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_099 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 + * @tc.name : Get supported photo format from camera-2 camerainput promise api + * @tc.desc : Get supported photo format from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100--------------"); + var cam2FormatPromisePosBack = await camera2InputPromisePosBack.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100: " + JSON.stringify(cam2FormatPromisePosBack)); + if (cam2FormatPromisePosBack != null && cam2FormatPromisePosBack.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 is not null || undefined"); + for (var i = 0; i < cam2FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 cam2FormatPromisePosBack: " + cam2FormatPromisePosBack[i]); + expect(cam2FormatPromisePosBack[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_100 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 + * @tc.name : Get supported sizes from camera-2 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-2 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101--------------"); + camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_101 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102 + * @tc.name : Get supported sizes from camera-2 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-2 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102--------------"); + var sizeArrayPromise = await camera2InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_102 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103 + * @tc.name : Create camerainput from camera-2 cameraposition front & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-2 cameraposition front & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103 data is not null || undefined"); + camera2InputPosFront = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_103 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104 + * @tc.name : Create camerainput from camera-2 cameraposition front & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-2 cameraposition front & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104--------------"); + camera2InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104 camera2InputPromisePosFront: " + JSON.stringify(camera2InputPromisePosFront)); + if (camera2InputPromisePosFront != null && camera2InputPromisePosFront != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104 camera2InputPromisePosFront is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_104 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_105 + * @tc.name : Get supported preview formats from camera-2 camerainput async api + * @tc.desc : Get supported preview formats from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_105', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_105--------------"); + camera2InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_105 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 + * @tc.name : Get supported preview formats from camera-2 camerainput promise api + * @tc.desc : Get supported preview formats from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106--------------"); + var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106: " + JSON.stringify(cam2FormatPromisePosFront)); + if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 is not null || undefined"); + for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); + expect(cam2FormatPromisePosFront[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_106 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 + * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107--------------"); + camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_107 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 + * @tc.name : Get supported sizes using camera-2 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-2 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108--------------"); + var sizeArrayPromise = await camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_108 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_109 + * @tc.name : Get supported photo format from camera-2 camerainput async api + * @tc.desc : Get supported photo format from camera-2 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_109', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_109--------------"); + camera2InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_109 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 + * @tc.name : Get supported photo format from camera-2 camerainput promise api + * @tc.desc : Get supported photo format from camera-2 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110--------------"); + var cam2FormatPromisePosFront = await camera2InputPromisePosFront.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110: " + JSON.stringify(cam2FormatPromisePosFront)); + if (cam2FormatPromisePosFront != null && cam2FormatPromisePosFront.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 is not null || undefined"); + for (var i = 0; i < cam2FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 cam2FormatPromisePosFront: " + cam2FormatPromisePosFront[i]); + expect(cam2FormatPromisePosFront[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_110 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 + * @tc.name : Get supported sizes from camera-2 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-2 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_013', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111--------------"); + camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_111 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112 + * @tc.name : Get supported sizes from camera-2 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-2 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112--------------"); + var sizeArrayPromise = await camera2InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_112 ends here"); + console.info("--------------CAMERA-2 ENDS HERE--------------"); + await sleep(1000); + done(); + }) + */ + + /*CAMERA-3 Scripts*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_TC_113 + * @tc.name : Create camerainput from camera-3 cameraId async api + * @tc.desc : Create camerainput from camera-3 cameraId async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_TC_113', 0, async function (done) { + console.info("--------------CAMERA-3 STARTS HERE--------------"); + console.info("--------------CREATE_CAMERA_INPUT_TC_113--------------"); + cameraManager.createCameraInput(camerasArray[3].cameraId, async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_113 data is not null || undefined"); + camera3Input = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_113 PASSED with CameraID :" + camerasArray[3].cameraId); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_113 FAILED: " + err.message); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_113 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_PROMISE_TC_114 + * @tc.name : Create camerainput from camera-3 cameraId promise api + * @tc.desc : Create camerainput from camera-3 cameraId promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_PROMISE_TC_114', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_PROMISE_TC_114--------------"); + camera3InputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_114 camera3InputPromise: " + JSON.stringify(camera3InputPromise)); + if (camera3InputPromise != null && camera3InputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_114 camera3InputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_114 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_114 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE_TC_114 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_CAMINPUT3_TC_115 + * @tc.name : get camera ID from camera-3 input async api + * @tc.desc : get camera ID from camera-3 input async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_CAMINPUT3_TC_115', 0, async function (done) { + camera3Input.getCameraId(async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT3_TC_115 data is not null || undefined"); + var CameraId3 = data; + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT3_TC_115 PASSED with CameraID : " + CameraId3); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT3_TC_115 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_CAMERA_ID_CAMINPUT3_TC_115 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116 + * @tc.name : get camera ID from camera-3 input promise api + * @tc.desc : get camera ID from camera-3 input promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116', 0, async function (done) { + var camera3IdPromise = await camera3InputPromise.getCameraId(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116 camera3IdPromise: " + JSON.stringify(camera3IdPromise)); + if (camera3IdPromise != null && camera3IdPromise != undefined) { + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116 camera3IdPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116 PASSED" + camera3IdPromise); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116 FAILED"); + } + console.info(TAG + "Entering GET_CAMERA_ID_PROMISE_CAMINPUT3_TC_116 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117 + * @tc.name : Create camerainput from camera-3 cameraposition & cameratype async api + * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117--------------"); + cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117 data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_TC_117 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118 + * @tc.name : Create camerainput from camera-3 cameraposition & cameratype promise api + * @tc.desc : Create camerainput from camera-3 cameraposition & cameratype promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118--------------"); + var cameraInputPromise = await cameraManager.createCameraInput(camerasArray[3].cameraPosition, camerasArray[3].cameraType); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118 cameraInputPromise: " + JSON.stringify(cameraInputPromise)); + if (cameraInputPromise != null && cameraInputPromise != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118 cameraInputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POSITION_TYPE_PROMISE_TC_118 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_VIDEO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_119 + * @tc.name : Get supported preview formats from camera-3 camerainput async api + * @tc.desc : Get supported preview formats from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_119', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_119--------------"); + camera3InputPromise.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_119 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 + * @tc.name : Get supported preview formats from camera-3 camerainput promise api + * @tc.desc : Get supported preview formats from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120--------------"); + var cam3FormatPromise = await camera3InputPromise.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120: " + JSON.stringify(cam3FormatPromise)); + if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 is not null || undefined"); + for (var i = 0; i < cam3FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 cam3FormatPromise: " + cam3FormatPromise[i]); + expect(cam3FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_120 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121--------------"); + camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 + * @tc.name : Get supported video formats from camera-3 camerainput async api + * @tc.desc : Get supported video formats from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122--------------"); + camera3InputPromise.getSupportedVideoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_CAMINPUT3_TC_122 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 + * @tc.name : Get supported video formats from camera-3 camerainput promise api + * @tc.desc : Get supported video formats from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123', 0, async function (done) { + console.info("--------------GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123--------------"); + var cam3FormatPromise = await camera3InputPromise.getSupportedVideoFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123: " + JSON.stringify(cam3FormatPromise)); + if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 is not null || undefined"); + for (var i = 0; i < cam3FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 cam3FormatPromise: " + cam3FormatPromise[i]); + expect(cam3FormatPromise[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_VIDEO_FORMATS_PROMISE_CAMINPUT3_TC_123 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121--------------"); + camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_121 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125--------------"); + var sizeArrayPromise = await camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_125 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_126 + * @tc.name : Get supported photo format from camera-3 camerainput async api + * @tc.desc : Get supported photo format from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_126', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_126--------------"); + camera3InputPromise.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_126 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 + * @tc.name : Get supported photo format from camera-3 camerainput promise api + * @tc.desc : Get supported photo format from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127--------------"); + var cam3FormatPromise = await camera3InputPromise.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127: " + JSON.stringify(cam3FormatPromise)); + if (cam3FormatPromise != null && cam3FormatPromise.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 is not null || undefined"); + for (var i = 0; i < cam3FormatPromise.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 cam3FormatPromise: " + cam3FormatPromise[i]); + expect(cam3FormatPromise[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_127 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 + * @tc.name : Get supported sizes from camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128--------------"); + camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_128 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129 + * @tc.name : Get supported sizes from camera-3 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-3 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129--------------"); + var sizeArrayPromise = await camera3InputPromise.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_129 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130 + * @tc.name : Create camerainput from camera-3 cameraposition back & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-3 cameraposition back & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130 data is not null || undefined"); + camera3InputPosBack = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_TC_130 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131 + * @tc.name : Create camerainput from camera-3 cameraposition back & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-3 cameraposition back & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131--------------"); + camera3InputPromisePosBack = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131 camera3InputPromisePosBack: " + JSON.stringify(camera3InputPromisePosBack)); + if (camera3InputPromisePosBack != null && camera3InputPromisePosBack != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131 camera3InputPromisePosBack is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_UNSPECIFIED_PROMISE_TC_131 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_132 + * @tc.name : Get supported preview formats from camera-3 camerainput async api + * @tc.desc : Get supported preview formats from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_132', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_132--------------"); + camera3InputPromisePosBack.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_132 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 + * @tc.name : Get supported preview formats from camera-3 camerainput promise api + * @tc.desc : Get supported preview formats from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133--------------"); + var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133: " + JSON.stringify(cam3FormatPromisePosBack)); + if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 is not null || undefined"); + for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); + expect(cam3FormatPromisePosBack[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_133 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134--------------"); + camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_134 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135--------------"); + var sizeArrayPromise = await camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_135 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_136 + * @tc.name : Get supported photo format from camera-3 camerainput async api + * @tc.desc : Get supported photo format from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_136', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_136--------------"); + camera3InputPromisePosBack.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_136 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 + * @tc.name : Get supported photo format from camera-3 camerainput promise api + * @tc.desc : Get supported photo format from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137--------------"); + var cam3FormatPromisePosBack = await camera3InputPromisePosBack.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137: " + JSON.stringify(cam3FormatPromisePosBack)); + if (cam3FormatPromisePosBack != null && cam3FormatPromisePosBack.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 is not null || undefined"); + for (var i = 0; i < cam3FormatPromisePosBack.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 cam3FormatPromisePosBack: " + cam3FormatPromisePosBack[i]); + expect(cam3FormatPromisePosBack[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_137 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 + * @tc.name : Get supported sizes from camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138--------------"); + camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_138 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139 + * @tc.name : Get supported sizes from camera-3 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-3 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139--------------"); + var sizeArrayPromise = await camera3InputPromisePosBack.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_139 ends here"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140 + * @tc.name : Create camerainput from camera-3 cameraposition front & cameratype unspecified async api + * @tc.desc : Create camerainput from camera-3 cameraposition front & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140 data is not null || undefined"); + camera3InputPosFront = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140 PASSED"); + } + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_TC_140 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141 + * @tc.name : Create camerainput from camera-3 cameraposition front & cameratype unspecified promise api + * @tc.desc : Create camerainput from camera-3 cameraposition front & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141--------------"); + camera3InputPromisePosFront = await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141 camera3InputPromisePosFront: " + JSON.stringify(camera3InputPromisePosFront)); + if (camera3InputPromisePosFront != null && camera3InputPromisePosFront != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141 camera3InputPromisePosFront is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141 FAILED"); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_UNSPECIFIED_PROMISE_TC_141 ends here"); + await sleep(1000); + done(); + }) + + /*GET_SUPPORTED_PREVIEW_PHOTO_FORMATS_SIZE_TC*/ + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_TC_142 + * @tc.name : Get supported preview formats from camera-3 camerainput async api + * @tc.desc : Get supported preview formats from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_TC_142', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_TC_142--------------"); + camera3InputPromisePosFront.getSupportedPreviewFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(1003); + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_TC_142 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 + * @tc.name : Get supported preview formats from camera-3 camerainput promise api + * @tc.desc : Get supported preview formats from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143--------------"); + var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPreviewFormats(); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143: " + JSON.stringify(cam3FormatPromisePosFront)); + if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 is not null || undefined"); + for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); + expect(cam3FormatPromisePosFront[i]).assertEqual(1003); + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 PASSED"); + } + } else { + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 FAILED"); + expect().assertFail(); + } + console.info("CameraModuleTest: Entering GET_SUPPORTED_PREVIEW_FORMATS_PROMISE_TC_143 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144--------------"); + camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_TC_144 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 + * @tc.name : Get supported sizes using camera-3 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes using camera-3 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145--------------"); + var sizeArrayPromise = await camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 sizeArrayPromise: "); + if (sizeArrayPromise != null && sizeArrayPromise.length > 0) { + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 size0ArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 size0ArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 PASSED"); + } else { + expect().assertFail(); + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 FAILED"); + } + console.info("CameraModuleTest: Entering GET_SUPP_SIZES_CAMERA_FORMAT_YUV_420_SP_PROMISE_TC_145 ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_TC_146 + * @tc.name : Get supported photo format from camera-3 camerainput async api + * @tc.desc : Get supported photo format from camera-3 camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_TC_146', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_TC_146--------------"); + camera3InputPromisePosFront.getSupportedPhotoFormats(async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 cameraFormat: " + data[i]); + expect(data[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 PASSED"); + } + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 FAILED: " + err.message); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_TC_146 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 + * @tc.name : Get supported photo format from camera-3 camerainput promise api + * @tc.desc : Get supported photo format from camera-3 camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147', 0, async function (done) { + console.info("--------------GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147--------------"); + var cam3FormatPromisePosFront = await camera3InputPromisePosFront.getSupportedPhotoFormats(); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147: " + JSON.stringify(cam3FormatPromisePosFront)); + if (cam3FormatPromisePosFront != null && cam3FormatPromisePosFront.length > 0) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 is not null || undefined"); + for (var i = 0; i < cam3FormatPromisePosFront.length; i++) { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 cam3FormatPromisePosFront: " + cam3FormatPromisePosFront[i]); + expect(cam3FormatPromisePosFront[i]).assertEqual(2000); + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 PASSED"); + } + } else { + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 FAILED"); + expect().assertFail(); + } + console.info(TAG + "Entering GET_SUPPORTED_PHOTO_FORMATS_PROMISE_TC_147 ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 + * @tc.name : Get supported sizes from camera-3 cameraformat & camerainput async api + * @tc.desc : Get supported sizes from camera-3 cameraformat & camerainput async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148--------------"); + camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG, async (err, data) => { + if (!err) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 success"); + if (data != null || data.length > 0) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 data is not null || undefined"); + for (var i = 0; i < data.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 sizeArray: width * height - " + data[i].width + " * " + data[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 FAILED: " + err.message); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_TC_148 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149 + * @tc.name : Get supported sizes from camera-3 cameraformat & camerainput promise api + * @tc.desc : Get supported sizes from camera-3 cameraformat & camerainput promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149', 0, async function (done) { + console.info("--------------GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149--------------"); + var sizeArrayPromise = await camera3InputPromisePosFront.getSupportedSizes(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149: "); + if (sizeArrayPromise != null && sizeArrayPromise != undefined) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149 sizeArrayPromise is not null || undefined"); + for (var i = 0; i < sizeArrayPromise.length; i++) { + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149 sizeArrayPromise: width * height - " + sizeArrayPromise[i].width + " * " + sizeArrayPromise[i].height); + } + expect(true).assertTrue(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149 PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149 FAILED"); + } + console.info(TAG + "Entering GET_SUPP_SIZES_CAMERA_FORMAT_JPEG_PROMISE_TC_149 ends here"); + console.info("--------------CAMERA-3 ENDS HERE--------------"); + await sleep(1000); + done(); + }) + */ + + /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE UNSPECIFIED*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype unspecified async api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype unspecified async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150 success: "); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_TC_150 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC_151 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype unspecified promise api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype unspecified promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC_151', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC_151--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED) + .then(function () { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC_151 camInputPromise: "); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC_151 FAILED"); + }) + .catch((err) => { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_UNSPECIFIED_PROMISE_TC_151 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE WIDE ANGLE*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype wide angle async api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype wide angle async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_TC_152 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_TC_153 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype wide angle promise api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype wide angle promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_TC_153', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_TC_153--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) + .then(function () { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_TC_153 FAILED"); + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_TC_153 PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_WIDE_ANGLE_PROMISE_TC_153 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE ULTRA ANGLE*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype ultra wide async api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype ultra wide async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_TC_154 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_TC_155 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype ultra wide promise api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype ultra wide promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_TC_155', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_TC_155--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) + .then(function () { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_TC_155 FAILED"); + expect().assertFail(); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_TC_155 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_ULTRA_WIDE_PROMISE_TC_155 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE TELEPHOTO*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype telephoto async api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype telephoto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_TC_156 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_TC_157 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype telephoto promise api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype telephoto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_TC_157', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_TC_157--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_TC_157 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_TC_157 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TELEPHOTO_PROMISE_TC_157 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION UNSPECIFIED & TYPE TRUE DEAPTH*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype true deapth async api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype true deapth async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_TC_158 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_TC_159 + * @tc.name : Create camerainput from cameraposition unspecified & cameratype true deapth promise api + * @tc.desc : Create camerainput from cameraposition unspecified & cameratype true deapth promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_TC_159', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_TC_159--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_UNSPECIFIED, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_TC_159 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_TC_159 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_UNSPECIFIED_TYPE_TRUE_DEAPTH_PROMISE_TC_159 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE WIDE ANGLE*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160 + * @tc.name : Create camerainput from cameraposition back & cameratype wide angle async api + * @tc.desc : Create camerainput from cameraposition back & cameratype wide angle async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_TC_160 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_TC_161 + * @tc.name : Create camerainput from cameraposition back & cameratype wide angle promise api + * @tc.desc : Create camerainput from cameraposition back & cameratype wide angle promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_TC_161', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_TC_161--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_TC_161 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_TC_161 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_WIDE_ANGLE_PROMISE_TC_161 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE ULTRA ANGLE*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162 + * @tc.name : Create camerainput from cameraposition back & cameratype ultra wide async api + * @tc.desc : Create camerainput from cameraposition back & cameratype ultra wide async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_TC_162 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_TC_163 + * @tc.name : Create camerainput from cameraposition back & cameratype ultra wide promise api + * @tc.desc : Create camerainput from cameraposition back & cameratype ultra wide promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_TC_163', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_TC_163--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_TC_163 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_TC_163 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_ULTRA_WIDE_PROMISE_TC_163 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE TELEPHOTO*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164 + * @tc.name : Create camerainput from cameraposition back & cameratype telephoto async api + * @tc.desc : Create camerainput from cameraposition back & cameratype telephoto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_TC_164 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_TC_165 + * @tc.name : Create camerainput from cameraposition back & cameratype telephoto promise api + * @tc.desc : Create camerainput from cameraposition back & cameratype telephoto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_TC_165', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_TC_165--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_TC_165 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_TC_165 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TELEPHOTO_PROMISE_TC_165 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION BACK & TYPE TRUE DEAPTH*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166 + * @tc.name : Create camerainput from cameraposition back & cameratype true deapth async api + * @tc.desc : Create camerainput from cameraposition back & cameratype true deapth async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_TC_166 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_TC_167 + * @tc.name : Create camerainput from cameraposition back & cameratype true deapth promise api + * @tc.desc : Create camerainput from cameraposition back & cameratype true deapth promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_TC_167', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_TC_167--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_BACK, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_TC_167 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_TC_167 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_BACK_TYPE_TRUE_DEAPTH_PROMISE_TC_167 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE WIDE ANGLE*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168 + * @tc.name : Create camerainput from cameraposition front & cameratype wide angle async api + * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168 FAILED"); + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_TC_168 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_TC_169 + * @tc.name : Create camerainput from cameraposition front & cameratype wide angle promise api + * @tc.desc : Create camerainput from cameraposition front & cameratype wide angle promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_TC_169', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_TC_169--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_TC_169 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_TC_169 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_WIDE_ANGLE_PROMISE_TC_169 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE ULTRA ANGLE*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170 + * @tc.name : Create camerainput from cameraposition front & cameratype ultra wide async api + * @tc.desc : Create camerainput from cameraposition front & cameratype ultra wide async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_TC_170 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_TC_171 + * @tc.name : Create camerainput from cameraposition front & cameratype ultra wide promise api + * @tc.desc : Create camerainput from cameraposition front & cameratype ultra wide promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_TC_171', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_TC_171--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_ULTRA_WIDE) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_TC_171 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_TC_171 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_ULTRA_WIDE_PROMISE_TC_171 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE TELEPHOTO*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172 + * @tc.name : Create camerainput from cameraposition front & cameratype telephoto async api + * @tc.desc : Create camerainput from cameraposition front & cameratype telephoto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172 FAILED"); + } else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_TC_172 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_TC_173 + * @tc.name : Create camerainput from cameraposition front & cameratype telephoto promise api + * @tc.desc : Create camerainput from cameraposition front & cameratype telephoto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_TC_173', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_TC_173--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TELEPHOTO) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_TC_173 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_TC_173 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TELEPHOTO_PROMISE_TC_173 ends here"); + await sleep(1000); + done(); + }) + + /*CREATE CAMERAINPUT WITH POSITION FRONT & TYPE TRUE DEAPTH*/ + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174 + * @tc.name : Create camerainput from cameraposition front & cameratype true deapth async api + * @tc.desc : Create camerainput from cameraposition front & cameratype true deapth async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174--------------"); + cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH, async (err, data) => { + if (!err) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174 success"); + var camInput = data; + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174 camInput: " + JSON.stringify(camInput)); + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174 FAILED"); + } + else { + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174 PASSED: " + err.message); + expect(true).assertTrue(); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_TC_174 ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_TC_175 + * @tc.name : Create camerainput from cameraposition front & cameratype true deapth promise api + * @tc.desc : Create camerainput from cameraposition front & cameratype true deapth promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_TC_175', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_TC_175--------------"); + await cameraManager.createCameraInput(cameraObj.CameraPosition.CAMERA_POSITION_FRONT, cameraObj.CameraType.CAMERA_TYPE_TRUE_DEPTH) + .then(function () { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_TC_175 FAILED"); + }) + .catch((err) => { + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_TC_175 PASSED : " + err.message); + }); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_POS_FRONT_TYPE_TRUE_DEAPTH_PROMISE_TC_175 ends here"); + await sleep(1000); + done(); + }) + }) +} \ No newline at end of file diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets similarity index 71% rename from multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets index 4a9e9e966b0eeccaf6558cb55c79fcdf91ce2c07..2fb65dc96f93b0bd2c91ad29709b85b17b899ebb 100644 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitEnum.test.ets @@ -124,29 +124,29 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 + * @tc.number : GET_CAMERA_MANAGER_TC_001 * @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 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); + it('GET_CAMERA_MANAGER_TC_001', 0, async function (done) { + console.info("--------------GET_CAMERA_MANAGER_TC_001--------------"); cameraObj.getCameraManager(null, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 success"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 data is not null || undefined"); cameraManager = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_TC_001 ends here"); await sleep(1000); done(); }) @@ -155,45 +155,45 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 + * @tc.number : GET_CAMERAS_TC_002 * @tc.name : Get camera from cameramanager to get array of camera async api * @tc.desc : Get camera from cameramanager to get array of camera async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); + it('GET_CAMERAS_TC_002', 0, async function (done) { + console.info("--------------GET_CAMERAS_TC_002--------------"); cameraManager.getCameras(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 data is not null || undefined"); camerasArray = data; if (camerasArray != null && camerasArray.length > 0) { for (var i = 0; i < camerasArray.length; i++) { // Get the variables from camera object var cameraId = camerasArray[i].cameraId; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Id: " + cameraId); + console.info(TAG + "Entering GET_CAMERAS_TC_002 camera" + i + "Id: " + cameraId); var cameraPosition = camerasArray[i].cameraPosition; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Position: " + cameraPosition); + console.info(TAG + "Entering GET_CAMERAS_TC_002 camera" + i + "Position: " + cameraPosition); var cameraType = camerasArray[i].cameraType; - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera" + i + "Type: " + cameraType); + console.info(TAG + "Entering GET_CAMERAS_TC_002 camera" + i + "Type: " + cameraType); var connectionType = camerasArray[i].connectionType - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection" + i + "Type: " + connectionType); + console.info(TAG + "Entering GET_CAMERAS_TC_002 connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 FAILED cameraArray is null || undefined"); } } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering GET_CAMERAS_TC_002 FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering GET_CAMERAS_TC_002 ends here"); await sleep(1000); done(); }) @@ -203,29 +203,29 @@ export default function cameraJSUnitEnum(surfaceId: any) { /*CAMERA-0 Scripts*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 + * @tc.number : CREATE_CAMERA_INPUT_TC_003 * @tc.name : Create camerainput from camera-0 cameraId async api * @tc.desc : Create camerainput from camera-0 cameraId async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100', 0, async function (done) { + it('CREATE_CAMERA_INPUT_TC_003', 0, async function (done) { console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100--------------"); + console.info("--------------CREATE_CAMERA_INPUT_TC_003--------------"); cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { if (!err) { if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 data is not null || undefined"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 data is not null || undefined"); camera0Input = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 PASSED with CameraID :" + camerasArray[0].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 PASSED with CameraID :" + camerasArray[0].cameraId); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 FAILED: " + err.message); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_0100 ends here"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_TC_003 ends here"); await sleep(1000); done(); }) @@ -234,15 +234,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100 + * @tc.number : CAMERA_STATUS * @tc.name : camera status ENAME * @tc.desc : camera status ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_0100------------"); + it('CAMERA_STATUS', 0, async function (done) { + console.info(TAG + "--------------CameraStatus ------------"); console.info(TAG + "CameraStatus CAMERA_STATUS_APPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_APPEAR); expect(cameraObj.CameraStatus.CAMERA_STATUS_APPEAR).assertEqual(0); console.info(TAG + "CameraStatus CAMERA_STATUS_DISAPPEAR : " + cameraObj.CameraStatus.CAMERA_STATUS_DISAPPEAR); @@ -256,15 +256,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100 + * @tc.number : CAMERA_POSITION * @tc.name : Camera position ENAME * @tc.desc : Camera position ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_POSITION_0100------------") + it('CAMERA_POSITION', 0, async function (done) { + console.info(TAG + "--------------CameraPosition ------------") console.info(TAG + "CameraPosition CAMERA_POSITION_BACK : " + cameraObj.CameraPosition.CAMERA_POSITION_BACK); expect(cameraObj.CameraPosition.CAMERA_POSITION_BACK).assertEqual(1); console.info(TAG + "CameraPosition CAMERA_POSITION_FRONT : " + cameraObj.CameraPosition.CAMERA_POSITION_FRONT); @@ -276,15 +276,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100 + * @tc.number : CAMERA_TYPE * @tc.name : camera type ENAME * @tc.desc : camera type ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CAMERA_TYPE_0100------------") + it('CAMERA_TYPE', 0, async function (done) { + console.info(TAG + "--------------CameraType ------------") console.info(TAG + "CameraType CAMERA_TYPE_UNSPECIFIED : " + cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED); expect(cameraObj.CameraType.CAMERA_TYPE_UNSPECIFIED).assertEqual(0); console.info(TAG + "CameraType CAMERA_TYPE_WIDE_ANGLE : " + cameraObj.CameraType.CAMERA_TYPE_WIDE_ANGLE); @@ -300,15 +300,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100 + * @tc.number : CONNECTION_TYPE * @tc.name : connection type ENAME * @tc.desc : connection type ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_CONNECTION_TYPE_0100------------") + it('CONNECTION_TYPE', 0, async function (done) { + console.info(TAG + "--------------ConnectionType ------------") console.info(TAG + "ConnectionType CAMERA_CONNECTION_BUILT_IN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN); expect(cameraObj.ConnectionType.CAMERA_CONNECTION_BUILT_IN).assertEqual(0); console.info(TAG + "ConnectionType CAMERA_CONNECTION_USB_PLUGIN : " + cameraObj.ConnectionType.CAMERA_CONNECTION_USB_PLUGIN); @@ -320,15 +320,35 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100 + * @tc.number : CAMERA_FORMAT + * @tc.name : Camera Format ENAME + * @tc.desc : Camera Format ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* CameraFormat Interface will be change + it('CAMERA_FORMAT', 0, async function (done) { + console.info(TAG + "--------------CameraFormat ------------") + console.info(TAG + "CameraFormat CAMERA_FORMAT_YUV_420_SP : " + cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP); + expect(cameraObj.CameraFormat.CAMERA_FORMAT_YUV_420_SP).assertEqual(1003); + console.info(TAG + "CameraFormat CAMERA_FORMAT_JPEG : " + cameraObj.CameraFormat.CAMERA_FORMAT_JPEG); + expect(cameraObj.CameraFormat.CAMERA_FORMAT_JPEG).assertEqual(2000); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : FLASHMODE * @tc.name : Flash Mode ENAME * @tc.desc : Flash Mode ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FLASHMODE_0100------------") + it('FLASHMODE', 0, async function (done) { + console.info(TAG + "--------------FlashMode ------------") console.info(TAG + "FlashMode FLASH_MODE_CLOSE : " + cameraObj.FlashMode.FLASH_MODE_CLOSE); expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); console.info(TAG + "FlashMode FLASH_MODE_OPEN : " + cameraObj.FlashMode.FLASH_MODE_OPEN); @@ -342,15 +362,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100 + * @tc.number : FOCUSMODE * @tc.name : Focus Mode ENAME * @tc.desc : Focus Mode ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSMODE_0100------------") + it('FOCUSMODE', 0, async function (done) { + console.info(TAG + "--------------FocusMode ------------") console.info(TAG + "FocusMode FOCUS_MODE_MANUAL : " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0); console.info(TAG + "FocusMode FOCUS_MODE_CONTINUOUS_AUTO : " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); @@ -364,15 +384,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100 + * @tc.number : FOCUSSTATE * @tc.name : Focus State ENAME * @tc.desc : Focus State ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_FOCUSSTATE_0100------------") + it('FOCUSSTATE', 0, async function (done) { + console.info(TAG + "--------------FocusState ------------") console.info(TAG + "FocusState FOCUS_STATE_SCAN : " + cameraObj.FocusState.FOCUS_STATE_SCAN); expect(cameraObj.FocusState.FOCUS_STATE_SCAN).assertEqual(0); console.info(TAG + "FocusState FOCUS_STATE_FOCUSED : " + cameraObj.FocusState.FOCUS_STATE_FOCUSED); @@ -384,15 +404,57 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100 + * @tc.number : EXPOSUREMODE + * @tc.name : Exposure Mode ENAME + * @tc.desc : Exposure Mode ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('EXPOSUREMODE', 0, async function (done) { + console.info(TAG + "--------------ExposureMode ------------") + console.info(TAG + "ExposureMode EXPOSURE_MODE_LOCKED : " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED).assertEqual(0); + console.info(TAG + "ExposureMode EXPOSURE_MODE_AUTO : " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + console.info(TAG + "ExposureMode EXPOSURE_MODE_CONTINUOUS_AUTO : " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + expect(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO).assertEqual(2); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : ExposureState + * @tc.name : Exposure State ENAME + * @tc.desc : Exposure State ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* ExposureState Interface will be change + it('ExposureState', 0, async function (done) { + console.info(TAG + "--------------ExposureState ------------") + console.info(TAG + "ExposureState EXPOSURE_STATE_SCAN : " + cameraObj.ExposureState.EXPOSURE_STATE_SCAN); + expect(cameraObj.ExposureState.EXPOSURE_STATE_SCAN).assertEqual(0); + console.info(TAG + "ExposureState EXPOSURE_STATE_CONVERGED : " + cameraObj.ExposureState.EXPOSURE_STATE_CONVERGED); + expect(cameraObj.ExposureState.EXPOSURE_STATE_CONVERGED).assertEqual(1); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : ImageRotation * @tc.name : Image Rotation ENAME * @tc.desc : Image Rotation ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_IMAGEROTATION_0100------------") + it('ImageRotation', 0, async function (done) { + console.info(TAG + "--------------ImageRotation ------------") console.info(TAG + "ImageRotation ROTATION_0 : " + cameraObj.ImageRotation.ROTATION_0); expect(cameraObj.ImageRotation.ROTATION_0).assertEqual(0); console.info(TAG + "ImageRotation ROTATION_90 : " + cameraObj.ImageRotation.ROTATION_90); @@ -406,15 +468,15 @@ export default function cameraJSUnitEnum(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100 + * @tc.number : QualityLevel * @tc.name : Quality Level ENAME * @tc.desc : Quality Level ENAME * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100', 0, async function (done) { - console.info(TAG + "--------------SUB_MULTIMEDIA_CAMERA_QUALITYLEVEL_0100------------") + it('QualityLevel', 0, async function (done) { + console.info(TAG + "--------------QualityLevel ------------") console.info(TAG + "QualityLevel QUALITY_LEVEL_HIGH : " + cameraObj.QualityLevel.QUALITY_LEVEL_HIGH); expect(cameraObj.QualityLevel.QUALITY_LEVEL_HIGH).assertEqual(0); console.info(TAG + "QualityLevel QUALITY_LEVEL_MEDIUM : " + cameraObj.QualityLevel.QUALITY_LEVEL_MEDIUM); @@ -424,8 +486,33 @@ export default function cameraJSUnitEnum(surfaceId: any) { await sleep(1000); done(); }) - }) +/** + * @tc.number : VIDEOSTABILIZATION_ENUM + * @tc.name : VIDEOSTABILIZATION ENAME + * @tc.desc : VIDEOSTABILIZATION ENAME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('VideoStabilization', 0, async function (done) { + console.info(TAG + "--------------VideoStabilization ------------") + console.info(TAG + "VideoStabilization OFF : " + cameraObj.VideoStabilizationMode.OFF); + expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0); + console.info(TAG + "VideoStabilization LOW : " + cameraObj.VideoStabilizationMode.LOW); + expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1); + console.info(TAG + "VideoStabilization MIDDLE : " + cameraObj.VideoStabilizationMode.MIDDLE); + expect(cameraObj.VideoStabilizationMode.MIDDLE).assertEqual(2); + console.info(TAG + "VideoStabilization HIGH : " + cameraObj.VideoStabilizationMode.HIGH); + expect(cameraObj.VideoStabilizationMode.HIGH).assertEqual(3); + console.info(TAG + "VideoStabilization AUTO : " + cameraObj.VideoStabilizationMode.AUTO); + expect(cameraObj.VideoStabilizationMode.AUTO).assertEqual(4); + await sleep(1000); + done(); + }) + */ + }) /** * @tc.number : SUB_MULTIMEDIA_CAMERAINPUTERRORCODE_0100 * @tc.name : CameraInputErrorCode ENAME diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets similarity index 58% rename from multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets index 542aec1cb0227074d35be70f9e8bf261419da2af..4de926233207a220a5357c5ee53796fe53ed5827 100644 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets @@ -156,15 +156,15 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "----------Camera-Precision Control-Async-------------"); /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 + * @tc.number : GET_CAMERA_MANAGER * @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 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------"); + it('GET_CAMERA_MANAGER', 0, async function (done) { + console.info("--------------GET_CAMERA_MANAGER--------------"); cameraObj.getCameraManager(null, async (err, data) => { if (!err) { console.info(TAG + "Entering Camera Manager success"); @@ -172,13 +172,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering Camera Manager data is not null || undefined"); cameraManager = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering GET_CAMERA_MANAGER PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering GET_CAMERA_MANAGER FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here"); + console.info(TAG + "Entering GET_CAMERA_MANAGER ends here"); await sleep(1000); done(); }) @@ -187,18 +187,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 + * @tc.number : CAMERA_STATUS_CALLBACK * @tc.name : camera status callback on CameraManager async api * @tc.desc : camera status callback on CameraManager async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { + it('CAMERA_STATUS_CALLBACK', 0, async function (done) { if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined") + console.info(TAG + "Entering CAMERA_STATUS_CALLBACK cameraManager == null || undefined") } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate") + console.info(TAG + "Entering CAMERA_STATUS_CALLBACK to operate") cameraManager.on('cameraStatus', async (err, data) => { if (!err) { console.info(TAG + "Camera status Callback on cameraManager is success"); @@ -209,7 +209,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAMERA_STATUS_CALLBACK FAILED: " + err.message); } await sleep(1000); done(); @@ -220,15 +220,15 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 + * @tc.number : GET_CAMERAS * @tc.name : Get camera from cameramanager to get array of camera async api * @tc.desc : Get camera from cameramanager to get array of camera async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"); + it('GET_CAMERAS', 0, async function (done) { + console.info("--------------GET_CAMERAS--------------"); cameraManager.getCameras(async (err, data) => { if (!err) { console.info(TAG + "Entering GetCameras success"); @@ -248,17 +248,17 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering GetCameras connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering GET_CAMERAS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"); + console.info(TAG + "Entering GET_CAMERAS FAILED cameraArray is null || undefined"); } } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering GET_CAMERAS FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering GET_CAMERAS ends here"); await sleep(1000); done(); }) @@ -268,27 +268,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*CAMERA-0 Scripts*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 + * @tc.number : CREATE_CAMERA_INPUT * @tc.name : Create camerainput from camera-0 cameraId async api * @tc.desc : Create camerainput from camera-0 cameraId async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { + it('CREATE_CAMERA_INPUT', 0, async function (done) { cameraManager.createCameraInput(camerasArray[0].cameraId, async (err, data) => { if (!err) { if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT data is not null || undefined"); camera0Input = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :" + camerasArray[0].cameraId); + console.info(TAG + "Entering CREATE_CAMERA_INPUT PASSED with CameraID :" + camerasArray[0].cameraId); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering CREATE_CAMERA_INPUT FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT ends here"); await sleep(1000); done(); }) @@ -297,28 +297,57 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : CREATE_CAMERA_INPUT + * @tc.name : Create camerainput from camera-1 cameraId async api + * @tc.desc : Create camerainput from camera-1 cameraId async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT', 0, async function (done) { + cameraManager.createCameraInput(camerasArray[1].cameraId, async (err, data) => { + if (!err) { + if (data != null && data != undefined) { + console.info(TAG + "Entering CREATE_CAMERA_INPUT data is not null || undefined"); + camera1Input = data; + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT PASSED with CameraID :" + camerasArray[1].cameraId); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT FAILED: " + err.message); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT ends here"); + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering CameraInputCallbackOnError cameraInput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); camera0Input.on('error', async (err, data) => { if (!err) { console.info(TAG + "cameraInput error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Error in CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -330,15 +359,15 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*PreviewOutput APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 + * @tc.number : CREATE_PREVIEW_OUTPUT_SUCCESS * @tc.name : Create PreviewOutput instance api * @tc.desc : Create PreviewOutput instance api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); + it('CREATE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { + console.info(TAG + " Entering CREATE_PREVIEW_OUTPUT_SUCCESS to operate"); cameraObj.createPreviewOutput(surfaceId, async (err, data) => { if (!err) { console.info(TAG + " Entering createPreviewOutput success"); @@ -346,13 +375,13 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + " Entering createPreviewOutput data is not null || undefined"); previewOutputAsync = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED" + previewOutputAsync); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS PASSED" + previewOutputAsync); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 FAILED : " + err.message); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS FAILED : " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_0100 ends here"); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS ends here"); await sleep(1000); done(); }) @@ -361,28 +390,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Preview output callback on error api * @tc.desc : Preview output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutputAsync == null || previewOutputAsync == undefined) { console.info(TAG + "Entering PreviewOutputError callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate"); previewOutputAsync.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -394,15 +423,15 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*PhotoOutput APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 + * @tc.number : CREATE_PHOTO_OUTPUT_SUCCESS * @tc.name : Create PhotoOutput instance api * @tc.desc : Create PhotoOutput instance api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); + it('CREATE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS to operate"); console.info(TAG + 'Entering getImageReceiverSurfaceId') await getImageReceiverSurfaceId() await sleep(1000) @@ -413,11 +442,11 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); photoOutputAsync = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_0100 FAILED : " + err.message); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS FAILED : " + err.message); console.info(TAG + "Entering createPhotoOutput ends here"); } await sleep(1000); @@ -428,18 +457,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 + * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100', 0, async function (done) { + it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); photoOutputAsync.on('error', async (err, data) => { if (!err) { console.info(TAG + "PhotoOutputError callback is success"); @@ -449,7 +478,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -461,15 +490,15 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*CaptureSession APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 + * @tc.number : CREATE_CAPTURE_SESSION_SUCCESS * @tc.name : Create CaptureSession instance api * @tc.desc : Create CaptureSession instance api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 to operate"); + it('CREATE_CAPTURE_SESSION_SUCCESS', 0, async function (done) { + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS to operate"); cameraObj.createCaptureSession(null, async (err, data) => { if (!err) { console.info(TAG + "Entering createCaptureSession success"); @@ -477,12 +506,12 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering createCaptureSession data is not null || undefined"); captureSession = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_SUCCESS_0100 ends here"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_SUCCESS ends here"); } await sleep(1000); done(); @@ -493,28 +522,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { //Capturesession callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 + * @tc.number : CAP_SES_CALLBACK_ON_ERROR * @tc.name : CaptureSession callback on error api * @tc.desc : CaptureSession callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { + it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering captureSession error callback captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR to operate"); captureSession.on('error', async (err, data) => { if (!err) { console.info(TAG + " captureSession error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "Error in CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -526,30 +555,64 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 + * @tc.number : BEGIN_CONFIG_SUCCESS * @tc.name : CaptureSession_Begin config api * @tc.desc : CaptureSession_Begin config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100', 0, async function (done) { + it('BEGIN_CONFIG_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 to operate"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS to operate"); captureSession.beginConfig(async (err, data) => { if (!err) { console.info(TAG + "Entering beginConfig success"); if (data != null || data != undefined) { console.info(TAG + "Entering BeginConfig data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 beginConfig PASSED"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED"); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : ADD_INPUT_SUCCESS + * @tc.name : Add Input with camera1Input api + * @tc.desc : Add Input with camera1Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_INPUT_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering Addinput captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_INPUT_SUCCESS to operate"); + captureSession.addInput(camera1Input, async (err, data) => { + if (!err) { + console.info(TAG + "Entering AddInput success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering AddInput data is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0100 ends here"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS FAILED: " + err.message); + console.info(TAG + "Entering ADD_INPUT_SUCCESS ends here"); } await sleep(1000); done(); @@ -560,30 +623,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 + * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS to operate"); captureSession.addOutput(previewOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering AddOutput_Preview : Success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS ends here"); } await sleep(1000); done(); @@ -592,23 +655,23 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 + * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS * @tc.name : Remove preview Output api * @tc.desc : Remove preview Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100', 0, async function (done) { + it('REMOVE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 to operate"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS to operate"); captureSession.removeOutput(previewOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering remove preview Output success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); @@ -624,30 +687,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 + * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering AddOutput_Preview captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS to operate"); captureSession.addOutput(previewOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering AddOutput_Preview : Success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddOutput_Preview data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_0200 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS ends here"); } await sleep(1000); done(); @@ -656,30 +719,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 + * @tc.number : COMMIT_CONFIG_SUCCESS * @tc.name : commit config api * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); captureSession.commitConfig(async (err, data) => { if (!err) { console.info(TAG + "Entering commitConfig success"); if (data != null || data != undefined) { console.info(TAG + "Entering CommitConfig data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 ends here"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS ends here"); } await sleep(1000); done(); @@ -690,21 +753,21 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 + * @tc.number : isMirrorSupported_PHOTO_OUTPUT * @tc.name : isMirrorSupported * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); photoOutputAsync.isMirrorSupported(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); console.info(TAG + "isMirrorSupported : " + data); expect(true).assertTrue(); } else { @@ -719,21 +782,21 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 + * @tc.number : setMirror_true * @tc.name : setMirror true * @tc.desc : setMirror true * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { + it('setMirror_true', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); + console.info(TAG + "Entering setMirror_true to operate"); photoOutputAsync.setMirror(true, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); + console.info(TAG + "Entering setMirror_true is success:"); console.info(TAG + "setMirror is : " + 'True'); expect(true).assertTrue(); } else { @@ -748,21 +811,21 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 + * @tc.number : setMirror_false * @tc.name : setMirror false * @tc.desc : setMirror false * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { + it('setMirror_false', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); + console.info(TAG + "Entering setMirror_false to operate"); photoOutputAsync.setMirror(false, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success"); + console.info(TAG + "Entering setMirror_false is success"); console.info(TAG + "setMirror is : " + 'false'); expect(true).assertTrue(); } else { @@ -778,30 +841,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 + * @tc.number : BEGIN_CONFIG_SUCCESS * @tc.name : CaptureSession_Begin config api * @tc.desc : CaptureSession_Begin config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200', 0, async function (done) { + it('BEGIN_CONFIG_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering BeginConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 to operate"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS to operate"); captureSession.beginConfig(async (err, data) => { if (!err) { console.info(TAG + "Entering beginConfig success"); if (data != null || data != undefined) { console.info(TAG + "Entering BeginConfig data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 beginConfig PASSED"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_0200 ends here"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS ends here"); } await sleep(1000); done(); @@ -812,30 +875,62 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 + * @tc.number : REMOVE_INPUT_SUCCESS + * @tc.name : remove input api + * @tc.desc : remove input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_INPUT_SUCCESS', 0, async function (done) { + if (captureSession == null || captureSession == undefined) { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); + captureSession.removeInput(camera1Input, async (err, data) => { + if (!err) { + console.info(TAG + "Entering remove input success"); + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering Remove Input FAILED" + err.message); + console.info(TAG + "Entering Remove Input ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + } + done(); + }) + + /** + * @tc.number : ADD_INPUT_SUCCESS * @tc.name : Add Input with camera0Input api * @tc.desc : Add Input with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200', 0, async function (done) { + it('ADD_INPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering Addinput captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 to operate"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS to operate"); captureSession.addInput(camera0Input, async (err, data) => { if (!err) { console.info(TAG + "Entering AddInput success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddInput data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 addInput PASSED"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS addInput PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_0200 ends here"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS FAILED: " + err.message); + console.info(TAG + "Entering ADD_INPUT_SUCCESS ends here"); } await sleep(1000); done(); @@ -846,31 +941,31 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); captureSession.addOutput(photoOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering AddOutput_Photo success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED: " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1000); done(); }) @@ -880,23 +975,23 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS * @tc.name : Remove photo Output api * @tc.desc : Remove photo Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS to operate"); captureSession.removeOutput(photoOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering remove photo Output success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); @@ -912,31 +1007,31 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); captureSession.addOutput(photoOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering AddOutput_Photo success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED: " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1000); done(); }) @@ -946,30 +1041,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 + * @tc.number : COMMIT_CONFIG_SUCCESS * @tc.name : commit config api * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering CommitConfig captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); captureSession.commitConfig(async (err, data) => { if (!err) { console.info(TAG + "Entering commitConfig success"); if (data != null || data != undefined) { console.info(TAG + "Entering CommitConfig data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 ends here"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS FAILED : " + err.message); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS ends here"); } await sleep(1000); done(); @@ -980,18 +1075,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : FocusStateChange callback api * @tc.desc : FocusStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0Input.on('focusStateChange', async (err, data) => { if (!err) { console.info(TAG + "FocusState callback is success"); @@ -1001,7 +1096,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1000); done(); @@ -1012,18 +1107,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : ExposureStateChange callback api * @tc.desc : ExposureStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0Input.on('exposureStateChange', async (err, data) => { if (!err) { console.info(TAG + "ExposureStateChange callback is success"); @@ -1033,7 +1128,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1000); done(); @@ -1045,28 +1140,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { //preview callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START * @tc.name : Preview output callback on frame start api * @tc.desc : Preview output callback on frame start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutputAsync == null || previewOutputAsync == undefined) { console.info(TAG + "Entering PreviewStart frameStart Callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); previewOutputAsync.on("frameStart", async (err, data) => { if (!err) { console.info(TAG + "PreviewStart frameStart Callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1000); done(); @@ -1077,27 +1172,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END * @tc.name : Preview capture callback on frame end api * @tc.desc : Preview capture callback on frame end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (previewOutputAsync == null || previewOutputAsync == undefined) { console.info(TAG + "Entering PreviewOutput frameEnd Callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); previewOutputAsync.on('frameEnd', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 Callback is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END Callback is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message"); } await sleep(1000); done(); @@ -1109,28 +1204,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { //Capture callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START * @tc.name : Photo capture callback on capture start api * @tc.desc : Photo capture callback on capture start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); photoOutputAsync.on('captureStart', async (err, data) => { if (!err) { console.info(TAG + "Photo Capture Callback on CaptureStart is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); } await sleep(1000); done(); @@ -1141,18 +1236,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END * @tc.name : Photo capture callback on capture end api * @tc.desc : Photo capture callback on capture end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); photoOutputAsync.on('captureEnd', async (err, data) => { if (!err) { console.info(TAG + "captureEnd callback is success"); @@ -1163,7 +1258,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); } await sleep(1000); done(); @@ -1174,18 +1269,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER * @tc.name : Photo capture callback on frame shutter api * @tc.desc : Photo capture callback on frame shutter api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); photoOutputAsync.on('frameShutter', async (err, data) => { if (!err) { console.info(TAG + "frameShutter callback is success"); @@ -1196,7 +1291,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); } await sleep(1000); done(); @@ -1207,29 +1302,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 + * @tc.number : CAPTURE_SESSION_START * @tc.name : capture session start api * @tc.desc : capture session start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100', 0, async function (done) { + it('CAPTURE_SESSION_START', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering CaptureSession Start captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_START to operate"); captureSession.start(async (err, data) => { if (!err) { console.info(TAG + "Entering captureSession.start success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_START PASSED"); } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_0100 ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_START ends here"); await sleep(1000); done(); }) @@ -1240,29 +1335,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { //Location /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputAsync.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1000); done(); @@ -1273,29 +1368,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 photoOutput == null || undefined"); } else { console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); photoOutputAsync.capture(photosettings1, async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture with photosettings1"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here"); } await sleep(1000); done(); @@ -1306,30 +1401,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 * @tc.name : Photo output capture with photosettings2 api * @tc.desc : Photo output capture with photosettings2 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate"); photoOutputAsync.capture(photosettings2, async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture with photosettings2 success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); } await sleep(1000); done(); @@ -1340,18 +1435,18 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 to operate"); photoOutputAsync.capture(photosettings3, async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture with photosettings3 success"); @@ -1362,8 +1457,8 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 ends here"); } }) await sleep(1000); @@ -1379,23 +1474,23 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 to operate"); photoOutputAsync.capture(photosettings4, async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture with photosettings4 success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 ends here"); } }) await sleep(1000); @@ -1405,56 +1500,56 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { //FLASH Function API scripts /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 + * @tc.number : HAS_FLASH * @tc.name : check if has flash-camera0Input api * @tc.desc : check if has flash-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { + it('HAS_FLASH', 0, async function (done) { console.info(TAG + "hasFlash called.") camera0Input.hasFlash(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); + console.info(TAG + "Entering HAS_FLASH success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + data); + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); expect(data).assertEqual(true); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : " + err.message); + console.info(TAG + "Entering HAS_FLASH FAILED : " + err.message); expect().assertFail(); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); + console.info(TAG + "Entering HAS_FLASH ends here"); }) await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED * @tc.name : check if flash mode open is supported-camera0Input api * @tc.desc : check if flash mode open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : " + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1464,25 +1559,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 + * @tc.number : SET_FLASH_MODE_OPEN * @tc.name : set flash mode open camera0 api * @tc.desc : set flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); + it('SET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } await sleep(1000); done(); @@ -1492,29 +1587,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 + * @tc.number : GET_FLASH_MODE_OPEN * @tc.name : get flash mode open camera0 api * @tc.desc : get flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); + it('GET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_OPEN success"); if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_OPEN PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : " + err.message); + console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1000); done(); @@ -1524,28 +1619,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED * @tc.name : check if flash mode always open is supported-camera0Input api * @tc.desc : check if flash mode always open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { if (!err) { console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : " + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1555,25 +1650,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 + * @tc.number : SET_FLASH_MODE_ALWAYS_OPEN * @tc.name : set flash mode always open camera0 api * @tc.desc : set flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); + it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1000); done(); @@ -1583,29 +1678,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 + * @tc.number : GET_FLASH_MODE_ALWAYS_OPEN * @tc.name : get flash mode always open camera0 api * @tc.desc : get flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); + it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success"); if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: "); expect(true).assertTrue(); console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1000); done(); @@ -1615,28 +1710,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.name : check if flash mode auto is supported-camera0Input api * @tc.desc : check if flash mode auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { if (!err) { console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED :" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED :" + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1646,25 +1741,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 + * @tc.number : SET_FLASH_MODE_AUTO * @tc.name : set flash mode auto camera0 api * @tc.desc : set flash mode auto open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -1674,29 +1769,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 + * @tc.number : GET_FLASH_MODE_AUTO * @tc.name : get flash mode auto camera0 api * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 to operate"); + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); expect(true).assertTrue(); console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -1706,28 +1801,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.name : check if flash mode close is supported-camera0Input api * @tc.desc : check if flash mode close is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { if (!err) { console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED :" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED :" + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } await sleep(1000); done(); @@ -1737,25 +1832,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 + * @tc.number : SET_FLASH_MODE_CLOSE * @tc.name : set flash mode close camera0 api * @tc.desc : set flash mode close open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); + it('SET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } await sleep(1000); done(); @@ -1765,29 +1860,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 + * @tc.number : GET_FLASH_MODE_CLOSE * @tc.name : get flash mode auto camera0 api * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); + it('GET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); expect(true).assertTrue(); console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } await sleep(1000); done(); @@ -1797,27 +1892,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 + * @tc.number : GET_ZOOM_RATIO * @tc.name : get zoom ratio camera-0 cameraId api * @tc.desc : get zoom ratio camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100--------------"); + it('GET_ZOOM_RATIO', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO--------------"); camera0Input.getZoomRatioRange(async (err, data) => { if (!err) { if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 data is not null || undefined"); + console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 Success " + data) + console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data) } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 FAILED: " + err.message); + console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_0100 ends here"); + console.info(TAG + "Entering GET_ZOOM_RATIO ends here"); await sleep(1000); done(); }) @@ -1826,14 +1921,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 + * @tc.number : SET_GET_ZOOM_1_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100', 0, async function (done) { + it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(1, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 1"); @@ -1842,7 +1937,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); @@ -1859,14 +1954,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 + * @tc.number : SET_GET_ZOOM_2_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100', 0, async function (done) { + it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(2, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 2"); @@ -1875,7 +1970,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED "); } else { expect().assertFail(); @@ -1892,14 +1987,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 + * @tc.number : SET_GET_ZOOM_3_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100', 0, async function (done) { + it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(3, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 3"); @@ -1908,7 +2003,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); @@ -1925,14 +2020,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 + * @tc.number : SET_GET_ZOOM_4_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100', 0, async function (done) { + it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(4, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 4"); @@ -1941,7 +2036,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); @@ -1958,14 +2053,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 + * @tc.number : SET_GET_ZOOM_5_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100', 0, async function (done) { + it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(5, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 5"); @@ -1974,7 +2069,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); @@ -1991,14 +2086,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 + * @tc.number : SET_GET_ZOOM_6_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100', 0, async function (done) { + it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(6, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 6"); @@ -2007,7 +2102,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); @@ -2024,15 +2119,15 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED * @tc.name : check if focus mode locked is supported-camera0Input api * @tc.desc : check if focus mode locked is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { if (!err) { console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); @@ -2040,12 +2135,12 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED :" + err.message); + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED :" + err.message); expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); } await sleep(1000); done(); @@ -2055,24 +2150,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 + * @tc.number : SET_FOCUS_MODE_LOCKED * @tc.name : set focus mode locked camera0 api * @tc.desc : set focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 to operate"); + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); } await sleep(1000); done(); @@ -2082,27 +2177,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 + * @tc.number : GET_FOCUS_MODE_LOCKED * @tc.name : get focus mode locked camera0 api * @tc.desc : get focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); } await sleep(1000); done(); @@ -2112,26 +2207,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 + * @tc.number : GET_FOCAL_LENGTH * @tc.name : get focal length camera0 api * @tc.desc : get focal length camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); + it('GET_FOCAL_LENGTH', 0, async function (done) { + console.info(TAG + "Entering GET_FOCAL_LENGTH to operate"); camera0Input.getFocalLength(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focal length SUCCESS: " + JSON.stringify(data)); console.info(TAG + "Current Focal length is: " + JSON.stringify(data)); expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); + console.info(TAG + "GET_FOCAL_LENGTH PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); + console.info(TAG + "GET_FOCAL_LENGTH FAILED : " + err.message); + console.info(TAG + "GET_FOCAL_LENGTH ends here"); } await sleep(1000); done(); @@ -2141,14 +2236,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100 + * @tc.number : SET_FOCUS_POINT_focus mode manual * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { + it('SET_FOCUS_POINT_focus mode manual', 0, async function (done) { console.info(TAG + "Entering SET_FOCUS_POINT to operate"); camera0Input.setFocusPoint(Point1, async (err, data) => { if (!err) { @@ -2168,14 +2263,14 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100 + * @tc.number : GET_FOCUS_POINT_focus mode manual * @tc.name : get focus Point camera0 api * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_FOCUS_0100', 0, async function (done) { + it('GET_FOCUS_POINT_focus mode manual', 0, async function (done) { console.info(TAG + "Entering GET_FOCUS_POINT to operate"); camera0Input.getFocusPoint(async (err, data) => { if (!err) { @@ -2197,28 +2292,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.name : check if focus mode manual is supported-camera0Input api * @tc.desc : check if focus mode manual is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED " + err.message); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1000); done(); @@ -2228,25 +2323,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 + * @tc.number : SET_FOCUS_MODE_MANUAL * @tc.name : set focus mode manual camera0 api * @tc.desc : set focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); } await sleep(1000); done(); @@ -2256,27 +2351,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 + * @tc.number : GET_FOCUS_MODE_MANUAL * @tc.name : get focus mode manual camera0 api * @tc.desc : get focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 to operate"); + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 data is not null || undefined: "); + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); } await sleep(1000); done(); @@ -2286,64 +2381,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 - * @tc.name : Photo output capture without photosettings api - * @tc.desc : Photo output capture without photosettings api - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 to operate"); - photoOutputAsync.capture(async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture without photosettings success"); - if (data != null || data != undefined) { - console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 PASSED"); - expect(true).assertTrue(); - } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0100 ends here"); - } - await sleep(1000); - done(); - }) - await sleep(1000); - done(); - } - }) - - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 + * @tc.number : PHOTOOUTPUT_CAPTURE * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); photoOutputAsync.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0200 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } await sleep(1000); done(); @@ -2354,24 +2415,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 + * @tc.number : SET_FOCUS_POINT_focus mode continuous * @tc.name : set focus Point locked camera0 api * @tc.desc : set focus Point locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 to operate"); + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); camera0Input.setFocusPoint(Point2, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED") + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); } await sleep(1000); done(); @@ -2381,26 +2442,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 + * @tc.number : GET_FOCUS_POINT_focus mode continuous * @tc.name : get focus Point camera0 api * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); camera0Input.getFocusPoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); console.info(TAG + "Current Focus Point is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } await sleep(1000); done(); @@ -2410,28 +2471,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.name : check if focus mode continuous is supported-camera0Input api * @tc.desc : check if focus mode continuous is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : " + err.message); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1000); done(); @@ -2441,25 +2502,25 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 + * @tc.number : SET_FOCUS_MODE_CONTINUOUS * @tc.name : set focus mode continuous camera0 api * @tc.desc : set focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); } await sleep(1000); done(); @@ -2469,27 +2530,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 + * @tc.number : GET_FOCUS_MODE_CONTINUOUS * @tc.name : get focus mode continuous camera0 api * @tc.desc : get focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 data is not null || undefined: "); + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); } await sleep(1000); done(); @@ -2499,24 +2560,58 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 + * @tc.number : PHOTOOUTPUT_CAPTURE + * @tc.name : Photo output capture without photosettings api + * @tc.desc : Photo output capture without photosettings api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); + photoOutputAsync.capture(async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture without photosettings success"); + if (data != null || data != undefined) { + console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + } + }) + + /** + * @tc.number : SET_FOCUS_POINT_focus mode auto * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 to operate"); + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); camera0Input.setFocusPoint(Point3, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); } await sleep(1000); done(); @@ -2533,19 +2628,19 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); camera0Input.getFocusPoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } await sleep(1000); done(); @@ -2555,28 +2650,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.name : check if focus mode auto is supported-camera0Input api * @tc.desc : check if focus mode auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : " + err.message); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); } await sleep(1000); done(); @@ -2586,26 +2681,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 + * @tc.number : SET_FOCUS_MODE_AUTO * @tc.name : set focus mode auto camera0 api * @tc.desc : set focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); if (data != null || data != undefined) { expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -2615,27 +2710,27 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 + * @tc.number : GET_FOCUS_MODE_AUTO * @tc.name : get focus mode auto camera0 api * @tc.desc : get focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 data is not null || undefined: "); + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -2645,30 +2740,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 + * @tc.number : PHOTOOUTPUT_CAPTURE * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); photoOutputAsync.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0300 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } await sleep(1000); done(); @@ -2679,25 +2774,148 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check if exposure mode locked is supported-camera0Input api + * @tc.desc : check if exposure mode locked is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode Locked supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Locked supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Locked_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode Locked, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED FAILED") + expect().AssertFail(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED * @tc.name : get exposure mode locked camera0 api * @tc.desc : get exposure mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); camera0Input.getExposureMode(async (err, data) => { if (!err) { console.info(TAG + "Current ExposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED + * @tc.name : check if exposure mode continuous auto is supported-camera0Input api + * @tc.desc : check if exposure mode continuous auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_continuous_Auto_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode continuous auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().AssertFail(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } await sleep(1000); done(); @@ -2705,27 +2923,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { await sleep(1000); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO * @tc.name : get exposure mode continuous auto camera0 api * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); camera0Input.getExposureMode(async (err, data) => { if (!err) { console.info(TAG + "Current ExposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } await sleep(1000); done(); @@ -2735,26 +2954,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 + * @tc.number : GET_EXPOSURE_BIASRANGE * @tc.name : get exposure bias range camera0 api * @tc.desc : get exposure bias range camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 to operate"); + it('GET_EXPOSURE_BIASRANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASRANGE to operate"); camera0Input.getExposureBiasRange(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias range SUCCESS"); console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASRANGE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASRANGE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASRANGE ends here"); } await sleep(1000); done(); @@ -2764,24 +2983,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 -4 + * @tc.number : SET_EXPOSURE_BIAS_exposure -4 * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(-4, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -2791,26 +3010,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 mode locked + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode locked * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -2820,24 +3039,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 mode auto + * @tc.number : SET_EXPOSURE_POINT_exposure mode auto * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); camera0Input.setExposurePoint(Point1, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -2847,26 +3066,89 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 mode auto + * @tc.number : GET_EXPOSURE_POINT_exposure mode auto * @tc.name : get exposure point camera0 api * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); camera0Input.getExposurePoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure point SUCCESS"); console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check if exposure mode auto is supported-camera0Input api + * @tc.desc : check if exposure mode auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Auto_Supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); + } + await sleep(1000); + done(); + }) + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + if (data != null || data != undefined) { + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + } + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -2874,29 +3156,31 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { await sleep(1000); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 + * @tc.number : GET_EXPOSURE_MODE_AUTO * @tc.name : get exposure mode auto camera0 api * @tc.desc : get exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); + /* EXPOSUREMODE Interface will be change + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); camera0Input.getExposureMode(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure Mode SUCCESS"); console.info(TAG + "Get Exposure Mode data is not null || undefined: "); console.info(TAG + "Current ExposureMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); } await sleep(1000); done(); @@ -2904,32 +3188,33 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { await sleep(1000); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 + * @tc.number : PHOTOOUTPUT_CAPTURE * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "Entering PhotoOutputCapture photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE to operate"); photoOutputAsync.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_0400 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE ends here"); } await sleep(1000); done(); @@ -2940,24 +3225,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 mode auto + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(1, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -2967,26 +3252,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 mode auto + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode auto * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -2996,24 +3281,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 + * @tc.number : SET_EXPOSURE_POINT_exposure * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); camera0Input.setExposurePoint(Point2, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -3023,26 +3308,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 + * @tc.number : GET_EXPOSURE_POINT_ * @tc.name : get exposure point camera0 api * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); camera0Input.getExposurePoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure point SUCCESS"); console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -3051,58 +3336,58 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { done(); }) - /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 + /** + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { - if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); - } else { - console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); - photoOutputAsync.capture(photosettings1, async (err, data) => { - if (!err) { - console.info(TAG + "Entering photoOutput capture with photosettings1"); - if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 PASSED"); - expect(true).assertTrue(); + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { + if (photoOutputAsync == null || photoOutputAsync == undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 photoOutput == null || undefined"); + } else { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); + photoOutputAsync.capture(photosettings1, async (err, data) => { + if (!err) { + console.info(TAG + "Entering photoOutput capture with photosettings1"); + if (data != null || data != undefined) { + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED"); + expect(true).assertTrue(); + } + } else { + expect().assertFail(); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here"); } - } else { - expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 ends here"); - } + await sleep(1000); + done(); + }) await sleep(1000); done(); - }) - await sleep(1000); - done(); - } - }) + } + }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 mode auto + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(4, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -3112,26 +3397,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 mode continuous auto + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode continuous auto * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -3141,24 +3426,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 + * @tc.number : SET_EXPOSURE_POINT * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); camera0Input.setExposurePoint(Point3, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -3168,26 +3453,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 + * @tc.number : GET_EXPOSURE_POINT * @tc.name : get exposure point camera0 api * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); camera0Input.getExposurePoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure point SUCCESS"); console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1000); done(); @@ -3196,29 +3481,29 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate"); photoOutputAsync.capture(photosettings2, async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture with photosettings2"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); } await sleep(1000); done(); @@ -3229,24 +3514,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 -5 + * @tc.number : SET_EXPOSURE_BIAS_exposure -5 * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(-5, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -3256,26 +3541,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 mode locked + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode locked * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0400 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -3285,24 +3570,24 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 6 + * @tc.number : SET_EXPOSURE_BIAS_exposure 6 * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(6, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1000); done(); @@ -3312,26 +3597,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 + * @tc.number : GET_EXPOSURE_BIASVALUE * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_0500 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1000); done(); @@ -3342,30 +3627,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { /*CaptureSession APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 + * @tc.number : CAPTURE_SESSION_STOP * @tc.name : capture session stop api * @tc.desc : capture session stop api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100', 0, async function (done) { + it('CAPTURE_SESSION_STOP', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession == null || undefined"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP to operate"); captureSession.stop(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop success"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP captureSession.stop success"); if (data != null || data != undefined) { console.info(TAG + "Entering captureSession.stop data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 captureSession.stop PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP captureSession.stop PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_0100 ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP FAILED : " + err.message); + console.info(TAG + "Entering CAPTURE_SESSION_STOP ends here"); } await sleep(1000); done(); @@ -3376,30 +3661,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 + * @tc.number : CAPTURE_SESSION_RELEASE * @tc.name : capture session release api * @tc.desc : capture session release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100', 0, async function (done) { + it('CAPTURE_SESSION_RELEASE', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 captureSession == null || undefined"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE to operate"); captureSession.release(async (err, data) => { if (!err) { console.info(TAG + "Entering captureSession.release success"); if (data != null || data != undefined) { console.info(TAG + "Entering captureSession.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_0100 ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE FAILED: " + err.message); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE ends here"); await sleep(1000); done(); } @@ -3410,26 +3695,26 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 + * @tc.number : PHOTOOUPUT_RELEASE * @tc.name : photoOutput release api * @tc.desc : photoOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100', 0, async function (done) { + it('PHOTOOUPUT_RELEASE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 photoOutputAsync == null || undefined"); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE photoOutputAsync == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 to operate"); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE to operate"); photoOutputAsync.release(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutputAsync.release success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_0100 FAILED: " + err.message); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE FAILED: " + err.message); console.info(TAG + "Entering photoOutputAsync.release ends here"); } await sleep(1000); @@ -3441,28 +3726,28 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 + * @tc.number : PREVIEWOUPUT_RELEASE * @tc.name : previewOutput release api * @tc.desc : previewOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100', 0, async function (done) { + it('PREVIEWOUPUT_RELEASE', 0, async function (done) { if (previewOutputAsync == null || previewOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 previewOutputAsync == null || undefined"); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE previewOutputAsync == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 to operate"); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE to operate"); previewOutputAsync.release(async (err, data) => { if (!err) { console.info(TAG + "Entering previewOutputAsync.release success"); console.info(TAG + "Entering previewOutputAsync.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 PASSED"); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_0100 ends here"); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE FAILED: " + err.message); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE ends here"); await sleep(1000); done(); } @@ -3475,30 +3760,30 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 + * @tc.number : CAMERAINPUT_RELEASE_SUCCESS * @tc.name : camera Input release api * @tc.desc : camera Input release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100', 0, async function (done) { + it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 camera0Input == null || undefined"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS camera0Input == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 to operate"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS to operate"); camera0Input.release(async (err, data) => { if (!err) { console.info(TAG + "Entering camera0Input.release success"); if (data != null || data != undefined) { console.info(TAG + "Entering camera0Input.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_0100 ends here"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS FAILED: " + err.message); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS ends here"); await sleep(1000); done(); } diff --git a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets similarity index 57% rename from multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets index 080d0e5bf3ea3fb80edb88b704a8ae6078aaefe7..4680dc1b4070664a0e21024b08088133c2486b44 100644 --- a/multimedia/camera/cameraWideAngleRK/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets @@ -29,7 +29,8 @@ var previewOutputPromise; var photoOutputPromise; var CaptureSessionPromise; var surfaceId1; -var camerasArrayPromise; +var camerasArrayPromise +var camera1InputPromise; var Point1 = { x: 1, y: 1 } var Point2 = { x: 2, y: 2 } @@ -155,45 +156,45 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "----------Camera-PhotoMode-Promise-------------"); /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 + * @tc.number : GET_CAMERA_MANAGER_PROMISE * @tc.name : Create camera manager instance promise api * @tc.desc : Create camera manager instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); + it('GET_CAMERA_MANAGER_PROMISE', 0, async function (done) { + console.info("--------------GET_CAMERA_MANAGER_PROMISE--------------"); cameraManagerPromise = await cameraObj.getCameraManager(null); console.info(TAG + "Entering Get camera manager cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); if (cameraManagerPromise != null && cameraManagerPromise != undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here"); + console.info(TAG + "Entering GET_CAMERA_MANAGER_PROMISE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 + * @tc.number : CAMERA_STATUS_CALLBACK * @tc.name : camera status callback on CameraManager async api * @tc.desc : camera status callback on CameraManager async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { + it('CAMERA_STATUS_CALLBACK', 0, async function (done) { if (cameraManagerPromise == null || cameraManagerPromise == undefined) { console.info(TAG + 'Entering camera status callback cameraManagerPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') + console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK to operate') cameraManagerPromise.on('cameraStatus', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManagerPromise is success"); + console.info(TAG + "CAMERA_STATUS_CALLBACK cameraManagerPromise is success"); if (data != null || data != undefined) { console.info(TAG + "Camera status Callback CameraStatusInfo_Camera: " + data.camera); console.info(TAG + "Camera status Callback CameraStatusInfo_Status: " + data.status); @@ -201,7 +202,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAMERA_STATUS_CALLBACK FAILED: " + err.message); } await sleep(1000); done(); @@ -212,15 +213,15 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 + * @tc.number : GET_CAMERAS_PROMISE * @tc.name : Get camera from cameramanager to get array of camera promise api * @tc.desc : Get camera from cameramanager to get array of camera promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------"); + it('GET_CAMERAS_PROMISE', 0, async function (done) { + console.info("--------------GET_CAMERAS_PROMISE--------------"); camerasArrayPromise = await cameraManagerPromise.getCameras(); console.info(TAG + "Entering Get Cameras: " + JSON.stringify(camerasArrayPromise)); if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { @@ -237,56 +238,81 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering Get Cameras connection" + i + "Type: " + connectionType); } expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering GET_CAMERAS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering GET_CAMERAS_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here"); + console.info(TAG + "Entering GET_CAMERAS_PROMISE ends here"); await sleep(1000); done(); }) /*CAMERA-0 Scripts*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 + * @tc.number : CREATE_CAMERA_INPUT_PROMISE * @tc.name : Create camerainput from camera-0 cameraId promise api * @tc.desc : Create camerainput from camera-0 cameraId promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { + it('CREATE_CAMERA_INPUT_PROMISE', 0, async function (done) { console.info("--------------CAMERA-0 STARTS HERE--------------"); - console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------"); + console.info("--------------CREATE_CAMERA_INPUT_PROMISE--------------"); camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId); console.info(TAG + "Entering Create camerainput camera0InputPromise: " + JSON.stringify(camera0InputPromise)); if (camera0InputPromise != null && camera0InputPromise != undefined) { console.info(TAG + "Entering Create camerainput camera0InputPromise is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 + * @tc.number : CREATE_CAMERA_INPUT_PROMISE_Camera1 + * @tc.name : Create camerainput from camera-1 cameraId promise api + * @tc.desc : Create camerainput from camera-1 cameraId promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('CREATE_CAMERA_INPUT_PROMISE_Camera1', 0, async function (done) { + console.info("--------------CREATE_CAMERA_INPUT_PROMISE--------------"); + camera1InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[1].cameraId); + console.info(TAG + "Entering Create camerainput camera1InputPromise: " + JSON.stringify(camera1InputPromise)); + if (camera1InputPromise != null && camera1InputPromise != undefined) { + console.info(TAG + "Entering Create camerainput camera1InputPromise is not null || undefined"); + expect(true).assertTrue(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE PASSED"); + } else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE FAILED : "); + } + console.info(TAG + "Entering CREATE_CAMERA_INPUT_PROMISE ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { + it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 camera0InputPromise == null || undefined"); + console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR camera0InputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); camera0InputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "camera0InputPromise error callback is success"); @@ -296,7 +322,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -308,15 +334,15 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { /*PreviewOutput APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 + * @tc.number : CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE * @tc.name : Create PreviewOutput instance promise api * @tc.desc : Create PreviewOutput instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + " Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); + it('CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE', 0, async function (done) { + console.info(TAG + " Entering CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE to operate"); previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId); console.info(TAG + " Entering createPreviewOutput success"); if (previewOutputPromise != null || previewOutputPromise != undefined) { @@ -325,36 +351,36 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE FAILED : "); + console.info(TAG + "Entering CREATE_PREVIEW_OUTPUT_SUCCESS_PROMISE ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Preview output callback on error api * @tc.desc : Preview output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + "Entering Preview output callback on error previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate"); previewOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -366,15 +392,15 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { /*PhotoOutput APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 + * @tc.number : CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE * @tc.name : Create PhotoOutput instance promise api * @tc.desc : Create PhotoOutput instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); + it('CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE', 0, async function (done) { + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE to operate"); console.info(TAG + 'Entering getImageReceiverSurfaceId') await getImageReceiverSurfaceId() await sleep(1000) @@ -382,11 +408,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering createPhotoOutput success"); if (photoOutputPromise != null || photoOutputPromise != undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE FAILED : "); console.info(TAG + "Entering createPhotoOutput ends here"); } await sleep(1000); @@ -394,28 +420,28 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 + * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100', 0, async function (done) { + it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); photoOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "PhotoOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -427,26 +453,26 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { /*CaptureSession APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 + * @tc.number : CREATE_CAPTURE_SESSION_PROMISE * @tc.name : Create CaptureSession instance promise api * @tc.desc : Create Capturesession instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); + it('CREATE_CAPTURE_SESSION_PROMISE', 0, async function (done) { + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE to operate"); CaptureSessionPromise = await cameraObj.createCaptureSession(null); console.info(TAG + "Entering createCaptureSession success"); if (CaptureSessionPromise != null || CaptureSessionPromise != undefined) { console.info(TAG + "Entering createCaptureSession data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here"); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE FAILED : "); + console.info(TAG + "Entering CREATE_CAPTURE_SESSION_PROMISE ends here"); } await sleep(1000); done(); @@ -454,28 +480,28 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { //Capturesession callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 + * @tc.number : CAP_SES_CALLBACK_ON_ERROR * @tc.name : CaptureSession callback on error api * @tc.desc : CaptureSession callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100', 0, async function (done) { + it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering CaptureSession callback on error captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 to operate"); + console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR to operate"); CaptureSessionPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + " captureSession errorcallback is success"); if (data != null || data != undefined) { - console.info(TAG + "Error SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 with ErrorCode: " + data.code); + console.info(TAG + "Error CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_CALLBACK_ON_ERROR_0100 FAILED: " + err.message); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1000); done(); @@ -487,58 +513,89 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 + * @tc.number : CREATE_BEGIN_CONFIG_PROMISE * @tc.name : CaptureSession_Begin config promise api * @tc.desc : CaptureSession_Begin config promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100', 0, async function (done) { + it('CREATE_BEGIN_CONFIG_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering CaptureSession_Begin config captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 to operate"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE to operate"); const promise = await CaptureSessionPromise.beginConfig(); console.info(TAG + "Entering beginConfig success:"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 beginConfig PASSED"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE beginConfig PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE FAILED : "); + } + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_PROMISE ends here"); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : ADD_INPUT_PROMISE + * @tc.name : Add Input with camera0Input api + * @tc.desc : Add Input with camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ADD_INPUT_PROMISE', 0, async function (done) { + if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { + console.info(TAG + "Entering Add Input captureSession == null || undefined"); + } else { + console.info(TAG + "Entering ADD_INPUT_PROMISE to operate"); + const Promise = await CaptureSessionPromise.addInput(camera1InputPromise); + console.info(TAG + "Entering Add Input addInput success"); + if (Promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering ADD_INPUT_PROMISE addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering ADD_INPUT_PROMISE FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_INPUT_PROMISE ends here"); + await sleep(1000); + done(); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 + * @tc.number : ADD_OUTPUT_PREVIEW_PROMISE * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE to operate"); const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); console.info(TAG + "Entering Add preview Output : Success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE ends here"); await sleep(1000); done(); } @@ -547,29 +604,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 + * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS * @tc.name : Remove preview Output api * @tc.desc : Remove preview Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200', 0, async function (done) { + it('REMOVE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering Remove preview Output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 to operate"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); const Promise = await CaptureSessionPromise.removeOutput(previewOutputPromise); console.info(TAG + "Entering Remove preview Output success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 FAILED: "); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_0200 ends here"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1000); done(); } @@ -578,29 +635,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 + * @tc.number : ADD_OUTPUT_PREVIEW_PROMISE * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering Add preview Output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE to operate"); const promise = await CaptureSessionPromise.addOutput(previewOutputPromise); console.info(TAG + "Entering Add preview Output : Success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 FAILED : "); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_PROMISE_0200 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_PROMISE ends here"); await sleep(1000); done(); } @@ -609,28 +666,28 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 + * @tc.number : COMMIT_CONFIG_SUCCESS * @tc.name : commit config api * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering commit config captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 to operate"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); const promise = await CaptureSessionPromise.commitConfig(); console.info(TAG + "Entering commit config commitConfig success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0100 commitConfig ends here"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } await sleep(1000); done(); @@ -640,27 +697,27 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 + * @tc.number : isMirrorSupported_PHOTO_OUTPUT * @tc.name : isMirrorSupported * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100', 0, async function (done) { + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 to operate"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); await photoOutputPromise.isMirrorSupported() .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 is success"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); console.info(TAG + "isMirrorSupported : " + data); expect(true).assertTrue(); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_0100 FAILED : " + err.message); + console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); }); await sleep(1000); done(); @@ -670,26 +727,26 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 + * @tc.number : setMirror_true * @tc.name : setMirror true * @tc.desc : setMirror true * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100', 0, async function (done) { + it('setMirror_true', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 to operate"); + console.info(TAG + "Entering setMirror_true to operate"); await photoOutputPromise.setMirror(true).then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 is success:"); + console.info(TAG + "Entering setMirror_true is success:"); console.info(TAG + "setMirror is : " + 'True'); expect(true).assertTrue(); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_0100 FAILED : " + err.message); + console.info(TAG + "setMirror_true FAILED : " + err.message); }); await sleep(1000); done(); @@ -699,27 +756,27 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 + * @tc.number : setMirror_false * @tc.name : setMirror false * @tc.desc : setMirror false * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100', 0, async function (done) { + it('setMirror_false', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 to operate"); + console.info(TAG + "Entering setMirror_false to operate"); await photoOutputPromise.setMirror(false) .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 is success:"); + console.info(TAG + "Entering setMirror_false is success:"); console.info(TAG + "setMirror is : " + 'false'); expect(true).assertTrue(); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_FALSE_0100 FAILED : " + err.message); + console.info(TAG + "setMirror_false FAILED : " + err.message); }); await sleep(1000); done(); @@ -729,23 +786,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 + * @tc.number : CREATE_BEGIN_CONFIG_SUCCESS_PROMISE * @tc.name : CaptureSession_Begin config promise api * @tc.desc : CaptureSession_Begin config promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { + it('CREATE_BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"); const promise = await CaptureSessionPromise.beginConfig(); console.info(TAG + "Entering beginConfig success:"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); + console.info(TAG + "Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); } else { expect().assertFail(); @@ -758,29 +815,60 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 + * @tc.number : REMOVE_INPUT_SUCCESS + * @tc.name : remove input api + * @tc.desc : remove input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('REMOVE_INPUT_SUCCESS', 0, async function (done) { + if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); + } else { + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); + const Promise = await CaptureSessionPromise.removeInput(camera1InputPromise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise); + if (Promise == undefined) { + expect(true).assertTrue(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); + } + else { + expect().assertFail(); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); + } + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); + await sleep(1000); + done(); + } + await sleep(1000); + done(); + }) + + /** + * @tc.number : ADD_INPUT_PROMISE * @tc.name : Add Input with camera0Input api * @tc.desc : Add Input with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200', 0, async function (done) { + it('ADD_INPUT_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering Add Input captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 to operate"); + console.info(TAG + "Entering ADD_INPUT_PROMISE to operate"); const Promise = await CaptureSessionPromise.addInput(camera0InputPromise); console.info(TAG + "Entering Add Input addInput success"); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 addInput PASSED"); + console.info(TAG + "Entering ADD_INPUT_PROMISE addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 FAILED: "); + console.info(TAG + "Entering ADD_INPUT_PROMISE FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_PROMISE_0200 ends here"); + console.info(TAG + "Entering ADD_INPUT_PROMISE ends here"); await sleep(1000); done(); } @@ -789,29 +877,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); console.info(TAG + "Entering Add output with photo output success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 FAILED "); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1000); done(); } @@ -820,29 +908,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS * @tc.name : Remove photo Output api * @tc.desc : Remove photo Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100', 0, async function (done) { + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 to operate"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); const Promise = await CaptureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput success " + Promise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 addInput PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 FAILED: "); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_0100 ends here"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1000); done(); } @@ -851,29 +939,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 captureSession == null || undefined"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); const promise = await CaptureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 success"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 FAILED "); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_0200 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1000); done(); } @@ -882,28 +970,28 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 + * @tc.number : COMMIT_CONFIG_SUCCESS * @tc.name : commit config api * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering commit config captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 to operate"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); const promise = await CaptureSessionPromise.commitConfig(); console.info(TAG + "Entering commit config commitConfig success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_0200 commitConfig ends here"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } await sleep(1000); done(); @@ -913,18 +1001,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : FocusStateChange callback api * @tc.desc : FocusStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0InputPromise.on('focusStateChange', async (err, data) => { if (!err) { console.info(TAG + "FocusState callback is success"); @@ -934,7 +1022,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1000); done(); @@ -945,18 +1033,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : ExposureStateChange callback api * @tc.desc : ExposureStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100', 0, async function (done) { + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 to operate"); + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0InputPromise.on('exposureStateChange', async (err, data) => { if (!err) { console.info(TAG + "ExposureStateChange callback is success"); @@ -966,7 +1054,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT_0100 FAILED: " + err.message); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1000); done(); @@ -979,27 +1067,27 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { // callback related API //preview callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START * @tc.name : Preview output callback on frame start api * @tc.desc : Preview output callback on frame start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); previewOutputPromise.on('frameStart', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START_0100 FAILED :" + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED :" + err.message); } await sleep(1000); done(); @@ -1010,27 +1098,27 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END * @tc.name : Preview capture callback on frame end api * @tc.desc : Preview capture callback on frame end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); previewOutputPromise.on('frameEnd', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message"); } await sleep(1000); done(); @@ -1042,28 +1130,28 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { //Capture callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START * @tc.name : Photo capture callback on capture start api * @tc.desc : Photo capture callback on capture start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); photoOutputPromise.on('captureStart', async (err, data) => { if (!err) { console.info(TAG + "CaptureStart Callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 with captureId: " + data); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_START_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); } await sleep(1000); done(); @@ -1074,18 +1162,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END * @tc.name : Photo capture callback on capture end api * @tc.desc : Photo capture callback on capture end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); photoOutputPromise.on('captureEnd', async (err, data) => { if (!err) { console.info(TAG + "captureEnd callback is success"); @@ -1096,7 +1184,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_CAPTURE_END_0100 FAILED' + err.message); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); } await sleep(1000); done(); @@ -1107,29 +1195,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER * @tc.name : Photo capture callback on frame shutter api * @tc.desc : Photo capture callback on frame shutter api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); photoOutputPromise.on('frameShutter', async (err, data) => { if (!err) { console.info(TAG + "frameShutter callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 with timestamp: " + data.timestamp); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with captureId: " + data.captureId); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with timestamp: " + data.timestamp); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); } await sleep(1000); done(); @@ -1140,23 +1228,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 + * @tc.number : CAPTURE_SESSION_START_SUCCESS * @tc.name : capture session start api * @tc.desc : capture session start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100', 0, async function (done) { + it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering capture session start captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate"); await CaptureSessionPromise.start(); console.info(TAG + "Entering captureSession start success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_0100 ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here"); await sleep(1000); done(); } @@ -1166,29 +1254,29 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { //Location /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputPromise.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1000); done(); @@ -1199,14 +1287,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); } else { @@ -1216,14 +1304,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering photoOutput capture with settings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 PASSED"); expect(true).assertTrue(); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 FAILED:" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1 ends here"); }); await sleep(1000); done(); @@ -1233,31 +1321,31 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 to operate"); await photoOutputPromise.capture(photosettings2) .then(function (data) { console.info(TAG + "Entering photoOutput capture with settings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); expect(true).assertTrue(); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED:" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); }); await sleep(1000); done(); @@ -1267,31 +1355,31 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo output capture with photosettings photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 to operate"); await photoOutputPromise.capture(photosettings3) .then(function (data) { console.info(TAG + "Entering photoOutput capture with settings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings3 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 PASSED"); expect(true).assertTrue(); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 :" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 :" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS3 ends here"); }); await sleep(1000); done(); @@ -1301,31 +1389,31 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 to operate"); await photoOutputPromise.capture(photosettings4) .then(function (data) { console.info(TAG + "Entering photoOutput capture with settings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings4 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 PASSED"); expect(true).assertTrue(); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS4 ends here"); }); await sleep(1000); done(); @@ -1336,343 +1424,343 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { //FLASH Function API scripts /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 + * @tc.number : HAS_FLASH * @tc.name : check if has flash-camera0Input api * @tc.desc : check if has flash-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100--------------"); + it('HAS_FLASH', 0, async function (done) { + console.info("--------------HAS_FLASH--------------"); console.info(TAG + 'hasFlash called.') var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 success"); + console.info(TAG + "Entering HAS_FLASH success"); if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 is: " + JSON.stringify(hasFlashPromise)); + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise)); expect(hasFlashPromise).assertEqual(true); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 FAILED : "); + console.info(TAG + "Entering HAS_FLASH FAILED : "); expect().assertFail(); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_0100 ends here"); + console.info(TAG + "Entering HAS_FLASH ends here"); await sleep(1000) done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED * @tc.name : check if flash mode open is supported-camera0Input api * @tc.desc : check if flash mode open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 + * @tc.number : SET_FLASH_MODE_OPEN * @tc.name : set flash mode open camera0 api * @tc.desc : set flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 to operate"); + it('SET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 + * @tc.number : GET_FLASH_MODE_OPEN * @tc.name : get flash mode open camera0 api * @tc.desc : get flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 to operate"); + it('GET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate"); var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 success: " + JSON.stringify(GetFMOpen)); + console.info(TAG + "Entering GET_FLASH_MODE_OPEN success: " + JSON.stringify(GetFMOpen)); if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_OPEN PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : "); + console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED * @tc.name : check if flash mode always open is supported-camera0Input api * @tc.desc : check if flash mode always open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED SUCCESS "); if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 + * @tc.number : SET_FLASH_MODE_ALWAYS_OPEN * @tc.name : set flash mode always open camera0 api * @tc.desc : set flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); + it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate"); var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 + * @tc.number : GET_FLASH_MODE_ALWAYS_OPEN * @tc.name : get flash mode always open camera0 api * @tc.desc : get flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 to operate"); + it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate"); var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success"); if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : "); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.name : check if flash mode always open is supported-camera0Input api * @tc.desc : check if flash mode always open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED SUCCESS "); if (isFMAutoSupported != null || isFMAutoSupported != undefined) { console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 + * @tc.number : SET_FLASH_MODE_AUTO * @tc.name : set flash mode auto camera0 api * @tc.desc : set flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 + * @tc.number : GET_FLASH_MODE_AUTO * @tc.name : get flash mode auto camera0 api * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 to operate"); + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + GetFMAuto); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 + * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.name : check if flash mode close is supported-camera0Input api * @tc.desc : check if flash mode close is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 to operate"); + it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS "); if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 + * @tc.number : SET_FLASH_MODE_CLOSE * @tc.name : set flash mode close camera0 api * @tc.desc : set flash mode close camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 to operate"); + it('SET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate"); var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 + * @tc.number : GET_FLASH_MODE_CLOSE * @tc.name : get flash mode close camera0 api * @tc.desc : get flash mode close camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 to operate"); + it('GET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + GetFMClose); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED : "); + console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } await sleep(1000); done(); @@ -1680,40 +1768,40 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { //ZOOM Function /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 + * @tc.number : GET_ZOOM_RATIO_PROMISE * @tc.name : get zoom ratio camera-0 cameraId api promise api * @tc.desc : get zoom ratio camera-0 cameraId api promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100--------------"); + it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO_PROMISE--------------"); var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 setZoomRatioPromise is not null || undefined"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 PASSED"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise)); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 FAILED"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISE_0100 ends here"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_1_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(1); console.info(TAG + "setZoomRatio success: 1"); console.info(TAG + "getZoomRatio called") @@ -1721,10 +1809,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise1); if (getpromise1 != null && getpromise1 != undefined) { expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED"); expect().assertFail(); } await sleep(1000); @@ -1732,14 +1820,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_2_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(2); console.info(TAG + "setZoomRatio success: 2"); console.info(TAG + "getZoomRatio called") @@ -1747,10 +1835,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise2); if (getpromise2 != null && getpromise2 != undefined) { expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED"); expect().assertFail(); } await sleep(1000); @@ -1758,14 +1846,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_3_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(3); console.info(TAG + "setZoomRatio success: 3"); console.info(TAG + "getZoomRatio called") @@ -1773,10 +1861,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise3); if (getpromise3 != null && getpromise3 != undefined) { expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED"); expect().assertFail(); } await sleep(1000); @@ -1784,14 +1872,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_4_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(4); console.info(TAG + "setZoomRatio success: 4"); console.info(TAG + "getZoomRatio called") @@ -1799,10 +1887,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise4); if (getpromise4 != null && getpromise4 != undefined) { expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED"); expect().assertFail(); } await sleep(1000); @@ -1810,14 +1898,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_5_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(5); console.info(TAG + "setZoomRatio success: 5"); console.info(TAG + "getZoomRatio called") @@ -1825,10 +1913,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise5); if (getpromise5 != null && getpromise5 != undefined) { expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED"); expect().assertFail(); } await sleep(1000); @@ -1836,14 +1924,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_6_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(6); console.info(TAG + "setZoomRatio success: 6"); console.info(TAG + "getZoomRatio called") @@ -1851,10 +1939,10 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise6); if (getpromise6 != null && getpromise6 != undefined) { expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED"); expect().assertFail(); } await sleep(1000); @@ -1863,266 +1951,266 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { // FOCUS promise API's /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED * @tc.name : check is focus mode locked supported-camera0Input api * @tc.desc : check is focus mode locked supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); console.info(TAG + "Entering is focus mode locked supported SUCCESS "); if (isFMLockedSupported != null || isFMLockedSupported != undefined) { console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 PASSED"); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 FAILED : "); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_0100 ends here"); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 + * @tc.number : SET_FOCUS_MODE_LOCKED * @tc.name : set focus mode locked camera0 api * @tc.desc : set focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) .then(function (data) { console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 FAILED : ") + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") expect().assertFail(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); }); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 + * @tc.number : GET_FOCUS_MODE_LOCKED * @tc.name : get focus mode locked camera0 api * @tc.desc : get focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 to operate"); + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode locked success: "); if (data == 0) { console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); }); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 + * @tc.number : GET_FOCAL_LENGTH * @tc.name : get focal length camera0 api * @tc.desc : get focal length camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 to operate"); + it('GET_FOCAL_LENGTH', 0, async function (done) { + console.info(TAG + "Entering GET_FOCAL_LENGTH to operate"); await camera0InputPromise.getFocalLength() .then(function (data) { console.info(TAG + "Current focallength is: " + JSON.stringify(data)); expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 PASSED"); + console.info(TAG + "GET_FOCAL_LENGTH PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 FAILED : " + err.message); + console.info(TAG + "GET_FOCAL_LENGTH FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_0100 ends here"); + console.info(TAG + "GET_FOCAL_LENGTH ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 + * @tc.number : SET_FOCUS_POINT * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100', 0, async function (done) { + it('SET_FOCUS_POINT', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusPoint(Point1) .then(function (data) { console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 PASSED"); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 + * @tc.number : GET_FOCUS_POINT * @tc.name : get focus Point camera0 api * @tc.desc : get focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); await camera0InputPromise.getFocusPoint() .then(function (data) { console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 FAILED: " + err.message); + console.info(TAG + "GET_FOCUS_POINT FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0100 ends here"); + console.info(TAG + "GET_FOCUS_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.name : is focusmode manual supported * @tc.desc : is focusmode manual supported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 FAILED : "); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 + * @tc.number : SET_FOCUS_MODE_MANUAL * @tc.name : set focus mode manual camera0 api * @tc.desc : set focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 to operate"); + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) .then(function (data) { console.info(TAG + "setFocusManual: " + JSON.stringify(data)) console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 + * @tc.number : GET_FOCUS_MODE_MANUAL * @tc.name : get focus mode manual camera0 api * @tc.desc : get focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 to operate"); + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode manual SUCCESS"); if (data == 0) { console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); }); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputPromise.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0200 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1000); done(); @@ -2133,159 +2221,159 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 + * @tc.number : SET_FOCUS_POINT * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200', 0, async function (done) { + it('SET_FOCUS_POINT', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusPoint(Point2) .then(function (data) { console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 PASSED"); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0200 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 + * @tc.number : GET_FOCUS_POINT * @tc.name : get focus Point camera0 api * @tc.desc : get focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); await camera0InputPromise.getFocusPoint() .then(function (data) { console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 FAILED " + err.message); + console.info(TAG + "GET_FOCUS_POINT FAILED " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0200 ends here"); + console.info(TAG + "GET_FOCUS_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.name : check is focus mode continuous supported-camera0Input api * @tc.desc : check is focus mode continuous supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 FAILED : "); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 + * @tc.number : SET_FOCUS_MODE_CONTINUOUS * @tc.name : set focus mode continuous camera0 api * @tc.desc : set focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 to operate"); + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) .then(function (data) { console.info(TAG + "setFocusCont: " + JSON.stringify(data)) console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 + * @tc.number : GET_FOCUS_MODE_CONTINUOUS * @tc.name : get focus mode continuous camera0 api * @tc.desc : get focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 to operate"); + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode continuous SUCCESS"); if (data == 1) { console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 FAILED: " + err.message); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputPromise.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0300 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1000); done(); @@ -2296,158 +2384,158 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 + * @tc.number : SET_FOCUS_POINT * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300', 0, async function (done) { + it('SET_FOCUS_POINT', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusPoint(Point3) .then(function (data) { console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 PASSED"); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_0300 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 + * @tc.number : GET_FOCUS_POINT * @tc.name : get focus Point camera0 api * @tc.desc : get focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); await camera0InputPromise.getFocusPoint() .then(function (data) { console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 FAILED: " + err.message); + console.info(TAG + "GET_FOCUS_POINT FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_0300 ends here"); + console.info(TAG + "GET_FOCUS_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.name : check is focus mode auto supported-camera0Input api * @tc.desc : check is focus mode auto supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 to operate"); + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 FAILED : "); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); } await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 + * @tc.number : SET_FOCUS_MODE_AUTO * @tc.name : set focus mode auto camera0 api * @tc.desc : set focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 to operate"); + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) .then(function () { console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 + * @tc.number : GET_FOCUS_MODE_AUTO * @tc.name : get focus mode auto camera0 api * @tc.desc : get focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 to operate"); + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode auto SUCCESS " + JSON.stringify(data)); if (data == 2) { console.info(TAG + "Current FocusMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); } }) .catch((err) => { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); }); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputPromise.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0400 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1000); done(); @@ -2458,236 +2546,397 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check is exposure mode locked supported-camera0Input api + * @tc.desc : check is exposure mode locked supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: " + data); + expect(data).assertEqual(false); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked FAILED") + expect().assertFail() + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED * @tc.name : get exposure mode locked camera0 api * @tc.desc : get exposure mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 to operate"); + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); await camera0InputPromise.getExposureMode() .then(function (data) { console.info(TAG + "Entering get exposure mode locked SUCCESS"); console.info(TAG + "Current ExposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1000); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED + * @tc.name : check is exposure mode continuous auto supported-camera0Input api + * @tc.desc : check is exposure mode continuous auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: " + data); + expect(data).assertEqual(false); }) .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_0100 ends here"); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here"); await sleep(1000); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO * @tc.name : get exposure mode continuous auto camera0 api * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 to operate"); + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); await camera0InputPromise.getExposureMode() .then(function (data) { console.info(TAG + "Entering get exposure mode auto SUCCESS"); console.info(TAG + "Current exposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 + * @tc.number : GET_EXPOSURE_BIAS_RANGE * @tc.name : get exposure bias range camera0 api * @tc.desc : get exposure bias range camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 to operate"); + it('GET_EXPOSURE_BIAS_RANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_RANGE to operate"); await camera0InputPromise.getExposureBiasRange() .then(function (data) { console.info(TAG + "Entering getExposureBiasRange SUCCESS"); console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIAS_RANGE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIAS_RANGE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_RANGE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIAS_RANGE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100-4 + * @tc.number : SET_EXPOSURE_BIAS_-4 * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(-4) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 + * @tc.number : GET_EXPOSURE_BIAS_VALUE * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 to operate"); + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 + * @tc.number : SET_EXPOSURE_POINT * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); await camera0InputPromise.setExposurePoint(Point1) .then(function (data) { console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 FAILED: " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED: " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 + * @tc.number : GET_EXPOSURE_POINT * @tc.name : get exposure Point camera0 api * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); await camera0InputPromise.getExposurePoint() .then(function (data) { console.info(TAG + "Entering getExposurePoint SUCCESS"); console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check is exposure mode auto supported-camera0Input api + * @tc.desc : check is exposure mode auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: " + data); + expect(data).assertEqual(true); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED: " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); + await sleep(1000); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_AUTO * @tc.name : get exposure mode auto camera0 api * @tc.desc : get exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 to operate"); + /* EXPOSUREMODE Interface will be change + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); await camera0InputPromise.getExposureMode() .then(function (data) { console.info(TAG + "Entering get exposure mode auto SUCCESS"); console.info(TAG + "Current exposureMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); await sleep(1000); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputPromise.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_0500 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1000); done(); @@ -2698,133 +2947,133 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 + * @tc.number : SET_EXPOSURE_BIAS * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(1) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 + * @tc.number : GET_EXPOSURE_BIAS_VALUE * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 to operate"); + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 + * @tc.number : SET_EXPOSURE_POINT * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); await camera0InputPromise.setExposurePoint(Point2) .then(function (data) { console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 + * @tc.number : GET_EXPOSURE_POINT * @tc.name : get exposure Point camera0 api * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); await camera0InputPromise.getExposurePoint() .then(function (data) { console.info(TAG + "Entering getExposurePoint SUCCESS"); console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS to operate"); await photoOutputPromise.capture(photosettings1) .then(function (data) { console.info(TAG + "Entering photoOutput capture with Rotation-0 & Quality-0 success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings1 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 PASSED"); expect(true).assertTrue(); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 FAILED:" + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS1_0200 Rotation-0 & Quality-0 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 FAILED:" + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0 ends here"); }); await sleep(1000); done(); @@ -2834,116 +3083,116 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 + * @tc.number : SET_EXPOSURE_BIAS * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(4) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 + * @tc.number : GET_EXPOSURE_BIAS_VALUE * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 to operate"); + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 + * @tc.number : SET_EXPOSURE_POINT * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); await camera0InputPromise.setExposurePoint(Point3) .then(function (data) { console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 + * @tc.number : GET_EXPOSURE_POINT * @tc.name : get exposure Point camera0 api * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); await camera0InputPromise.getExposurePoint() .then(function (data) { console.info(TAG + "Entering getExposurePoint SUCCESS"); console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 * @tc.name : Photo output capture with photosettings api * @tc.desc : Photo output capture with photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS photoOutput == null || undefined"); } else { @@ -2953,14 +3202,14 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { console.info(TAG + "Entering photoOutput capture with location settings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture with photosettings2 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 PASSED"); expect(true).assertTrue(); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2_0200 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS2 ends here"); }); await sleep(1000); done(); @@ -2970,125 +3219,125 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400-5 + * @tc.number : SET_EXPOSURE_BIAS_-5 * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(-5) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0400 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 + * @tc.number : GET_EXPOSURE_BIAS_VALUE * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 to operate"); + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0400 ends here"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 + * @tc.number : SET_EXPOSURE_BIAS_6 * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(6) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_0500 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1000); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 + * @tc.number : GET_EXPOSURE_BIAS_VALUE * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 to operate"); + it('GET_EXPOSURE_BIAS_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIAS_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIAS_VALUE_0500 ends here"); + console.info(TAG + "GET_EXPOSURE_BIAS_VALUE ends here"); await sleep(1000); done(); }) /*CaptureSession APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 + * @tc.number : CAPTURE_SESSION_STOP_SUCCESS_PROMISE * @tc.name : capture session stop api * @tc.desc : capture session stop api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100', 0, async function (done) { + it('CAPTURE_SESSION_STOP_SUCCESS_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering capture session stop captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE to operate"); await CaptureSessionPromise.stop(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_SUCCESS_PROMISE_0100 captureSession.stop ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_STOP_SUCCESS_PROMISE captureSession.stop ends here"); await sleep(1000); done(); } @@ -3097,22 +3346,22 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE * @tc.name : capture session release api * @tc.desc : capture session release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) { console.info(TAG + "Entering capture session release captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE to operate"); await CaptureSessionPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } @@ -3121,22 +3370,22 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE * @tc.name : PreviewOutput release api * @tc.desc : PreviewOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); await previewOutputPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } @@ -3145,22 +3394,22 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE * @tc.name : PhotoOutput release api * @tc.desc : PhotoOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering PhotoOutput release photoOutputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); await photoOutputPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } @@ -3169,22 +3418,22 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : CAMERAINPUT_RELEASE_SUCCESS_PROMISE * @tc.name : cameraInput release api * @tc.desc : cameraInput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering cameraInput release camera0InputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE to operate"); await camera0InputPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISEPASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1000); done(); } diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets similarity index 57% rename from multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets index 571ca690ff89ac2fbd3becb18f81fc97bc447bf8..83ce6f80c8def8962629cc84b34a64c42f064caa 100644 --- a/multimedia/camera/cameraExceedWideAngle/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoAsync.test.ets @@ -254,15 +254,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 + * @tc.number : GET_CAMERA_MANAGER_TC * @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 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100--------------') + it('GET_CAMERA_MANAGER_TC', 0, async function (done) { + console.info('--------------GET_CAMERA_MANAGER_TC--------------') await sleep(1) cameraObj.getCameraManager(null, (err, data) => { if (!err) { @@ -271,13 +271,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering Get Camera Manager data is not null || undefined') cameraManager = data expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC PASSED') } } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC FAILED: ' + err.message) } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_CALLBACK_0100 ends here') + console.info(TAG + 'Entering GET_CAMERA_MANAGER_TC ends here') done() }) await sleep(1) @@ -285,18 +285,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 + * @tc.number : CAMERA_STATUS_CALLBACK * @tc.name : camera status callback on CameraManager async api * @tc.desc : camera status callback on CameraManager async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { + it('CAMERA_STATUS_CALLBACK', 0, async function (done) { if (cameraManager == null || cameraManager == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 cameraManager == null || undefined') + console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK cameraManager == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') + console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK to operate') cameraManager.on('cameraStatus', async (err, data) => { if (!err) { console.info(TAG + "Camera status Callback on cameraManager is success"); @@ -318,15 +318,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 + * @tc.number : GET_CAMERAS * @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 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------') + it('GET_CAMERAS', 0, async function (done) { + console.info('--------------GET_CAMERAS--------------') await sleep(1) cameraManager.getCameras((err, data) => { if (!err) { @@ -347,17 +347,17 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering Get Cameras connection' + i + 'Type: ' + connectionType) } expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering GET_CAMERAS PASSED') } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined') + console.info(TAG + 'Entering GET_CAMERAS FAILED cameraArray is null || undefined') } } } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering GET_CAMERAS FAILED: ' + err.message) } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here') + console.info(TAG + 'Entering GET_CAMERAS ends here') done() }) await sleep(1) @@ -366,16 +366,16 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { /*CAMERA-0 Scripts*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 + * @tc.number : CREATE_CAMERA_INPUT * @tc.name : Create camerainput from camera-0 cameraId async api * @tc.desc : Create camerainput from camera-0 cameraId async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100', 0, async function (done) { + it('CREATE_CAMERA_INPUT', 0, async function (done) { console.info('--------------CAMERA-0 STARTS HERE--------------') - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100--------------') + console.info('--------------CREATE_CAMERA_INPUT--------------') await sleep(1) cameraManager.createCameraInput(camerasArray[0].cameraId, (err, data) => { if (!err) { @@ -383,13 +383,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering Create camera input data is not null || undefined') camera0Input = data expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 PASSED with CameraID :' + camerasArray[0].cameraId) + console.info(TAG + 'Entering CREATE_CAMERA_INPUT PASSED with CameraID :' + camerasArray[0].cameraId) } } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CREATE_CAMERA_INPUT FAILED: ' + err.message) } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CREATE_CAMERA_INPUT ends here') done() }) await sleep(1) @@ -397,28 +397,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering Camera Input callback camera0Input == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); camera0Input.on('error', async (err, data) => { if (!err) { console.info(TAG + "camera0Input error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -429,15 +429,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 + * @tc.number : CREATE_PREVIEW_OUTPUT * @tc.name : Create previewoutput async api * @tc.desc : Create previewoutput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 to operate') + it('CREATE_PREVIEW_OUTPUT', 0, async function (done) { + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT to operate') await sleep(1) cameraObj.createPreviewOutput(surfaceId, (err, data) => { if (!err) { @@ -446,13 +446,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering Create preview output data is not null || undefined') previewOutput = data expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT PASSED') } } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT ends here') done() }) await sleep(1) @@ -460,28 +460,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Preview output callback on error api * @tc.desc : Preview output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { console.info(TAG + "Entering PreviewOutput callback on error previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate"); previewOutput.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -493,15 +493,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { /*PhotoOutput APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 + * @tc.number : CREATE_PHOTO_OUTPUT_SUCCESS * @tc.name : Create PhotoOutput instance api * @tc.desc : Create PhotoOutput instance api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); + it('CREATE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS to operate"); console.info(TAG + 'Entering getImageReceiverSurfaceId') await getImageReceiverSurfaceId() await sleep(1) @@ -512,11 +512,11 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering createPhotoOutput data is not null || undefined"); photoOutputAsync = data; expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS FAILED : " + err.message); console.info(TAG + "Entering createPhotoOutput ends here"); } await sleep(1); @@ -527,18 +527,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); photoOutputAsync.on('error', async (err, data) => { if (!err) { console.info(TAG + "PhotoOutputError callback is success"); @@ -548,7 +548,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -559,15 +559,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 + * @tc.number : CREATE_VIDEO_OUTPUT * @tc.name : Create videooutput async api * @tc.desc : Create videooutput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 to operate') + it('CREATE_VIDEO_OUTPUT', 0, async function (done) { + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT to operate') await getvideosurface() await sleep(2) cameraObj.createVideoOutput(videoId, (err, data) => { @@ -577,13 +577,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering Create videooutput data is not null || undefined') videoOutput = data expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT PASSED') } } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT FAILED: ' + err.message) } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT ends here') done() }) await sleep(1) @@ -591,29 +591,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : VideoOutput callback onerror async api * @tc.desc : VideoOutput callback onerror async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutput == null || undefined') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR videoOutput == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR to operate') await sleep(1) videoOutput.on('error', async (err, data) => { if (!err) { console.info(TAG + "VideoOutput Errorcallback is success") if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue() } } else { expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1) done() @@ -624,15 +624,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 + * @tc.number : CREATE_CAPTURE_SESSION * @tc.name : Create capturesession async api * @tc.desc : Create capturesession async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate') + it('CREATE_CAPTURE_SESSION', 0, async function (done) { + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION to operate') await sleep(1) cameraObj.createCaptureSession(null, async (err, data) => { if (!err) { @@ -641,13 +641,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + 'Entering Create capturesession data is not null || undefined') captureSession = data expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION PASSED') } } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION FAILED: ' + err.message) expect().assertFail() } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION ends here') await sleep(1) done() }) @@ -656,28 +656,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 + * @tc.number : CAP_SES_CALLBACK_ON_ERROR * @tc.name : CaptureSession callback on error api * @tc.desc : CaptureSession callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 captureSession == null || undefined"); + console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering CAP_SES_CALLBACK_ON_ERROR to operate"); captureSession.on('error', async (err, data) => { if (!err) { console.info(TAG + " captureSession errorcallback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -688,29 +688,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 + * @tc.number : BEGIN_CONFIG * @tc.name : Begin Config async api * @tc.desc : Begin Config async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100', 0, async function (done) { + it('BEGIN_CONFIG', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering Begin Config captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 to operate') + console.info(TAG + 'Entering BEGIN_CONFIG to operate') await sleep(1) captureSession.beginConfig((err, data) => { if (!err) { console.info(TAG + 'Entering Begin Config success') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering BEGIN_CONFIG PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering BEGIN_CONFIG FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_CALLBACK_0100 ends here') + console.info(TAG + 'Entering BEGIN_CONFIG ends here') done() }) await sleep(1) @@ -719,29 +719,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 + * @tc.number : ADD_INPUT * @tc.name : AddInput async api * @tc.desc : AddInput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100', 0, async function (done) { + it('ADD_INPUT', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering AddInput captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 to operate') + console.info(TAG + 'Entering ADD_INPUT to operate') await sleep(1) captureSession.addInput(camera0Input, (err, data) => { if (!err) { console.info(TAG + 'Entering AddInput success') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering ADD_INPUT PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_INPUT FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0100 ends here') + console.info(TAG + 'Entering ADD_INPUT ends here') done() }) await sleep(1) @@ -750,29 +750,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 + * @tc.number : ADD_OUTPUT_PREVIEW * @tc.name : AddOutput preview async api * @tc.desc : AddOutput preview async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering AddOutput preview captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 to operate') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW to operate') await sleep(1) captureSession.addOutput(previewOutput, (err, data) => { if (!err) { console.info(TAG + 'Entering AddOutput preview success') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0100 ends here') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW ends here') done() }) await sleep(1) @@ -781,31 +781,31 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); captureSession.addOutput(photoOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering AddOutput_Photo success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1); done(); }) @@ -815,29 +815,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 + * @tc.number : ADD_OUTPUT_VIDEO * @tc.name : AddOutput video async api * @tc.desc : AddOutput video async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100', 0, async function (done) { + it('ADD_OUTPUT_VIDEO', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering AddOutput video captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 to operate') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO to operate') await sleep(1) captureSession.addOutput(videoOutput, async (err, data) => { if (!err) { console.info(TAG + 'Entering AddOutput video success') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0100 ends here') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO ends here') await sleep(1); done() }) @@ -847,23 +847,23 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 + * @tc.number : REMOVE_INPUT_SUCCESS * @tc.name : remove input api * @tc.desc : remove input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('REMOVE_INPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); captureSession.removeInput(camera0Input, async (err, data) => { if (!err) { console.info(TAG + "Entering remove input success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); } else { expect().assertFail(); console.info(TAG + "Entering Remove Input FAILED" + err.message); @@ -878,23 +878,23 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 + * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS * @tc.name : Remove preview Output api * @tc.desc : Remove preview Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('REMOVE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS to operate"); captureSession.removeOutput(previewOutput, async (err, data) => { if (!err) { console.info(TAG + "Entering remove preview Output success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); console.info(TAG + "Entering Remove preview Output FAILED" + err.message); @@ -909,23 +909,23 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS * @tc.name : Remove photo Output api * @tc.desc : Remove photo Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS to operate"); captureSession.removeOutput(photoOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering remove photo Output success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering REMOVE_PHOTO_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); @@ -941,23 +941,23 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 + * @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS * @tc.name : Remove video Output api * @tc.desc : Remove video Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('REMOVE_VIDEO_OUTPUT_SUCCESS', 0, async function (done) { if (captureSession == null || captureSession == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS to operate"); captureSession.removeOutput(videoOutput, async (err, data) => { if (!err) { console.info(TAG + "Entering remove video Output success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); console.info(TAG + "Entering Remove video Output FAILED" + err.message); @@ -972,29 +972,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 + * @tc.number : ADD_INPUT * @tc.name : AddInput async api * @tc.desc : AddInput async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200', 0, async function (done) { + it('ADD_INPUT', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering AddInput captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 to operate') + console.info(TAG + 'Entering ADD_INPUT to operate') await sleep(1) captureSession.addInput(camera0Input, (err, data) => { if (!err) { console.info(TAG + 'Entering AddInput success') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 PASSED') + console.info(TAG + 'Entering ADD_INPUT PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_INPUT FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_CALLBACK_0200 ends here') + console.info(TAG + 'Entering ADD_INPUT ends here') done() }) await sleep(1) @@ -1003,30 +1003,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 + * @tc.number : ADD_OUTPUT_PREVIEW * @tc.name : AddOutput preview async api * @tc.desc : AddOutput preview async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering AddOutput captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 to operate') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW to operate') await sleep(1) captureSession.addOutput(previewOutput, (err, data) => { if (!err) { console.info(TAG + 'Entering AddOutput success') console.info(TAG + 'Entering AddOutput data is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 PASSED') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_CALLBACK_0200 ends here') + console.info(TAG + 'Entering ADD_OUTPUT_PREVIEW ends here') done() }) await sleep(1) @@ -1035,31 +1035,31 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 + * @tc.number : ADD_OUTPUT_PHOTO * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100', 0, async function (done) { + it('ADD_OUTPUT_PHOTO', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering AddOutput_Photo captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO to operate"); captureSession.addOutput(photoOutputAsync, async (err, data) => { if (!err) { console.info(TAG + "Entering AddOutput_Photo success"); if (data != null || data != undefined) { console.info(TAG + "Entering AddOutput_Photo data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_CALLBACK_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO ends here"); await sleep(1); done(); }) @@ -1069,30 +1069,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 + * @tc.number : ADD_OUTPUT_VIDEO * @tc.name : AddOutput video async api * @tc.desc : AddOutput video async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200', 0, async function (done) { + it('ADD_OUTPUT_VIDEO', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering AddOutput captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 to operate') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO to operate') await sleep(1) captureSession.addOutput(videoOutput, (err, data) => { if (!err) { console.info(TAG + 'Entering AddOutput success') console.info(TAG + 'Entering AddOutput data is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 PASSED') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 FAILED: ' + err.message) + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_CALLBACK_0200 ends here') + console.info(TAG + 'Entering ADD_OUTPUT_VIDEO ends here') done() }) await sleep(1) @@ -1102,26 +1102,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { //framerate /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 + * @tc.number : GET_FRAME_RATE_RANGE * @tc.name : get frame rate range camera0 api * @tc.desc : get frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 to operate"); + it('GET_FRAME_RATE_RANGE', 0, async function (done) { + console.info(TAG + "Entering GET_FRAME_RATE_RANGE to operate"); videoOutput.getFrameRateRange(async (err, data) => { if (!err) { console.info(TAG + "Entering get frame rate range success"); expect(true).assertTrue(); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FRAME_RATE_RANGE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FRAME_RATE_RANGE FAILED : " + err.message); + console.info(TAG + "GET_FRAME_RATE_RANGE ends here"); } await sleep(1); done(); @@ -1131,15 +1131,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Grp0 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Grp0', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 to operate"); videoOutput.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0, async (err, data) => { if (!err) { console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); @@ -1147,9 +1147,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp0_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 ends here"); } await sleep(1); done(); @@ -1159,15 +1159,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Mix * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Mix', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Mix to operate"); videoOutput.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix, async (err, data) => { if (!err) { console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); @@ -1175,9 +1175,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Mix PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Mix_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Mix ends here"); } await sleep(1); done(); @@ -1187,15 +1187,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Err1 * @tc.name : set frame rate range camera0 api_err * @tc.desc : set frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Err1', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 to operate"); videoOutput.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1, async (err, data) => { if (!err) { console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); @@ -1203,9 +1203,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err1_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 ends here"); } await sleep(1); done(); @@ -1215,15 +1215,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Err2 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Err2', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 to operate"); videoOutput.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2, async (err, data) => { if (!err) { console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); @@ -1231,9 +1231,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err2_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 ends here"); } await sleep(1); done(); @@ -1243,15 +1243,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Err3 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Err3', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 to operate"); videoOutput.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3, async (err, data) => { if (!err) { console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); @@ -1259,9 +1259,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Err3_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 ends here"); } await sleep(1); done(); @@ -1271,15 +1271,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Grp20 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Grp20', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 to operate"); videoOutput.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20, async (err, data) => { if (!err) { console.info(TAG + "Entering set frame rate range, current framerateRange is: " + JSON.stringify(data)); @@ -1287,9 +1287,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_Grp20_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 ends here"); } await sleep(1); done(); @@ -1299,26 +1299,86 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTEDOFF + * @tc.name : isVideoStabilizationModeSupported Off + * @tc.desc : isVideoStabilizationModeSupported async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTEDOFF', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create isVideoStabilizationModeSupported success') + expect(data).assertEqual(true) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF PASSED :' + data) + } + else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEOFF + * @tc.name : SetVideoStabilizationModeOff + * @tc.desc : SetVideoStabilizationModeOff async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.OFF, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Set VideoStabilization Mode Off success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF PASSED: ' + data) + expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0) + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEOFF ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_OFF * @tc.name : getVideoStabilizationModeOff * @tc.desc : getVideoStabilizationModeOff async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 to operate"); + it('GET_VIDEOSTABILIZATION_MODE_OFF', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_OFF to operate"); captureSession.getActiveVideoStabilizationMode(async (err, data) => { if (!err) { console.info(TAG + "Entering get Video Stabilization Mode Off success"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_OFF PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_OFF_CALLBACK_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_OFF FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_OFF ends here"); } await sleep(1); done(); @@ -1326,28 +1386,91 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_LOW + * @tc.name : is VideoStabilization Mode Low Supported + * @tc.desc : isVideoStabilizationModeSupported low async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_LOW', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported success') + if (data != null || data != undefined) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined') + expect(data).assertEqual(true) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW PASSED: ' + data) + } + } else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODELOW + * @tc.name : SetVideoStabilizationModelow + * @tc.desc : SetVideoStabilizationModelow async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Set VideoStabilization Mode Low success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW PASSED: ' + data) + expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW FAILED: ' + err.message) + expect().assertFail(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODELOW ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 + * @tc.number : GET_VIDEOSTABILIZATION_MODE_LOW * @tc.name : getVideoStabilizationModeLow * @tc.desc : getVideoStabilizationModeLOw async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 to operate"); + /* VideoStabilizationMode Interface will be change + it('GET_VIDEOSTABILIZATION_MODE_LOW', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_LOW to operate"); captureSession.getActiveVideoStabilizationMode(async (err, data) => { if (!err) { console.info(TAG + "Entering get Video Stabilization Mode low success"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(data).assertEqual(1) - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_LOW_CALLBACK_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_LOW ends here"); } await sleep(1); done(); @@ -1355,28 +1478,91 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE + * @tc.name : is VideoStabilization Mode Middle Supported + * @tc.desc : isVideoStabilizationModeSupported Middle async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering is VideoStabilization Mode middle Supported success') + if (data != null || data != undefined) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined') + expect(data).assertEqual(false) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE PASSED : ' + data) + } + } else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEMIDDLE + * @tc.name : SetVideoStabilizationModeMedium + * @tc.desc : SetVideoStabilizationModeMedium async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create Set VideoStabilization Mode middle success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE FAILED: ' + data) + expect().assertFail(); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE PASSED: ' + err.message) + expect(true).assertTrue(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEMIDDLE ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_MIDDLE * @tc.name : getVideoStabilizationModeMedium * @tc.desc : getVideoStabilizationModeMedium async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 to operate"); + it('GET_VIDEOSTABILIZATION_MODE_MIDDLE', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_MIDDLE to operate"); captureSession.getActiveVideoStabilizationMode(async (err, data) => { if (!err) { console.info(TAG + "Entering get Video Stabilization Mode medium success"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_MIDDLE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_MIDDLE_CALLBACK_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_MIDDLE FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_MIDDLE ends here"); } await sleep(1); done(); @@ -1386,26 +1572,86 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH + * @tc.name : is VideoStabilization Mode High Supported + * @tc.desc : isVideoStabilizationModeSupported High async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering is VideoStabilization Mode High Supported success') + expect(data).assertEqual(false) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH PASSED : ' + data) + } + else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEHIGH + * @tc.name : SetVideoStabilizationModeHigh + * @tc.desc : SetVideoStabilizationModeHigh async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create Set VideoStabilization Mode High success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH FAILED: ' + data) + expect().assertFail(); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH PASSED: ' + err.message) + expect(true).assertTrue(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEHIGH ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_HIGH * @tc.name : getVideoStabilizationModeHigh * @tc.desc : getVideoStabilizationModeHigh async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 to operate"); + it('GET_VIDEOSTABILIZATION_MODE_HIGH', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_HIGH to operate"); captureSession.getActiveVideoStabilizationMode(async (err, data) => { if (!err) { console.info(TAG + "Entering get Video Stabilization Mode High success"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_HIGH PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_HIGH_CALLBACK_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_HIGH FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_HIGH ends here"); } await sleep(1); done(); @@ -1415,26 +1661,88 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO + * @tc.name : is VideoStabilization Mode Auto Supported + * @tc.desc : isVideoStabilizationModeSupported Auto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO', 0, async function (done) { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO to operate') + captureSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering is VideoStabilization Mode Auto Supported success') + if (data != null || data != undefined) { + console.info(TAG + 'Entering isVideoStabilizationModeSupported data is not null || undefined') + expect(data).assertEqual(false) + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO PASSED : ' + data) + } + } else { + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO FAILED: ' + err.message) + expect().assertFail() + } + console.info(TAG + 'Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEAUTO + * @tc.name : SetVideoStabilizationModeAuto + * @tc.desc : SetVideoStabilizationModeAuto async api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO to operate') + captureSession.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO, async (err, data) => { + if (!err) { + console.info(TAG + 'Entering Create Set VideoStabilization Mode auto success') + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO FAILED: ' + data) + expect().assertFail(); + } + else { + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO PASSED: ' + err.message) + expect(true).assertTrue(); + } + console.info(TAG + 'Entering SET_VIDEOSTABILIZATIONMODEAUTO ends here') + await sleep(1) + done() + }) + await sleep(1) + done() + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATION_MODE_AUTO * @tc.name : getVideoStabilizationModeAuto * @tc.desc : getVideoStabilizationModeAuto async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 to operate"); + it('GET_VIDEOSTABILIZATION_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATION_MODE_AUTO to operate"); captureSession.getActiveVideoStabilizationMode(async (err, data) => { if (!err) { console.info(TAG + "Entering get Video Stabilization Mode Auto success"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATION_MODE_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_AUTO FAILED :" + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATION_MODE_AUTO ends here"); } await sleep(1); done(); @@ -1444,30 +1752,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 + * @tc.number : COMMIT_CONFIG * @tc.name : CommitConfig async api * @tc.desc : CommitConfig async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100', 0, async function (done) { + it('COMMIT_CONFIG', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering CommitConfig captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 to operate') + console.info(TAG + 'Entering COMMIT_CONFIG to operate') await sleep(1) captureSession.commitConfig(async (err, data) => { if (!err) { console.info(TAG + 'Entering CommitConfig success') console.info(TAG + 'Entering CommitConfig data is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering COMMIT_CONFIG PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering COMMIT_CONFIG FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_CALLBACK_0100 ends here') + console.info(TAG + 'Entering COMMIT_CONFIG ends here') await sleep(1) done() }) @@ -1477,18 +1785,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : FocusStateChange callback api * @tc.desc : FocusStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 to operate"); + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0Input.on('focusStateChange', async (err, data) => { if (!err) { console.info(TAG + "FocusState callback is success"); @@ -1498,7 +1806,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1); done(); @@ -1509,18 +1817,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : ExposureStateChange callback api * @tc.desc : ExposureStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0Input.on('exposureStateChange', async (err, data) => { if (!err) { console.info(TAG + "ExposureStateChange callback is success"); @@ -1530,7 +1838,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1); done(); @@ -1542,27 +1850,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { //callback API /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START * @tc.name : Preview output callback on frame start api * @tc.desc : Preview output callback on frame start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { console.info(TAG + "Entering Preview output callback on frame start previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); previewOutput.on('frameStart', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1); done(); @@ -1573,27 +1881,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END * @tc.name : Preview capture callback on frame end api * @tc.desc : Preview capture callback on frame end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { console.info(TAG + "Entering Preview capture callback on frame end previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate"); previewOutput.on('frameEnd', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message"); } await sleep(1); done(); @@ -1605,28 +1913,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { //Capture callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START * @tc.name : Photo capture callback on capture start api * @tc.desc : Photo capture callback on capture start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "Entering Photo Capture Callback on CaptureStart photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); photoOutputAsync.on('captureStart', async (err, data) => { if (!err) { console.info(TAG + "Photo Capture Callback on CaptureStart is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); } await sleep(1); done(); @@ -1637,18 +1945,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END * @tc.name : Photo capture callback on capture end api * @tc.desc : Photo capture callback on capture end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); photoOutputAsync.on('captureEnd', async (err, data) => { if (!err) { console.info(TAG + "captureEnd callback is success"); @@ -1659,7 +1967,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); } await sleep(1); done(); @@ -1670,18 +1978,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER * @tc.name : Photo capture callback on frame shutter api * @tc.desc : Photo capture callback on frame shutter api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); photoOutputAsync.on('frameShutter', async (err, data) => { if (!err) { console.info(TAG + "frameShutter callback is success"); @@ -1692,7 +2000,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); } await sleep(1); done(); @@ -1703,27 +2011,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START * @tc.name : VideoOutput callback onframestart async api * @tc.desc : VideoOutput callback onframestart async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { console.info(TAG + "Entering VideoOutput callback onframestart videoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); + console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate"); videoOutput.on('frameStart', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_FRAME_START is FAILED : " + err.message); } await sleep(1); done(); @@ -1734,28 +2042,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END * @tc.name : VideoOutput callback onframeend async api * @tc.desc : VideoOutput callback onframeend async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { console.info(TAG + 'Entering VideoOutput callback onframeend videoOutput == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate') await sleep(1) videoOutput.on('frameEnd', async (err, data) => { if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success'); + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END is success'); if (data != null || data != undefined) { expect(true).assertTrue() } } else { expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message); + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END FAILED' + err.message); } await sleep(1); done(); @@ -1766,29 +2074,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 + * @tc.number : CAPTURE_SESSION_START * @tc.name : CaptureSession start async api * @tc.desc : CaptureSession start async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100', 0, async function (done) { + it('CAPTURE_SESSION_START', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + "Entering CaptureSession start captureSession == null || undefined") } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 to operate") + console.info(TAG + "Entering CAPTURE_SESSION_START to operate") await sleep(1) captureSession.start(async (err, data) => { if (!err) { console.info(TAG + "Entering CaptureSession start success") expect(true).assertTrue() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 PASSED") + console.info(TAG + "Entering CAPTURE_SESSION_START PASSED") } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CAPTURE_SESSION_START FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CAPTURE_SESSION_START ends here') await sleep(1) done() }) @@ -1798,30 +2106,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 + * @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS * @tc.name : Photo output capture without photosettings api * @tc.desc : Photo output capture without photosettings api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100', 0, async function (done) { + it('PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 photoOutput == null || undefined"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS to operate"); photoOutputAsync.capture(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutput capture without photosettings success"); if (data != null || data != undefined) { console.info(TAG + "Entering photoOutput capture without photosettings data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS PASSED"); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS FAILED : " + err.message); + console.info(TAG + "Entering PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS ends here"); } await sleep(1); done(); @@ -1833,56 +2141,56 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { //FLASH Function API scripts /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 + * @tc.number : HAS_FLASH * @tc.name : check if has flash-camera0Input api * @tc.desc : check if has flash-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100', 0, async function (done) { + it('HAS_FLASH', 0, async function (done) { console.info(TAG + "hasFlash called.") camera0Input.hasFlash(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 success"); + console.info(TAG + "Entering HAS_FLASH success"); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 is: " + data); + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + data); expect(data).assertEqual(true); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering HAS_FLASH FAILED : " + err.message); expect().assertFail(); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_CALLBACK_0100 ends here"); + console.info(TAG + "Entering HAS_FLASH ends here"); }) await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED * @tc.name : check if flash mode open is supported-camera0Input api * @tc.desc : check if flash mode open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_OPEN supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); } await sleep(1); done(); @@ -1892,25 +2200,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 + * @tc.number : SET_FLASH_MODE_OPEN * @tc.name : set flash mode open camera0 api * @tc.desc : set flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); + it('SET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } await sleep(1); done(); @@ -1920,29 +2228,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 + * @tc.number : GET_FLASH_MODE_OPEN * @tc.name : get flash mode open camera0 api * @tc.desc : get flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 to operate"); + it('GET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_OPEN success"); if (data == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_OPEN PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : " + err.message); + console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1); done(); @@ -1952,28 +2260,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED * @tc.name : check if flash mode always open is supported-camera0Input api * @tc.desc : check if flash mode always open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { if (!err) { console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_ALWAYS_OPEN supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } await sleep(1); done(); @@ -1983,25 +2291,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 + * @tc.number : SET_FLASH_MODE_ALWAYS_OPEN * @tc.name : set flash mode always open camera0 api * @tc.desc : set flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); + it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1); done(); @@ -2011,29 +2319,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 + * @tc.number : GET_FLASH_MODE_ALWAYS_OPEN * @tc.name : get flash mode always open camera0 api * @tc.desc : get flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 to operate"); + it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success"); if (data == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: "); expect(true).assertTrue(); console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : " + err.message); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1); done(); @@ -2043,28 +2351,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.name : check if flash mode auto is supported-camera0Input api * @tc.desc : check if flash mode auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { if (!err) { console.info(TAG + "Entering FLASH_MODE_AUTO SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_AUTO supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED :" + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } await sleep(1); done(); @@ -2074,25 +2382,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 + * @tc.number : SET_FLASH_MODE_AUTO * @tc.name : set flash mode auto camera0 api * @tc.desc : set flash mode auto open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); } await sleep(1); done(); @@ -2102,29 +2410,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 + * @tc.number : GET_FLASH_MODE_AUTO * @tc.name : get flash mode auto camera0 api * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 to operate"); + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); if (data == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); expect(true).assertTrue(); console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); } await sleep(1); done(); @@ -2133,28 +2441,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.name : check if flash mode close is supported-camera0Input api * @tc.desc : check if flash mode close is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); camera0Input.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { if (!err) { console.info(TAG + "Entering FLASH_MODE_CLOSE SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED :" + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } await sleep(1); done(); @@ -2164,25 +2472,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 + * @tc.number : SET_FLASH_MODE_CLOSE * @tc.name : set flash mode close camera0 api * @tc.desc : set flash mode close open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); + it('SET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate"); camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } await sleep(1); done(); @@ -2192,29 +2500,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 + * @tc.number : GET_FLASH_MODE_CLOSE * @tc.name : get flash mode auto camera0 api * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 to operate"); + it('GET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); camera0Input.getFlashMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); if (data == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); expect(true).assertTrue(); console.info(TAG + "Current FlashMode is: " + data); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 FAILED :" + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED :" + err.message); + console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } await sleep(1); done(); @@ -2224,27 +2532,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 + * @tc.number : GET_ZOOM_RATIO * @tc.name : get zoom ratio camera-0 cameraId api * @tc.desc : get zoom ratio camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100--------------"); + it('GET_ZOOM_RATIO', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO--------------"); camera0Input.getZoomRatioRange(async (err, data) => { if (!err) { if (data != null && data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 Success " + data) + console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data) } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_CALLBACK_0100 ends here"); + console.info(TAG + "Entering GET_ZOOM_RATIO ends here"); await sleep(1); done(); }) @@ -2253,14 +2561,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 + * @tc.number : SET_GET_ZOOM_1_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100', 0, async function (done) { + it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(1, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 1"); @@ -2269,7 +2577,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_ASYNC_CALLBACK_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_1_ASYNC FAILED" + err.message); @@ -2286,14 +2594,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 + * @tc.number : SET_GET_ZOOM_2_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100', 0, async function (done) { + it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(2, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 2"); @@ -2302,7 +2610,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_ASYNC_CALLBACK_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED "); } else { expect().assertFail(); @@ -2319,14 +2627,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 + * @tc.number : SET_GET_ZOOM_3_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100', 0, async function (done) { + it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(3, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 3"); @@ -2335,7 +2643,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_ASYNC_CALLBACK_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_3_ASYNC FAILED" + err.message); @@ -2352,14 +2660,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 + * @tc.number : SET_GET_ZOOM_4_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100', 0, async function (done) { + it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(4, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 4"); @@ -2368,7 +2676,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_ASYNC_CALLBACK_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_4_ASYNC FAILED" + err.message); @@ -2385,14 +2693,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 + * @tc.number : SET_GET_ZOOM_5_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100', 0, async function (done) { + it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(5, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 5"); @@ -2401,7 +2709,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_ASYNC_CALLBACK_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_5_ASYNC FAILED" + err.message); @@ -2418,14 +2726,14 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 + * @tc.number : SET_GET_ZOOM_6_ASYNC * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100', 0, async function (done) { + it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) { camera0Input.setZoomRatio(6, (err, data) => { if (!err) { console.info(TAG + "setZoomRatio success: 6"); @@ -2434,7 +2742,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (!err) { console.info(TAG + "getZoomRatio success : " + data1); expect(data1).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_ASYNC_CALLBACK_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED "); } else { console.info(TAG + "GET_ZOOM_6_ASYNC FAILED" + err.message); @@ -2451,15 +2759,15 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED * @tc.name : check if focus mode locked is supported-camera0Input api * @tc.desc : check if focus mode locked is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { if (!err) { console.info(TAG + "Entering Is Focus Mode Locked Supported SUCCESS: " + data); @@ -2467,12 +2775,12 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { console.info(TAG + "Entering Is Focus Mode Locked Supported data is not null || undefined"); console.info(TAG + "FOCUS_MODE_LOCKED_SUPPORTED is: " + data); expect(data).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 FAILED :" + err.message); + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED :" + err.message); expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); } await sleep(1); done(); @@ -2482,24 +2790,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 + * @tc.number : SET_FOCUS_MODE_LOCKED * @tc.name : set focus mode locked camera0 api * @tc.desc : set focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Mode Locked SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : ") + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") expect().assertFail(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); } await sleep(1); done(); @@ -2509,27 +2817,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 + * @tc.number : GET_FOCUS_MODE_LOCKED * @tc.name : get focus mode locked camera0 api * @tc.desc : get focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 to operate"); + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Mode Locked SUCCESS: " + data); console.info(TAG + "Get Focus Mode Locked data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); } await sleep(1); done(); @@ -2539,28 +2847,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.name : check if focus mode manual is supported-camera0Input api * @tc.desc : check if focus mode manual is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 FAILED " + err.message); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1); done(); @@ -2570,25 +2878,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 + * @tc.number : SET_FOCUS_MODE_MANUAL * @tc.name : set focus mode manual camera0 api * @tc.desc : set focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 to operate"); + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); } await sleep(1); done(); @@ -2598,27 +2906,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 + * @tc.number : GET_FOCUS_MODE_MANUAL * @tc.name : get focus mode manual camera0 api * @tc.desc : get focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 to operate"); + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUALL_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); } await sleep(1); done(); @@ -2628,24 +2936,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 + * @tc.number : SET_FOCUS_POINT_focus mode manual * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 to operate"); + it('SET_FOCUS_POINT_focus mode manual', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); camera0Input.setFocusPoint(Point, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); } await sleep(1); done(); @@ -2655,26 +2963,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 + * @tc.number : GET_FOCUS_POINT_focus mode manual * @tc.name : get focus Point camera0 api * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 to operate"); + it('GET_FOCUS_POINT_focus mode manual', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); camera0Input.getFocusPoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); console.info(TAG + "Current Focus Point is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } await sleep(1); done(); @@ -2684,28 +2992,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.name : check if focus mode continuous is supported-camera0Input api * @tc.desc : check if focus mode continuous is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_CONTINOUS_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1); done(); @@ -2715,25 +3023,25 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 + * @tc.number : SET_FOCUS_MODE_CONTINUOUS * @tc.name : set focus mode continuous camera0 api * @tc.desc : set focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); } await sleep(1); done(); @@ -2743,27 +3051,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 + * @tc.number : GET_FOCUS_MODE_CONTINUOUS * @tc.name : get focus mode continuous camera0 api * @tc.desc : get focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 to operate"); + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); } await sleep(1); done(); @@ -2773,24 +3081,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 + * @tc.number : SET_FOCUS_POINT_focus mode continuous * @tc.name : set focus Point locked camera0 api * @tc.desc : set focus Point locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 to operate"); + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); camera0Input.setFocusPoint(Point, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 PASSED") + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); } await sleep(1); done(); @@ -2800,26 +3108,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 + * @tc.number : GET_FOCUS_POINT_focus mode continuous * @tc.name : get focus Point camera0 api * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); camera0Input.getFocusPoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); console.info(TAG + "Current Focus Point is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0200 ends here"); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } await sleep(1); done(); @@ -2829,28 +3137,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.name : check if focus mode auto is supported-camera0Input api * @tc.desc : check if focus mode auto is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 to operate"); + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 SUCCESS "); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED SUCCESS "); if (data != null || data != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED data is not null || undefined"); console.info(TAG + "FOCUS_MODE_AUTO_SUPPORTED is: " + data); expect(data).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); } } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_CALLBACK_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); } await sleep(1); done(); @@ -2860,26 +3168,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 + * @tc.number : SET_FOCUS_MODE_AUTO * @tc.name : set focus mode auto camera0 api * @tc.desc : set focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); if (data != null || data != undefined) { expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") } } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); } await sleep(1); done(); @@ -2889,27 +3197,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 + * @tc.number : GET_FOCUS_MODE_AUTO * @tc.name : get focus mode auto camera0 api * @tc.desc : get focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 to operate"); + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); camera0Input.getFocusMode(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 SUCCESS"); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 data is not null || undefined: "); + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS"); + console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: "); console.info(TAG + "Current FocusMode is: " + data); expect(data).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); } await sleep(1); done(); @@ -2919,24 +3227,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 + * @tc.number : SET_FOCUS_POINT_focus mode auto * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 to operate"); + it('SET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_POINT to operate"); camera0Input.setFocusPoint(Point, async (err, data) => { if (!err) { console.info(TAG + "Entering SetFocus Point, current FocusMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 PASSED") + console.info(TAG + "Entering SET_FOCUS_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); } await sleep(1); done(); @@ -2946,26 +3254,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 + * @tc.number : GET_FOCUS_POINT_focus mode auto * @tc.name : get focus Point camera0 api * @tc.desc : get focus point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); camera0Input.getFocusPoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Focus Point SUCCESS: " + JSON.stringify(data)); console.info(TAG + "Current Focus Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_CALLBACK_0300 ends here"); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT ends here"); } await sleep(1); done(); @@ -2975,25 +3283,87 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check if exposure mode locked is supported-camera0Input api + * @tc.desc : check if exposure mode locked is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode Locked supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Locked supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Locked_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode Locked, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED FAILED") + expect().assertFail(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED * @tc.name : get exposure mode locked camera0 api * @tc.desc : get exposure mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 to operate"); + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); camera0Input.getExposureMode(async (err, data) => { if (!err) { console.info(TAG + "Current ExposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_CALLBACK_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); } await sleep(1); done(); @@ -3003,24 +3373,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 + * @tc.number : SET_EXPOSURE_POINT_exposure mode locked * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); camera0Input.setExposurePoint(Point, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -3030,26 +3400,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 + * @tc.number : GET_EXPOSURE_POINT_exposure mode locked * @tc.name : get exposure point camera0 api * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); camera0Input.getExposurePoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure point SUCCESS"); console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -3059,26 +3429,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100_exposure mode continuous auto + * @tc.number : GET_EXPOSURE_BIASRANGE_exposure mode continuous auto * @tc.name : get exposure bias range camera0 api * @tc.desc : get exposure bias range camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 to operate"); + it('GET_EXPOSURE_BIASRANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASRANGE to operate"); camera0Input.getExposureBiasRange(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias range SUCCESS"); console.info(TAG + "Current Exposure bias range is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASRANGE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_CALLBACK_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASRANGE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASRANGE ends here"); } await sleep(1); done(); @@ -3088,24 +3458,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 + * @tc.number : SET_EXPOSURE_BIAS_exposure mode locked * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(-4, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "-4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1); done(); @@ -3115,26 +3485,58 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode locked * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check if exposure mode auto is supported-camera0Input api + * @tc.desc : check if exposure mode auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_Auto_Supported is: " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); } await sleep(1); done(); @@ -3142,29 +3544,62 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + if (data != null || data != undefined) { + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + } + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_AUTO * @tc.name : get exposure mode auto camera0 api * @tc.desc : get exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 to operate"); + /* EXPOSUREMODE Interface will be change + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); camera0Input.getExposureMode(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure Mode SUCCESS"); console.info(TAG + "Get Exposure Mode data is not null || undefined: "); console.info(TAG + "Current ExposureMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); } await sleep(1); done(); @@ -3172,26 +3607,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 + * @tc.number : SET_EXPOSURE_POINT_exposure mode auto * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); camera0Input.setExposurePoint(Point, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -3201,26 +3637,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 + * @tc.number : GET_EXPOSURE_POINT_exposure mode auto * @tc.name : get exposure point camera0 api * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); camera0Input.getExposurePoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure point SUCCESS"); console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -3230,24 +3666,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(1, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "1"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1); done(); @@ -3257,26 +3693,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode auto * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1); done(); @@ -3286,25 +3722,87 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED + * @tc.name : check if exposure mode continuous auto is supported-camera0Input api + * @tc.desc : check if exposure mode continuous auto is supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED to operate"); + camera0Input.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported SUCCESS "); + if (data != null || data != undefined) { + console.info(TAG + "Entering Is Exposure Mode continuous Auto supported data is not null || undefined"); + console.info(TAG + "Exposure_Mode_continuous_Auto_Supported is: " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED PASSED: "); + } + } else { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO_SUPPORTED ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + camera0Input.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO, async (err, data) => { + if (!err) { + console.info(TAG + "Entering Set Exposure Mode continuous auto,current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") + expect().AssertFail(); + } else { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); + } + await sleep(1); + done(); + }) + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO * @tc.name : get exposure mode continuous auto camera0 api * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 to operate"); + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); camera0Input.getExposureMode(async (err, data) => { if (!err) { console.info(TAG + "Current ExposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_CALLBACK_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); } await sleep(1); done(); @@ -3314,24 +3812,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 + * @tc.number : SET_EXPOSURE_POINT_exposure mode continuous auto * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); camera0Input.setExposurePoint(Point, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure Point, current ExposureMode is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -3341,26 +3839,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 + * @tc.number : GET_EXPOSURE_POINT_exposure mode continuous auto * @tc.name : get exposure point camera0 api * @tc.desc : get exposure point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); camera0Input.getExposurePoint(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure point SUCCESS"); console.info(TAG + "Current Exposure Point is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_CALLBACK_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); } await sleep(1); done(); @@ -3370,24 +3868,24 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); camera0Input.setExposureBias(4, async (err, data) => { if (!err) { console.info(TAG + "Entering Set Exposure bias is: " + "4"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_CALLBACK_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); } await sleep(1); done(); @@ -3397,26 +3895,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 + * @tc.number : GET_EXPOSURE_BIASVALUE_exposure mode continuous auto * @tc.name : get exposure bias value camera0 api * @tc.desc : get exposure bias value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 to operate"); + it('GET_EXPOSURE_BIASVALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASVALUE to operate"); camera0Input.getExposureValue(async (err, data) => { if (!err) { console.info(TAG + "Entering Get Exposure bias value SUCCESS"); console.info(TAG + "Current Exposure bias value is: " + JSON.stringify(data)); expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASVALUE_CALLBACK_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASVALUE FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASVALUE ends here"); } await sleep(1); done(); @@ -3426,21 +3924,21 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 + * @tc.number : isMirrorSupported_PHOTO_OUTPUT * @tc.name : isMirrorSupported * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100', 0, async function (done) { + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 to operate"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); photoOutputAsync.isMirrorSupported(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_CALLBACK_0100 is success"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); console.info(TAG + "isMirrorSupported : " + data); expect(true).assertTrue(); } else { @@ -3455,21 +3953,21 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 + * @tc.number : setMirror_true * @tc.name : setMirror true * @tc.desc : setMirror true * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100', 0, async function (done) { + it('setMirror_true', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 to operate"); + console.info(TAG + "Entering setMirror_true to operate"); photoOutputAsync.setMirror(true, async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_CALLBACK_0100 is success:"); + console.info(TAG + "Entering setMirror_true is success:"); console.info(TAG + "setMirror is : " + 'True'); expect(true).assertTrue(); } else { @@ -3484,28 +3982,28 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_START * @tc.name : VideoOutput start async api * @tc.desc : VideoOutput start async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_START', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 videoOutput == null || undefined") + console.info(TAG + "Entering VIDEO_OUTPUT_START videoOutput == null || undefined") } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 to operate") + console.info(TAG + "Entering VIDEO_OUTPUT_START to operate") await sleep(1) videoOutput.start(async (err, data) => { if (!err) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 success: " + JSON.stringify(data)) + console.info(TAG + "Entering VIDEO_OUTPUT_START success: " + JSON.stringify(data)) if (data == undefined) { expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_CALLBACK_0100 FAILED: " + err.message) + console.info(TAG + "Entering VIDEO_OUTPUT_START FAILED: " + err.message) } }) await sleep(1) @@ -3516,27 +4014,27 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 + * @tc.number : VIDEO_RECORDER_START * @tc.name : VideoRecorder start async api * @tc.desc : VideoRecorder start async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) { + it('VIDEO_RECORDER_START', 0, async function (done) { if (videoRecorder == null || videoRecorder == undefined) { console.info(TAG + 'Entering VideoRecorder start videoRecorder == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_RECORDER_START to operate') videoRecorder.start() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 called'); + console.info(TAG + 'VIDEO_RECORDER_START called'); sleep(3); console.info(TAG + 'Capture with photosettings1 during video - Start & setMirror: true') photoOutputAsync.capture(photosettings1) console.info(TAG + 'Capture during Video - End.') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_START_CALLBACK_0100 ends here') + console.info(TAG + 'Entering VIDEO_RECORDER_START PASSED') + console.info(TAG + 'Entering VIDEO_RECORDER_START ends here') await sleep(1) done() } @@ -3545,29 +4043,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_STOP * @tc.name : VideoOutput stop async api * @tc.desc : VideoOutput stop async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_STOP', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { console.info(TAG + 'Entering VideoOutput stop videoOutput == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP to operate') videoOutput.stop(async (err, data) => { if (!err) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 success: ' + JSON.stringify(data)) + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP success: ' + JSON.stringify(data)) if (data == undefined) { expect(true).assertTrue() } } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP FAILED: ' + err.message) } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_CALLBACK_0100 ends here') + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP ends here') await sleep(1) done() }) @@ -3577,21 +4075,21 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 + * @tc.number : VIDEO_RECORDER_STOP * @tc.name : VideoRecorder stop async api * @tc.desc : VideoRecorder stop async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) { + it('VIDEO_RECORDER_STOP', 0, async function (done) { if (videoRecorder == null || videoRecorder == undefined) { console.info(TAG + 'Entering VideoRecorder stop videoRecorder == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_RECORDER_STOP to operate') videoRecorder.stop() console.info(TAG + 'VideoRecorder stop stopVideo done.') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_RECORDER_STOP_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering VIDEO_RECORDER_STOP PASSED') expect(true).assertTrue() } await sleep(1) @@ -3599,29 +4097,29 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 + * @tc.number : CAPTURE_SESSION_STOP * @tc.name : CaptureSession stop async api * @tc.desc : CaptureSession stop async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100', 0, async function (done) { + it('CAPTURE_SESSION_STOP', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering CaptureSession stop captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 to operate') + console.info(TAG + 'Entering CAPTURE_SESSION_STOP to operate') await sleep(1) captureSession.stop((err, data) => { if (!err) { console.info(TAG + 'Entering CaptureSession stop success') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering CAPTURE_SESSION_STOP PASSED') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CAPTURE_SESSION_STOP FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CAPTURE_SESSION_STOP ends here') done() }) await sleep(1) @@ -3630,18 +4128,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 + * @tc.number : CAPTURE_SESSION_RELEASE * @tc.name : CaptureSession release async api * @tc.desc : CaptureSession release async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100', 0, async function (done) { + it('CAPTURE_SESSION_RELEASE', 0, async function (done) { if (captureSession == null || captureSession == undefined) { console.info(TAG + 'Entering CaptureSession release captureSession == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 to operate') + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE to operate') await sleep(1) captureSession.release(async (err, data) => { if (!err) { @@ -3649,13 +4147,13 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { if (data != null || data != undefined) { console.info(TAG + 'Entering CaptureSession release data is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 PASSED') + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE PASSED') } } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 FAILED: ' + err.message) + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE FAILED: ' + err.message) expect().assertFail(); } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_CALLBACK_0100 ends here') + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE ends here') await sleep(1) done() }) @@ -3665,30 +4163,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 + * @tc.number : VIDEOOUPUT_RELEASE_SUCCESS * @tc.name : videooutput release api * @tc.desc : videooutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('VIDEOOUPUT_RELEASE_SUCCESS', 0, async function (done) { if (videoOutput == null || videoOutput == undefined) { console.info(TAG + "Entering videooutput.release previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS to operate"); videoOutput.release(async (err, data) => { if (!err) { console.info(TAG + "Entering videooutput.release success"); if (data != null || data != undefined) { console.info(TAG + "Entering videooutput.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS FAILED: " + err.message); + console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS ends here"); await sleep(1); done(); } @@ -3699,18 +4197,18 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 + * @tc.number : PREVIEWOUPUT_RELEASE_SUCCESS * @tc.name : previewOutput release api * @tc.desc : previewOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('PREVIEWOUPUT_RELEASE_SUCCESS', 0, async function (done) { if (previewOutput == null || previewOutput == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 previewOutput == null || undefined"); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE_SUCCESS previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE_SUCCESS to operate"); previewOutput.release(async (err, data) => { if (!err) { console.info(TAG + "Entering previewOutput.release success"); @@ -3721,7 +4219,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering PREVIEWOUPUT_RELEASE_SUCCESS FAILED: " + err.message); console.info(TAG + "Entering previewOutput.release ends here"); await sleep(1); done(); @@ -3733,26 +4231,26 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 + * @tc.number : PHOTOOUPUT_RELEASE * @tc.name : photoOutput release api * @tc.desc : photoOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100', 0, async function (done) { + it('PHOTOOUPUT_RELEASE', 0, async function (done) { if (photoOutputAsync == null || photoOutputAsync == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 photoOutputAsync == null || undefined"); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE photoOutputAsync == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE to operate"); photoOutputAsync.release(async (err, data) => { if (!err) { console.info(TAG + "Entering photoOutputAsync.release success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTOOUPUT_RELEASE_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "Entering PHOTOOUPUT_RELEASE FAILED: " + err.message); console.info(TAG + "Entering photoOutputAsync.release ends here"); } await sleep(1); @@ -3764,30 +4262,30 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 + * @tc.number : CAMERAINPUT_RELEASE_SUCCESS * @tc.name : camera Input release api * @tc.desc : camera Input release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100', 0, async function (done) { + it('CAMERAINPUT_RELEASE_SUCCESS', 0, async function (done) { if (camera0Input == null || camera0Input == undefined) { console.info(TAG + "Entering camera0Input.release camera0Input == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 to operate"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS to operate"); camera0Input.release(async (err, data) => { if (!err) { console.info(TAG + "Entering camera0Input.release success"); if (data != null || data != undefined) { console.info(TAG + "Entering camera0Input.release data is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 PASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS PASSED"); } } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 FAILED: " + err.message); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_CALLBACK_0100 ends here"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS FAILED: " + err.message); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS ends here"); await sleep(1); done(); } diff --git a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets similarity index 55% rename from multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets rename to multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets index aa4466c90fbcc0482aff18bd91e25e3ae39d7b27..5e82a2e527d6ba246e6911e04518bafc81abb9c5 100644 --- a/multimedia/camera/cameraDepthOffield/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets +++ b/multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitVideoPromise.test.ets @@ -259,54 +259,54 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 + * @tc.number : GET_CAMERA_MANAGER_PROMISE * @tc.name : Create camera manager instance promise api * @tc.desc : Create camera manager instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------') + it('GET_CAMERA_MANAGER_PROMISE', 0, async function (done) { + console.info('--------------GET_CAMERA_MANAGER_PROMISE--------------') cameraManagerPromise = await cameraObj.getCameraManager(null) console.info(TAG + 'Entering Get cameraManagerPromise cameraManagerPromise: ' + cameraManagerPromise) if (cameraManagerPromise != null && cameraManagerPromise != undefined) { expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 PASSED') + console.info(TAG + 'Entering GET_CAMERA_MANAGER_PROMISE PASSED') } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 FAILED') + console.info(TAG + 'Entering GET_CAMERA_MANAGER_PROMISE FAILED') } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 ends here') + console.info(TAG + 'Entering GET_CAMERA_MANAGER_PROMISE ends here') await sleep(1) done() }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 + * @tc.number : CAMERA_STATUS_CALLBACK * @tc.name : camera status callback on CameraManager async api * @tc.desc : camera status callback on CameraManager async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100', 0, async function (done) { + it('CAMERA_STATUS_CALLBACK', 0, async function (done) { if (cameraManagerPromise == null || cameraManagerPromise == undefined) { console.info(TAG + 'Entering Camera status Callback cameraManagerPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 to operate') + console.info(TAG + 'Entering CAMERA_STATUS_CALLBACK to operate') await sleep(1) cameraManagerPromise.on('cameraStatus', async (err, data) => { if (!err) { console.info(TAG + "Camera status Callback on cameraManagerPromise is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Camera: " + data.camera); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 CameraStatusInfo_Status: " + data.status); + console.info(TAG + "CAMERA_STATUS_CALLBACK CameraStatusInfo_Camera: " + data.camera); + console.info(TAG + "CAMERA_STATUS_CALLBACK CameraStatusInfo_Status: " + data.status); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_STATUS_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAMERA_STATUS_CALLBACK FAILED: " + err.message); } await sleep(1); done(); @@ -317,15 +317,15 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 + * @tc.number : GET_CAMERAS_PROMISE * @tc.name : Create camera manager instance promise api * @tc.desc : Create camera manager instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100--------------') + it('GET_CAMERAS_PROMISE', 0, async function (done) { + console.info('--------------GET_CAMERAS_PROMISE--------------') camerasArrayPromise = await cameraManagerPromise.getCameras() console.info(TAG + 'Entering Get Cameras Promise: ' + JSON.stringify(camerasArrayPromise)) if (camerasArrayPromise != null && camerasArrayPromise.length > 0) { @@ -342,65 +342,65 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + 'Entering Get Cameras Promise connection' + i + 'Type: ' + connectionType) } expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 PASSED') + console.info(TAG + 'Entering GET_CAMERAS_PROMISE PASSED') } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 FAILED') + console.info(TAG + 'Entering GET_CAMERAS_PROMISE FAILED') } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 ends here') + console.info(TAG + 'Entering GET_CAMERAS_PROMISE ends here') await sleep(1) done() }) /*CAMERA-0 Scripts*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 + * @tc.number : CREATE_CAMERA_INPUT_PROMISE * @tc.name : Create camerainput from camera-0 cameraId promise api * @tc.desc : Create camerainput from camera-0 cameraId promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100--------------') + it('CREATE_CAMERA_INPUT_PROMISE', 0, async function (done) { + console.info('--------------CREATE_CAMERA_INPUT_PROMISE--------------') camera0InputPromise = await cameraManagerPromise.createCameraInput(camerasArrayPromise[0].cameraId) console.info(TAG + 'Entering Create camera input promise camera0InputPromise: ' + JSON.stringify(camera0InputPromise)) if (camera0InputPromise != null && camera0InputPromise != undefined) { console.info(TAG + 'Entering Create camera input promise camera0InputPromise is not null || undefined') expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 PASSED') + console.info(TAG + 'Entering CREATE_CAMERA_INPUT_PROMISE PASSED') } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED') + console.info(TAG + 'Entering CREATE_CAMERA_INPUT_PROMISE FAILED') } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here') + console.info(TAG + 'Entering CREATE_CAMERA_INPUT_PROMISE ends here') await sleep(1) done() }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : CAMERA_INPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('CAMERA_INPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering Camera input error callback camera0InputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering CAMERA_INPUT_CALLBACK_ON_ERROR to operate"); camera0InputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "camera0InputPromise error callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAMERA_INPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -411,43 +411,43 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 + * @tc.number : CREATE_PREVIEW_OUTPUT_PROMISE * @tc.name : Create previewoutput promise api * @tc.desc : Create previewoutput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info('--------------SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100--------------') + it('CREATE_PREVIEW_OUTPUT_PROMISE', 0, async function (done) { + console.info('--------------CREATE_PREVIEW_OUTPUT_PROMISE--------------') previewOutputPromise = await cameraObj.createPreviewOutput(surfaceId) console.info(TAG + 'Entering Create previewOutputPromise: ' + JSON.stringify(previewOutputPromise)) if (previewOutputPromise != null && previewOutputPromise != undefined) { console.info(TAG + 'Entering Create previewOutputPromise is not null || undefined') expect(true).assertTrue(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 PASSED') + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE PASSED') } else { expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 FAILED') + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE FAILED') } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_PROMISE_0100 ends here') + console.info(TAG + 'Entering CREATE_PREVIEW_OUTPUT_PROMISE ends here') await sleep(1) done() }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 + * @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : FocusStateChange callback api * @tc.desc : FocusStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { + it('FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering FocusStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); + console.info(TAG + "Entering FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0InputPromise.on('focusStateChange', async (err, data) => { if (!err) { console.info(TAG + "FocusState callback is success"); @@ -457,7 +457,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_FOCUSSTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1); done(); @@ -468,18 +468,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 + * @tc.number : EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT * @tc.name : ExposureStateChange callback api * @tc.desc : ExposureStateChange callback api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100', 0, async function (done) { + it('EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering ExposureStateChange callback previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 to operate"); + console.info(TAG + "Entering EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT to operate"); camera0InputPromise.on('exposureStateChange', async (err, data) => { if (!err) { console.info(TAG + "ExposureStateChange callback is success"); @@ -489,7 +489,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_EXPOSURESTATECHANGE_ON_CAMERAINPUT_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "EXPOSURESTATECHANGE_CALLBACK_ON_CAMERAINPUT FAILED: " + err.message); } await sleep(1); done(); @@ -500,29 +500,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_ERROR * @tc.name : PreviewOutput callback onerror async api * @tc.desc : PreviewOutput callback onerror async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + 'Entering PreviewOutputError callback previewOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') + console.info(TAG + 'Entering PREVIEW_OUTPUT_CALLBACK_ON_ERROR to operate') await sleep(1) previewOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "PreviewOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -533,55 +533,55 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 + * @tc.number : CREATE_VIDEO_OUTPUT_PROMISE * @tc.name : Create videooutput promise api * @tc.desc : Create videooutput promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 to operate') + it('CREATE_VIDEO_OUTPUT_PROMISE', 0, async function (done) { + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE to operate') await getvideosurface() await sleep(2) videoOutputPromise = await cameraObj.createVideoOutput(videoId) console.info(TAG + 'Entering Create videoOutputPromise: ' + videoOutputPromise) if (videoOutputPromise != null && videoOutputPromise != undefined) { expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 PASSED') + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE PASSED') } else { expect().assertFail(); - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 FAILED') + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE FAILED') } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_PROMISE_0100 ends here'); + console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE ends here'); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : VideoOutput callback onerror async api * @tc.desc : VideoOutput callback onerror async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 videoOutputPromise == null || undefined') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR videoOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR to operate') await sleep(1) videoOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + 'VideoOutput Errorcallback is success') if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue() } } else { expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1) done() @@ -593,15 +593,15 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { /*PhotoOutput APIs test script*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 + * @tc.number : CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE * @tc.name : Create PhotoOutput instance promise api * @tc.desc : Create PhotoOutput instance promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); + it('CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE', 0, async function (done) { + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE to operate"); console.info(TAG + 'Entering getImageReceiverSurfaceId') await getImageReceiverSurfaceId() await sleep(1) @@ -609,11 +609,11 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "Entering createPhotoOutput success"); if (photoOutputPromise != null || photoOutputPromise != undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering CREATE_PHOTO_OUTPUT_SUCCESS_PROMISE FAILED : "); console.info(TAG + "Entering createPhotoOutput ends here"); } await sleep(1); @@ -621,28 +621,28 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 + * @tc.number : PHOTO_OUTPUT_CALLBACK_ON_ERROR * @tc.name : Photo output callback on error api * @tc.desc : Photo output callback on error api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('PHOTO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo output callback on error photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_OUTPUT_CALLBACK_ON_ERROR to operate"); photoOutputPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + "PhotoOutputError callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_OUTPUT_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -653,53 +653,53 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 + * @tc.number : CREATE_CAPTURE_SESSION_PROMISE * @tc.name : Create capturesession promise api * @tc.desc : Create capturesession promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 0, async function (done) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate') + it('CREATE_CAPTURE_SESSION_PROMISE', 0, async function (done) { + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE to operate') captureSessionPromise = await cameraObj.createCaptureSession(null) console.info(TAG + 'Entering Create captureSessionPromise: ' + captureSessionPromise) if (captureSessionPromise != null && captureSessionPromise != undefined) { expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED') + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE PASSED') } else { expect().assertFail() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 FAILED') + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE FAILED') } - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 ends here'); + console.info(TAG + 'Entering CREATE_CAPTURE_SESSION_PROMISE ends here'); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 + * @tc.number : CAP_SES_CALLBACK_ON_ERROR * @tc.name : CaptureSession callback onerror async api * @tc.desc : CaptureSession callback onerror async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100', 0, async function (done) { + it('CAP_SES_CALLBACK_ON_ERROR', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + 'Entering captureSession errorcallback captureSessionPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 to operate') + console.info(TAG + 'Entering CAP_SES_CALLBACK_ON_ERROR to operate') await sleep(1) captureSessionPromise.on('error', async (err, data) => { if (!err) { console.info(TAG + " captureSession errorcallback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 with ErrorCode: " + data.code); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR with ErrorCode: " + data.code); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CAP_SES_ON_ERROR_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "CAP_SES_CALLBACK_ON_ERROR FAILED: " + err.message); } await sleep(1); done(); @@ -711,58 +711,58 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { /*CaptureSession APIs*/ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 + * @tc.number : BEGIN_CONFIG_SUCCESS_PROMISE * @tc.name : CaptureSession_Begin config promise api * @tc.desc : CaptureSession_Begin config promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { + it('BEGIN_CONFIG_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering Create captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE to operate"); const promise = await captureSessionPromise.beginConfig(); console.info(TAG + "Entering beginConfig success:"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 beginConfig PASSED"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_BEGIN_CONFIG_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS_PROMISE ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 + * @tc.number : ADD_INPUT_SUCCESS_PROMISE * @tc.name : Add Input with camera0Input api * @tc.desc : Add Input with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { + it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering Add Input captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); const Promise = await captureSessionPromise.addInput(camera0InputPromise); console.info(TAG + "Entering Add Input success"); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 addInput PASSED"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 FAILED: "); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE ends here"); await sleep(1); done(); } @@ -771,29 +771,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 + * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering Add preview output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); const promise = await captureSessionPromise.addOutput(previewOutputPromise); console.info(TAG + "Entering Add preview output : Success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED : "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here"); await sleep(1); done(); } @@ -802,29 +802,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 + * @tc.number : ADD_OUTPUT_VIDEO_SUCCESS * @tc.name : Add output with video output api * @tc.desc : Add output with video output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100', 0, async function (done) { + it('ADD_OUTPUT_VIDEO_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering Add video output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS to operate"); const promise = await captureSessionPromise.addOutput(videoOutputPromise); console.info(TAG + "Entering Add video output success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 FAILED: "); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS ends here"); await sleep(1); done(); } @@ -833,29 +833,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 + * @tc.number : ADD_OUTPUT_PHOTO * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100', 0, async function (done) { + it('ADD_OUTPUT_PHOTO', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering Add output with photo output captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO to operate"); const promise = await captureSessionPromise.addOutput(photoOutputPromise); console.info(TAG + "Entering Add output with photo output success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 FAILED "); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO FAILED "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO ends here"); await sleep(1); done(); } @@ -864,29 +864,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 + * @tc.number : REMOVE_INPUT_SUCCESS * @tc.name : remove input api * @tc.desc : remove input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100', 0, async function (done) { + it('REMOVE_INPUT_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); const Promise = await captureSessionPromise.removeInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 success " + Promise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 FAILED: "); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_INPUT_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1); done(); } @@ -895,29 +895,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 + * @tc.number : REMOVE_PREVIEW_OUTPUT_SUCCESS * @tc.name : Remove preview Output api * @tc.desc : Remove preview Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { + it('REMOVE_PREVIEW_OUTPUT_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS to operate"); const Promise = await captureSessionPromise.removeOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PREVIEW_OUTPUT_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering REMOVE_PREVIEW_OUTPUT_SUCCESS ends here"); await sleep(1); done(); } @@ -926,29 +926,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 + * @tc.number : REMOVE_PHOTO_OUTPUT_SUCCESS * @tc.name : Remove photo Output api * @tc.desc : Remove photo Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { + it('REMOVE_PHOTO_OUTPUT_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS to operate"); const Promise = await captureSessionPromise.removeOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput success " + Promise); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 addInput PASSED"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_PHOTO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering REMOVE_INPUT_SUCCESS ends here"); await sleep(1); done(); } @@ -957,29 +957,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 + * @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS * @tc.name : Remove video Output api * @tc.desc : Remove video Output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100', 0, async function (done) { + it('REMOVE_VIDEO_OUTPUT_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 captureSession == null || undefined"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS to operate"); const Promise = await captureSessionPromise.removeOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 success " + Promise); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS success " + Promise); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 FAILED: "); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_REMOVE_VIDEO_OUTPUT_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS ends here"); await sleep(1); done(); } @@ -988,29 +988,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 + * @tc.number : ADD_INPUT_SUCCESS_PROMISE * @tc.name : Add Input with camera0Input api * @tc.desc : Add Input with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200', 0, async function (done) { + it('ADD_INPUT_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 captureSession == null || undefined"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 to operate"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE to operate"); const Promise = await captureSessionPromise.addInput(camera0InputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput success"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput success"); if (Promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 addInput PASSED"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE addInput PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 FAILED: "); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_INPUT_SUCCESS_PROMISE_0200 ends here"); + console.info(TAG + "Entering ADD_INPUT_SUCCESS_PROMISE ends here"); await sleep(1); done(); } @@ -1019,29 +1019,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 + * @tc.number : ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE * @tc.name : Add output with camera0Input api * @tc.desc : Add output with camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200', 0, async function (done) { + it('ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 captureSession == null || undefined"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE to operate"); const promise = await captureSessionPromise.addOutput(previewOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 : Success"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE : Success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 FAILED"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE FAILED"); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE_0200 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PREVIEW_SUCCESS_PROMISE ends here"); await sleep(1); done(); } @@ -1050,29 +1050,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 + * @tc.number : ADD_OUTPUT_PHOTO_SUCCESS * @tc.name : Add output with photo output api * @tc.desc : Add output with photo output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100', 0, async function (done) { + it('ADD_OUTPUT_PHOTO_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 captureSession == null || undefined"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS to operate"); const promise = await captureSessionPromise.addOutput(photoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 success"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 FAILED "); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS FAILED "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_PHOTO_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_PHOTO_SUCCESS ends here"); await sleep(1); done(); } @@ -1081,29 +1081,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 + * @tc.number : ADD_OUTPUT_VIDEO_SUCCESS * @tc.name : Add output with video output api * @tc.desc : Add output with video output api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200', 0, async function (done) { + it('ADD_OUTPUT_VIDEO_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 captureSession == null || undefined"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 to operate"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS to operate"); const promise = await captureSessionPromise.addOutput(videoOutputPromise); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 success"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 PASSED"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS PASSED"); } else { expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 FAILED: "); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS FAILED: "); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ADD_OUTPUT_VIDEO_SUCCESS_PROMISE_0200 ends here"); + console.info(TAG + "Entering ADD_OUTPUT_VIDEO_SUCCESS ends here"); await sleep(1); done(); } @@ -1112,339 +1112,616 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 + * @tc.number : GET_FRAME_RATE_RANGE * @tc.name : get frame rate range camera0 api * @tc.desc : get frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 to operate"); + it('GET_FRAME_RATE_RANGE', 0, async function (done) { + console.info(TAG + "Entering GET_FRAME_RATE_RANGE to operate"); await videoOutputPromise.getFrameRateRange() .then(function (data) { console.info(TAG + "Entering get frame rate range SUCCESS "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 PASSED : " + JSON.stringify(data)) + console.info(TAG + "Entering GET_FRAME_RATE_RANGE PASSED : " + JSON.stringify(data)) expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering GET_FRAME_RATE_RANGE FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FRAME_RATE_RANGE_PROMISE_0100 ends here"); + console.info(TAG + "Entering GET_FRAME_RATE_RANGE ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Grp0 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Grp0', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp0 to operate"); await videoOutputPromise.setFrameRateRange(minFrameRate_Grp0,maxFrameRate_Grp0) .then(function (data) { console.info(TAG + "Entering setFrameRateRange SUCCESS"); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 PASSED"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp0 PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp0 FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP0_PROMISE_0100 ends here"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp0 ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 + * @tc.number : SET_FRAME_RATE_RANGE_MIX * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 to operate"); + it('SET_FRAME_RATE_RANGE_MIX', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_MIX to operate"); await videoOutputPromise.setFrameRateRange(minFrameRate_Mix,maxFrameRate_Mix) .then(function (data) { console.info(TAG + "Entering setFrameRateRange"); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 FAILED"); + console.info(TAG + "SET_FRAME_RATE_RANGE_MIX FAILED"); }) .catch((err) => { expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 PASSED: " + err.message); + console.info(TAG + "SET_FRAME_RATE_RANGE_MIX PASSED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_MIX_PROMISE_0100 ends here"); + console.info(TAG + "SET_FRAME_RATE_RANGE_MIX ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Err1 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Err1', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err1 to operate"); await videoOutputPromise.setFrameRateRange(minFrameRate_Err1,maxFrameRate_Err1) .then(function (data) { console.info(TAG + "Entering setFrameRateRange"); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 FAILED"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err1 FAILED"); }) .catch((err) => { expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 PASSED: " + err.message); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err1 PASSED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR1_PROMISE_0100 ends here"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err1 ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Err2 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Err2', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err2 to operate"); await videoOutputPromise.setFrameRateRange(minFrameRate_Err2,maxFrameRate_Err2) .then(function (data) { console.info(TAG + "Entering setFrameRateRange SUCCESS"); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 FAILED"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err2 FAILED"); }) .catch((err) => { expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 PASSED: " + err.message); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err2 PASSED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR2_PROMISE_0100 ends here"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err2 ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Err3 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Err3', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Err3 to operate"); await videoOutputPromise.setFrameRateRange(minFrameRate_Err3,maxFrameRate_Err3) .then(function (data) { console.info(TAG + "Entering setFrameRateRange SUCCESS"); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 FAILED"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err3 FAILED"); }) .catch((err) => { expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 PASSED: " + err.message); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err3 PASSED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_ERR3_PROMISE_0100 ends here"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Err3 ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 + * @tc.number : SET_FRAME_RATE_RANGE_Grp20 * @tc.name : set frame rate range camera0 api * @tc.desc : set frame rate range promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 to operate"); + it('SET_FRAME_RATE_RANGE_Grp20', 0, async function (done) { + console.info(TAG + "Entering SET_FRAME_RATE_RANGE_Grp20 to operate"); await videoOutputPromise.setFrameRateRange(minFrameRate_Grp20,maxFrameRate_Grp20) .then(function (data) { console.info(TAG + "Entering setFrameRateRange SUCCESS"); console.info(TAG + "Current FrameRateRange is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 PASSED"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp20 PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp20 FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_FRAME_RATE_RANGE_GRP20_PROMISE_0100 ends here"); + console.info(TAG + "SET_FRAME_RATE_RANGE_Grp20 ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTEDOFF + * @tc.name : isVideoStabilizationModeSupportedOff + * @tc.desc : isVideoStabilizationModeSupported promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTEDOFF', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode OFF Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTEDOFF ends here"); + }); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEOFF + * @tc.name : SetVideoStabilizationModeOff + * @tc.desc : SetVideoStabilizationModeOff promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.OFF) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode Off SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.OFF); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF PASSED") + expect(cameraObj.VideoStabilizationMode.OFF).assertEqual(0) + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEOFF ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODEOFF * @tc.name : getVideoStabilizationModeOff * @tc.desc : getVideoStabilizationModeOff promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 to operate"); + it('GET_VIDEOSTABILIZATIONMODEOFF', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEOFF to operate"); await captureSessionPromise.getActiveVideoStabilizationMode() .then(function (data){ console.info(TAG + "Entering getVideoStabilizationModeOff SUCCESS"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(data).assertEqual(0); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEOFF PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEOFF FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEOFF_PROMISE_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEOFF ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_LOW + * @tc.name : isVideoStabilizationModeSupported low + * @tc.desc : isVideoStabilizationModeSupported low promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_LOW', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode LOW Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(true); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_LOW ends here"); + }); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODELOW + * @tc.name : SetVideoStabilizationModelow + * @tc.desc : SetVideoStabilizationModelow promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.LOW) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode Off SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.LOW); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW PASSED") + expect(cameraObj.VideoStabilizationMode.LOW).assertEqual(1) + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODELOW ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODELOW * @tc.name : getVideoStabilizationModeLow * @tc.desc : getVideoStabilizationModeLow promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 to operate"); + /* VideoStabilizationMode Interface will be change + it('GET_VIDEOSTABILIZATIONMODELOW', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODELOW to operate"); await captureSessionPromise.getActiveVideoStabilizationMode() .then(function (data){ console.info(TAG + "Entering getVideoStabilizationModeLow SUCCESS"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODELOW PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODELOW FAILED : " + err.message); + }); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODELOW ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE + * @tc.name : isVideoStabilizationModeSupported MIDDLE + * @tc.desc : isVideoStabilizationModeSupported MIDDLE promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode MIDDLE Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE PASSED"); }) .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE FAILED : " + err.message); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_MIDDLE ends here"); + }); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEMIDDLE + * @tc.name : SetVideoStabilizationModeMIDDLE + * @tc.desc : SetVideoStabilizationModeMIDDLE promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.MIDDLE) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode MIDDLE SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.MIDDLE); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE PASSED : " + err.message); + expect(true).assertTrue(); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODELOW_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEMIDDLE ends here"); await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 + * @tc.number : GET_VIDEOSTABILIZATIONMODEMIDDLE * @tc.name : getVideoStabilizationModeMIDDLE * @tc.desc : getVideoStabilizationModeMIDDLE promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 to operate"); + it('GET_VIDEOSTABILIZATIONMODEMIDDLE', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEMIDDLE to operate"); await captureSessionPromise.getActiveVideoStabilizationMode() .then(function (data){ console.info(TAG + "Entering getVideoStabilizationModeMIDDLE SUCCESS"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEMIDDLE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEMIDDLE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEMIDDLE_PROMISE_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEMIDDLE ends here"); await sleep(1); done(); }) + + /** + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH + * @tc.name : isVideoStabilizationModeSupported High + * @tc.desc : isVideoStabilizationModeSupported High promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode HIGH Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_HIGH ends here"); + }); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEHIGH + * @tc.name : SetVideoStabilizationModeHigh + * @tc.desc : SetVideoStabilizationModeHigh promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.HIGH) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode High SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.HIGH); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEHIGH ends here"); + await sleep(1); + done(); + }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 + * @tc.number : GET_VIDEOSTABILIZATIONMODEHIGH * @tc.name : getVideoStabilizationModeHigh * @tc.desc : getVideoStabilizationModeHigh promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 to operate"); + it('GET_VIDEOSTABILIZATIONMODEHIGH', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEHIGH to operate"); await captureSessionPromise.getActiveVideoStabilizationMode() .then(function (data){ console.info(TAG + "Entering getVideoStabilizationModeHigh SUCCESS"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEHIGH PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEHIGH FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEHIGH_PROMISE_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEHIGH ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 + * @tc.number : ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO + * @tc.name : isVideoStabilizationModeSupported Auto + * @tc.desc : isVideoStabilizationModeSupported Auto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO', 0, async function (done) { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO to operate"); + await captureSessionPromise.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO) + .then(function (data){ + console.info(TAG + "Entering is Video Stabilization Mode AUTO Supported SUCCESS "); + console.info(TAG + "isVideoStabilizationModeSupported : " + data); + expect(data).assertEqual(false); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO PASSED"); + }) + .catch((err) => { + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO FAILED : " + err.message); + expect().assertFail(); + console.info(TAG + "Entering ISVIDEOSTABILIZATIONMODESUPPORTED_AUTO ends here"); + }); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_VIDEOSTABILIZATIONMODEAUTO + * @tc.name : SetVideoStabilizationModeAuto + * @tc.desc : SetVideoStabilizationModeAuto promise api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* VideoStabilizationMode Interface will be change + it('SET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO to operate"); + await captureSessionPromise.setVideoStabilizationMode(cameraObj.VideoStabilizationMode.AUTO) + .then(function (){ + console.info(TAG + "Entering Set VideoStabilization Mode Auto SUCCESS, current VideoStabilization Mode is: " + cameraObj.VideoStabilizationMode.AUTO); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO FAILED") + expect().assertFail(); + }) + .catch((err) => { + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_VIDEOSTABILIZATIONMODEAUTO ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_VIDEOSTABILIZATIONMODEAUTO * @tc.name : getVideoStabilizationModeAuto * @tc.desc : getVideoStabilizationModeAuto promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 to operate"); + it('GET_VIDEOSTABILIZATIONMODEAUTO', 0, async function (done) { + console.info(TAG + "Entering GET_VIDEOSTABILIZATIONMODEAUTO to operate"); await captureSessionPromise.getActiveVideoStabilizationMode() .then(function (data){ console.info(TAG + "Entering getVideoStabilizationModeAuto SUCCESS"); console.info(TAG + "Current VideoStabilizationMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 PASSED"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEAUTO PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEAUTO FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_VIDEOSTABILIZATIONMODEAUTO_PROMISE_0100 ends here"); + console.info(TAG + "GET_VIDEOSTABILIZATIONMODEAUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 + * @tc.number : COMMIT_CONFIG_SUCCESS * @tc.name : commit config api * @tc.desc : commit config api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100', 0, async function (done) { + it('COMMIT_CONFIG_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering Commit config captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate"); const promise = await captureSessionPromise.commitConfig(); console.info(TAG + "Entering commitConfig success"); if (promise == undefined) { expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig PASSED"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"); } else { expect().assertFail() - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig FAILED : "); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_COMMIT_CONFIG_SUCCESS_PROMISE_0100 commitConfig ends here"); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "); + console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"); } await sleep(1); done(); @@ -1454,27 +1731,27 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START * @tc.name : Preview output callback on frame start api * @tc.desc : Preview output callback on frame start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + "Entering Preview Output callback on frame start previewOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START to operate"); previewOutputPromise.on('frameStart', async (err, data) => { if (!err) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 is success"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START is success"); if (data != null || data != undefined) { expect(true).assertTrue(); } } else { expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_START_CALLBACK_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_START FAILED : + err.message"); } await sleep(1); done(); @@ -1485,18 +1762,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 + * @tc.number : PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END * @tc.name : PreviewOutput callback onframeend async api * @tc.desc : PreviewOutput callback onframeend async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { + it('PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 previewOutputPromise == null || undefined') + console.info(TAG + 'Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END previewOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') + console.info(TAG + 'Entering PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END to operate') await sleep(1) previewOutputPromise.on('frameEnd', async (err, data) => { if (!err) { @@ -1506,7 +1783,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PREVIEW_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED : + err.message"); + console.info(TAG + "PREVIEW_OUTPUT_CALLBACK_ON_FRAME_END FAILED : + err.message"); } await sleep(1); done(); @@ -1517,18 +1794,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START * @tc.name : VideoOutput callback onframestart async api * @tc.desc : VideoOutput callback onframestart async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { console.info(TAG + 'Entering Video frameStart Callback videoOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate') await sleep(1) videoOutputPromise.on('frameStart', async (err, data) => { if (!err) { @@ -1538,7 +1815,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } } else { expect().assertFail() - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_START_CALLBACK_0100 is FAILED : " + err.message); + console.info(TAG + "VIDEO_OUTPUT_CALLBACK_ON_FRAME_START is FAILED : " + err.message); } await sleep(1); done(); @@ -1549,28 +1826,28 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 + * @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END * @tc.name : VideoOutput callback onframeend async api * @tc.desc : VideoOutput callback onframeend async api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100', 0, async function (done) { + it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { console.info(TAG + 'Entering Video frameEnd callback videoOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate') await sleep(1) videoOutputPromise.on('frameEnd', async (err, data) => { if (!err) { - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 is success') + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END is success') if (data != null || data != undefined) { expect(true).assertTrue() } } else { expect().assertFail() - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_ON_FRAME_END_CALLBACK_0100 FAILED' + err.message) + console.info(TAG + 'VIDEO_OUTPUT_CALLBACK_ON_FRAME_END FAILED' + err.message) } await sleep(1); done(); @@ -1582,28 +1859,28 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { //Capture callback /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_START * @tc.name : Photo capture callback on capture start api * @tc.desc : Photo capture callback on capture start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_START', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo capture callback on capture start photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_START to operate"); photoOutputPromise.on('captureStart', async (err, data) => { if (!err) { console.info(TAG + "CaptureStart Callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 with captureId: " + data); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START with captureId: " + data); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_START_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_CAPTURE_START FAILED: " + err.message); } await sleep(1); done(); @@ -1614,18 +1891,18 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_CAPTURE_END * @tc.name : Photo capture callback on capture end api * @tc.desc : Photo capture callback on capture end api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_CAPTURE_END', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo capture callback on capture end photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_CAPTURE_END to operate"); photoOutputPromise.on('captureEnd', async (err, data) => { if (!err) { console.info(TAG + "captureEnd callback is success"); @@ -1636,7 +1913,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { } } else { expect().assertFail(); - console.info(TAG + 'SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_CAPTURE_END_CALLBACK_0100 FAILED' + err.message); + console.info(TAG + 'PHOTO_CAP_CALLBACK_ON_CAPTURE_END FAILED' + err.message); } await sleep(1); done(); @@ -1647,29 +1924,29 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 + * @tc.number : PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER * @tc.name : Photo capture callback on frame shutter api * @tc.desc : Photo capture callback on frame shutter api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100', 0, async function (done) { + it('PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "Entering Photo capture callback on frame shutter photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 to operate"); + console.info(TAG + "Entering PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER to operate"); photoOutputPromise.on('frameShutter', async (err, data) => { if (!err) { console.info(TAG + "frameShutter callback is success"); if (data != null || data != undefined) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with captureId: " + data.captureId); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 with timestamp: " + data.timestamp); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with captureId: " + data.captureId); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER with timestamp: " + data.timestamp); expect(true).assertTrue(); } } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_CAP_ON_FRAME_SHUTTER_CALLBACK_0100 FAILED: " + err.message); + console.info(TAG + "PHOTO_CAP_CALLBACK_ON_FRAME_SHUTTER FAILED: " + err.message); } await sleep(1); done(); @@ -1680,23 +1957,23 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 + * @tc.number : CAPTURE_SESSION_START_SUCCESS * @tc.name : capture session start api * @tc.desc : capture session start api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100', 0, async function (done) { + it('CAPTURE_SESSION_START_SUCCESS', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + "Entering capture session start captureSession == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS to operate"); await captureSessionPromise.start(); console.info(TAG + "Entering captureSession start success"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS PASSED"); + console.info(TAG + "Entering CAPTURE_SESSION_START_SUCCESS ends here"); await sleep(1); done(); } @@ -1705,27 +1982,27 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 + * @tc.number : isMirrorSupported_PHOTO_OUTPUT * @tc.name : isMirrorSupported * @tc.desc : isMirrorSupported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100', 0, async function (done) { + it('isMirrorSupported_PHOTO_OUTPUT', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 to operate"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT to operate"); await photoOutputPromise.isMirrorSupported() .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 is success"); + console.info(TAG + "Entering isMirrorSupported_PHOTO_OUTPUT is success"); console.info(TAG + "isMirrorSupported : " + data); expect(true).assertTrue(); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_ISMIRRORSUPPORTED_PHOTO_OUTPUT_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "isMirrorSupported_PHOTO_OUTPUT FAILED : " + err.message); }); await sleep(1); done(); @@ -1735,27 +2012,27 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 + * @tc.number : setMirror_true * @tc.name : setMirror true * @tc.desc : setMirror true * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100', 0, async function (done) { + it('setMirror_true', 0, async function (done) { if (photoOutputPromise == null || photoOutputPromise == undefined) { console.info(TAG + "photoOutput == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 to operate"); + console.info(TAG + "Entering setMirror_true to operate"); await photoOutputPromise.setMirror(true) .then(function (data) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 is success:"); + console.info(TAG + "Entering setMirror_true is success:"); console.info(TAG + "setMirror is : " + 'True'); expect(true).assertTrue(); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SETMIRROR_TRUE_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "setMirror_true FAILED : " + err.message); }); await sleep(1); done(); @@ -1766,343 +2043,343 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { //FLASH Function API scripts /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 + * @tc.number : HAS_FLASH * @tc.name : check if has flash-camera0Input api * @tc.desc : check if has flash-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100--------------"); + it('HAS_FLASH', 0, async function (done) { + console.info("--------------HAS_FLASH--------------"); console.info(TAG + 'hasFlash called.') var hasFlashPromise = await camera0InputPromise.hasFlash(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 success"); + console.info(TAG + "Entering HAS_FLASH success"); if (hasFlashPromise != null || hasFlashPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 data is not null || undefined"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 PASSED with SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 is: " + JSON.stringify(hasFlashPromise)); + console.info(TAG + "Entering HAS_FLASH data is not null || undefined"); + console.info(TAG + "Entering HAS_FLASH PASSED with HAS_FLASH is: " + JSON.stringify(hasFlashPromise)); expect(hasFlashPromise).assertEqual(true); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering HAS_FLASH FAILED : "); expect().assertFail(); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_HAS_FLASH_PROMISE_0100 ends here"); + console.info(TAG + "Entering HAS_FLASH ends here"); await sleep(1) done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FLASH_MODE_OPEN_SUPPORTED * @tc.name : check if flash mode open is supported-camera0Input api * @tc.desc : check if flash mode open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FLASH_MODE_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED to operate"); var isFMOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED SUCCESS "); if (isFMOpenSupported != null || isFMOpenSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_OPEN supported is: " + JSON.stringify(isFMOpenSupported)); expect(isFMOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_OPEN_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_OPEN_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 + * @tc.number : SET_FLASH_MODE_OPEN * @tc.name : set flash mode open camera0 api * @tc.desc : set flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); + it('SET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate"); var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN); console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen)) if (SetFMOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_OPEN).assertEqual(1); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 + * @tc.number : GET_FLASH_MODE_OPEN * @tc.name : get flash mode open camera0 api * @tc.desc : get flash mode open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 to operate"); + it('GET_FLASH_MODE_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate"); var GetFMOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 success: " + JSON.stringify(GetFMOpen)); + console.info(TAG + "Entering GET_FLASH_MODE_OPEN success: " + JSON.stringify(GetFMOpen)); if (GetFMOpen == 1) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_OPEN PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_OPEN_PROMISE_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_OPEN FAILED : "); + console.info(TAG + "GET_FLASH_MODE_OPEN ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED * @tc.name : check if flash mode always open is supported-camera0Input api * @tc.desc : check if flash mode always open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED to operate"); var isFMAlwaysOpenSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED SUCCESS "); if (isFMAlwaysOpenSupported != null || isFMAlwaysOpenSupported != undefined) { console.info(TAG + "Entering FLASH_MODE_ALWAYS_OPEN data is not null || undefined"); console.info(TAG + "FLASH_MODE_OPEN supported is: " + isFMAlwaysOpenSupported); expect(isFMAlwaysOpenSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 + * @tc.number : SET_FLASH_MODE_ALWAYS_OPEN * @tc.name : set flash mode always open camera0 api * @tc.desc : set flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); + it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate"); var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen)) if (SetFMAlwaysOpen == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED") expect(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN).assertEqual(3) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 + * @tc.number : GET_FLASH_MODE_ALWAYS_OPEN * @tc.name : get flash mode always open camera0 api * @tc.desc : get flash mode always open camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 to operate"); + it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate"); var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success"); if (GetFMAlwaysOpen == 3) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_ALWAYS_OPEN_PROMISE_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED : "); + console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED * @tc.name : check if flash mode always open is supported-camera0Input api * @tc.desc : check if flash mode always open is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FLASH_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED to operate"); var isFMAutoSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED SUCCESS "); if (isFMAutoSupported != null || isFMAutoSupported != undefined) { console.info(TAG + "Entering FLASH_MODE_AUTO data is not null || undefined"); console.info(TAG + "FLASH_MODE_AUTO supported is: " + isFMAutoSupported); expect(isFMAutoSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_AUTO_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 + * @tc.number : SET_FLASH_MODE_AUTO * @tc.name : set flash mode auto camera0 api * @tc.desc : set flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); + it('SET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate"); var SetFMAlwaysAuto = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO); console.info(TAG + "SetFMAlwaysAuto: " + JSON.stringify(SetFMAlwaysAuto)) if (SetFMAlwaysAuto == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_AUTO); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED") expect(cameraObj.FlashMode.FLASH_MODE_AUTO).assertEqual(2) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 + * @tc.number : GET_FLASH_MODE_AUTO * @tc.name : get flash mode auto camera0 api * @tc.desc : get flash mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 to operate"); + it('GET_FLASH_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_AUTO to operate"); var GetFMAuto = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_AUTO success"); if (GetFMAuto == 2) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_AUTO data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + GetFMAuto); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_AUTO_PROMISE_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FLASH_MODE_AUTO ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED * @tc.name : check if flash mode close is supported-camera0Input api * @tc.desc : check if flash mode close is supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FLASH_MODE_CLOSE_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED to operate"); var isFMCloseSupported = await camera0InputPromise.isFlashModeSupported(cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 SUCCESS "); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED SUCCESS "); if (isFMCloseSupported != null || isFMCloseSupported != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 data is not null || undefined"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED data is not null || undefined"); console.info(TAG + "FLASH_MODE_CLOSE supported is: " + isFMCloseSupported); expect(isFMCloseSupported).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 PASSED"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FLASH_MODE_CLOSE_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "Entering IS_FLASH_MODE_CLOSE_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 + * @tc.number : SET_FLASH_MODE_CLOSE * @tc.name : set flash mode close camera0 api * @tc.desc : set flash mode close camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); + it('SET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate"); var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE); console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose)) if (SetFMClose == undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED") expect(cameraObj.FlashMode.FLASH_MODE_CLOSE).assertEqual(0) } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 + * @tc.number : GET_FLASH_MODE_CLOSE * @tc.name : get flash mode close camera0 api * @tc.desc : get flash mode close camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 to operate"); + it('GET_FLASH_MODE_CLOSE', 0, async function (done) { + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate"); var GetFMClose = await camera0InputPromise.getFlashMode(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 success"); + console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success"); if (GetFMClose == 0) { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 data is not null || undefined: "); + console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: "); console.info(TAG + "Current FlashMode is: " + GetFMClose); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FLASH_MODE_CLOSE_PROMISE_0100 ends here"); + console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED : "); + console.info(TAG + "GET_FLASH_MODE_CLOSE ends here"); } await sleep(1); done(); @@ -2110,40 +2387,40 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { //ZOOM Function /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 + * @tc.number : GET_ZOOM_RATIO_PROMISE * @tc.name : get zoom ratio camera-0 cameraId api promise api * @tc.desc : get zoom ratio camera-0 cameraId api promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100', 0, async function (done) { - console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100--------------"); + it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) { + console.info("--------------GET_ZOOM_RATIO_PROMISE--------------"); var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise)); if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 setZoomRatioPromise is not null || undefined"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined"); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 success: " + JSON.stringify(getZoomRatioPromise)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 PASSED"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise)); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 FAILED"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED"); expect().assertFail(); } - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_ZOOM_RATIO_PROMISEE_0100 ends here"); + console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_1_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(1); console.info(TAG + "setZoomRatio success: 1"); console.info(TAG + "getZoomRatio called") @@ -2151,10 +2428,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise1); if (getpromise1 != null && getpromise1 != undefined) { expect(getpromise1).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_1_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED"); expect().assertFail(); } await sleep(1); @@ -2162,14 +2439,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_2_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(2); console.info(TAG + "setZoomRatio success: 2"); console.info(TAG + "getZoomRatio called") @@ -2177,10 +2454,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise2); if (getpromise2 != null && getpromise2 != undefined) { expect(getpromise2).assertEqual(2); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_2_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED"); expect().assertFail(); } await sleep(1); @@ -2188,14 +2465,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_3_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(3); console.info(TAG + "setZoomRatio success: 3"); console.info(TAG + "getZoomRatio called") @@ -2203,10 +2480,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise3); if (getpromise3 != null && getpromise3 != undefined) { expect(getpromise3).assertEqual(3); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_3_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED"); expect().assertFail(); } await sleep(1); @@ -2214,14 +2491,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_4_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(4); console.info(TAG + "setZoomRatio success: 4"); console.info(TAG + "getZoomRatio called") @@ -2229,10 +2506,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise4); if (getpromise4 != null && getpromise4 != undefined) { expect(getpromise4).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_4_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED"); expect().assertFail(); } await sleep(1); @@ -2240,14 +2517,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_5_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(5); console.info(TAG + "setZoomRatio success: 5"); console.info(TAG + "getZoomRatio called") @@ -2255,10 +2532,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise5); if (getpromise5 != null && getpromise5 != undefined) { expect(getpromise5).assertEqual(5); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_5_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED"); expect().assertFail(); } await sleep(1); @@ -2266,14 +2543,14 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 + * @tc.number : SET_GET_ZOOM_6_PROMISE * @tc.name : Zoom camera-0 cameraId api * @tc.desc : Zoom camera-0 cameraId api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100', 0, async function (done) { + it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) { var setpromise = await camera0InputPromise.setZoomRatio(6); console.info(TAG + "setZoomRatio success: 6"); console.info(TAG + "getZoomRatio called") @@ -2281,10 +2558,10 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { console.info(TAG + "getZoomRatio success: " + getpromise6); if (getpromise6 != null && getpromise6 != undefined) { expect(getpromise6).assertEqual(6); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 PASSED "); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SET_GET_ZOOM_6_PROMISE_0100 FAILED"); + console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED"); expect().assertFail(); } await sleep(1); @@ -2293,926 +2570,1089 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { // FOCUS promise API's /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED * @tc.name : check is focus mode locked supported-camera0Input api * @tc.desc : check is focus mode locked supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FOCUS_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"); var isFMLockedSupported = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_LOCKED); console.info(TAG + "Entering is focus mode locked supported SUCCESS "); if (isFMLockedSupported != null || isFMLockedSupported != undefined) { console.info(TAG + "Entering is focus mode locked supported data is not null || undefined"); console.info(TAG + "is focus mode locked supported : " + isFMLockedSupported); expect(isFMLockedSupported).assertEqual(false); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 PASSED"); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_LOCKED_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 + * @tc.number : SET_FOCUS_MODE_LOCKED * @tc.name : set focus mode locked camera0 api * @tc.desc : set focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { + it('SET_FOCUS_MODE_LOCKED', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED) .then(function (data) { console.info(TAG + "SetFMLocked: " + JSON.stringify(data)) console.info(TAG + "Entering set focus mode locked SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : ") + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED : ") expect().assertFail(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED : " + err.message); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here"); }); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 + * @tc.number : GET_FOCUS_MODE_LOCKED * @tc.name : get focus mode locked camera0 api * @tc.desc : get focus mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 to operate"); + it('GET_FOCUS_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode locked success: "); if (data == 0) { console.info(TAG + "Current focusmode is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED"); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_LOCKED_PROMISE_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here"); }); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 + * @tc.number : GET_FOCAL_LENGTH * @tc.name : get focal length camera0 api * @tc.desc : get focal length camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 to operate"); + it('GET_FOCAL_LENGTH', 0, async function (done) { + console.info(TAG + "Entering GET_FOCAL_LENGTH to operate"); await camera0InputPromise.getFocalLength() .then(function (data) { console.info(TAG + "Current focallength is: " + JSON.stringify(data)); expect(data).assertEqual(3.4600000381469727); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FOCAL_LENGTH PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_FOCAL_LENGTH FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); + console.info(TAG + "GET_FOCAL_LENGTH ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED * @tc.name : is focusmode manual supported * @tc.desc : is focusmode manual supported * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate"); var isFMmanualSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL); if (isFMmanualSupportedpromise != null || isFMmanualSupportedpromise != undefined) { console.info(TAG + "Entering is focusmode manual supported data is not null || undefined"); console.info(TAG + "FOCUS_MODE_MANUAL_SUPPORTED is: " + isFMmanualSupportedpromise); expect(isFMmanualSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED PASSED: "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_MANUAL_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_MANUAL_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 + * @tc.number : SET_FOCUS_MODE_MANUAL * @tc.name : set focus mode manual camera0 api * @tc.desc : set focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); + it('SET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate"); await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL) .then(function (data) { console.info(TAG + "setFocusManual: " + JSON.stringify(data)) console.info(TAG + "Entering set focus mode manual SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_MANUAL).assertEqual(0) }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 + * @tc.number : GET_FOCUS_MODE_MANUAL * @tc.name : get focus mode manual camera0 api * @tc.desc : get focus mode manual camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 to operate"); + it('GET_FOCUS_MODE_MANUAL', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode manual SUCCESS"); if (data == 0) { console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED"); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 FAILED : " + err.message); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_MANUAL_PROMISE_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here"); }); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 + * @tc.number : SET_FOCUS_POINT * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { + it('SET_FOCUS_POINT', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusPoint(Point1) .then(function (data) { console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 PASSED"); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 + * @tc.number : GET_FOCUS_POINT * @tc.name : get focus Point camera0 api * @tc.desc : get focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); await camera0InputPromise.getFocusPoint() .then(function (data) { console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 FAILED " + err.message); + console.info(TAG + "GET_FOCUS_POINT FAILED " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0100 ends here"); + console.info(TAG + "GET_FOCUS_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED * @tc.name : check is focus mode continuous supported-camera0Input api * @tc.desc : check is focus mode continuous supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FOCUS_MODE_CONTINUOUS_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED to operate"); var isFMContinuousSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); if (isFMContinuousSupportedpromise != null || isFMContinuousSupportedpromise != undefined) { console.info(TAG + "Entering is focus mode continuous supported data is not null || undefined"); console.info(TAG + "FOCUS_MODE_CONTINUOUS_SUPPORTED is: " + isFMContinuousSupportedpromise); expect(isFMContinuousSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_CONTINUOUS_SUPPORTED PASSED: "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_CONTINUOUS_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_CONTINUOUS_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 + * @tc.number : SET_FOCUS_MODE_CONTINUOUS * @tc.name : set focus mode continuous camera0 api * @tc.desc : set focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); + it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate"); await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO) .then(function (data) { console.info(TAG + "setFocusCont: " + JSON.stringify(data)) console.info(TAG + "Entering set focus mode continuous SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO).assertEqual(1) }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 + * @tc.number : GET_FOCUS_MODE_CONTINUOUS * @tc.name : get focus mode continuous camera0 api * @tc.desc : get focus mode continuous camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 to operate"); + it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate"); await camera0InputPromise.getFocusMode() .then(function (data) { console.info(TAG + "Entering get focus mode continuous SUCCESS"); if (data == 1) { console.info(TAG + "Current FocusMode is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED"); } }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_CONTINUOUS_PROMISE_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 + * @tc.number : SET_FOCUS_POINT * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { + it('SET_FOCUS_POINT', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusPoint(Point2) .then(function (data) { console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 PASSED"); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 + * @tc.number : GET_FOCUS_POINT * @tc.name : get focus Point camera0 api * @tc.desc : get focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); await camera0InputPromise.getFocusPoint() .then(function (data) { console.info(TAG + "Current FocusPoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 FAILED: " + err.message); + console.info(TAG + "GET_FOCUS_POINT FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0200 ends here"); + console.info(TAG + "GET_FOCUS_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 + * @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED * @tc.name : check is focus mode auto supported-camera0Input api * @tc.desc : check is focus mode auto supported-camera0Input api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 to operate"); + it('IS_FOCUS_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED to operate"); var isFMAutoSupportedpromise = await camera0InputPromise.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_AUTO); if (isFMAutoSupportedpromise != null || isFMAutoSupportedpromise != undefined) { console.info(TAG + "Entering is focus mode auto supported data is not null || undefined"); console.info(TAG + "is focus mode auto supported is: " + isFMAutoSupportedpromise); expect(isFMAutoSupportedpromise).assertEqual(true); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 PASSED: "); + console.info(TAG + "Entering IS_FOCUS_MODE_AUTO_SUPPORTED PASSED: "); } else { - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 FAILED : "); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED FAILED : "); expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_IS_FOCUS_MODE_AUTO_SUPPORTED_PROMISE_0100 ends here"); + console.info(TAG + "IS_FOCUS_MODE_AUTO_SUPPORTED ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 + * @tc.number : SET_FOCUS_MODE_AUTO * @tc.name : set focus mode auto camera0 api * @tc.desc : set focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); + it('SET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate"); var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO) .then(function () { console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto)) console.info(TAG + "Entering set focus mode auto SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED") expect(cameraObj.FocusMode.FOCUS_MODE_AUTO).assertEqual(2) }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED : "); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 + * @tc.number : GET_FOCUS_MODE_AUTO * @tc.name : get focus mode auto camera0 api * @tc.desc : get focus mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 to operate"); + it('GET_FOCUS_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate"); var getfocusmodepromise = await camera0InputPromise.getFocusMode(); console.info(TAG + "Entering get focus mode auto SUCCESS"); if (getfocusmodepromise == 2) { console.info(TAG + "Current FocusMode is: " + getfocusmodepromise); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 PASSED"); + console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED"); } else { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 FAILED : "); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_MODE_AUTO_PROMISE_0100 ends here"); + console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED : "); + console.info(TAG + "GET_FOCUS_MODE_AUTO ends here"); } await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 + * @tc.number : SET_FOCUS_POINT * @tc.name : set focus Point camera0 api * @tc.desc : set focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { + it('SET_FOCUS_POINT', 0, async function (done) { console.info(TAG + "Entering set focus mode locked to operate"); await camera0InputPromise.setFocusPoint(Point3) .then(function (data) { console.info(TAG + "Entering set focus Point SUCCESS, current focusPoint is:" + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 PASSED"); + console.info(TAG + "Entering SET_FOCUS_POINT PASSED"); expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_FOCUS_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_FOCUS_POINT_PROMISE_0300 ends here"); + console.info(TAG + "Entering SET_FOCUS_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 + * @tc.number : GET_FOCUS_POINT * @tc.name : get focus Point camera0 api * @tc.desc : get focus Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 to operate"); + it('GET_FOCUS_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_FOCUS_POINT to operate"); await camera0InputPromise.getFocusPoint() .then(function (data) { console.info(TAG + "Current focusPoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 PASSED"); + console.info(TAG + "GET_FOCUS_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 FAILED : " + err.message); + console.info(TAG + "GET_FOCUS_POINT FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_FOCUS_POINT_PROMISE_0300 ends here"); + console.info(TAG + "GET_FOCUS_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 + * @tc.number : IS_EXPOSURE_MODE_LOCKED_SUPPORTED + * @tc.name : check is exposure mode locked supported-camera0Input api + * @tc.desc : check is exposure mode locked supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_LOCKED_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_LOCKED_SUPPORTED PASSED: " + data); + expect(data).assertEqual(false); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_LOCKED_SUPPORTED ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_LOCKED + * @tc.name : set exposure mode locked camera0 api + * @tc.desc : set exposure mode locked camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_LOCKED); + console.info(TAG + "Entering SET_EXPOSURE_MODE_Locked FAILED") + expect().assertFail() + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED PASSED : " + err.message); + expect(true).assertTrue(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_LOCKED ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_LOCKED * @tc.name : get exposure mode locked camera0 api * @tc.desc : get exposure mode locked camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 to operate"); + it('GET_EXPOSURE_MODE_LOCKED', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_LOCKED to operate"); await camera0InputPromise.getExposureMode() .then(function (data) { console.info(TAG + "Entering get exposure mode locked SUCCESS"); console.info(TAG + "Current ExposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_LOCKED_PROMISE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_LOCKED ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 mode locked + * @tc.number : SET_EXPOSURE_POINT_exposure mode locked * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_Point to operate"); await camera0InputPromise.setExposurePoint(Point1) .then(function (data) { console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 mode locked + * @tc.number : GET_EXPOSURE_POINT_exposure mode locked * @tc.name : get exposure Point camera0 api * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); await camera0InputPromise.getExposurePoint() .then(function (data) { console.info(TAG + "Entering getExposurePoint SUCCESS"); console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100_exposure mode locked + * @tc.number : GET_EXPOSURE_BIASRANGE_exposure mode locked * @tc.name : get exposure bias range camera0 api * @tc.desc : get exposure bias range camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 to operate"); + it('GET_EXPOSURE_BIASRANGE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_BIASRANGE to operate"); await camera0InputPromise.getExposureBiasRange() .then(function (data) { console.info(TAG + "Entering getExposureBiasRange SUCCESS"); console.info(TAG + "Current ExposureBiasRange is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_BIASRANGE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_BIASRANGE FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_BIASRANGE_PROMISE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_BIASRANGE ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 mode locked + * @tc.number : SET_EXPOSURE_BIAS_exposure mode locked * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(-4) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0100 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 mode locked + * @tc.number : GET_EXPOSURE_VALUE_exposure mode locked * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 to operate"); + it('GET_EXPOSURE_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(-4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_VALUE ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 + * @tc.number : IS_EXPOSURE_MODE_AUTO_SUPPORTED + * @tc.name : check is exposure mode auto supported-camera0Input api + * @tc.desc : check is exposure mode auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_AUTO_SUPPORTED', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_AUTO_SUPPORTED PASSED: " + data); + expect(data).assertEqual(true); + }) + .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED FAILED: " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_AUTO_SUPPORTED ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_AUTO + * @tc.name : set exposure mode auto camera0 api + * @tc.desc : set exposure mode auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO PASSED") + expect(cameraObj.ExposureMode.EXPOSURE_MODE_AUTO).assertEqual(1); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "Entering SET_EXPOSURE_MODE_AUTO ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : GET_EXPOSURE_MODE_AUTO * @tc.name : get exposure mode auto camera0 api * @tc.desc : get exposure mode auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 to operate"); + /* EXPOSUREMODE Interface will be change + it('GET_EXPOSURE_MODE_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_AUTO to operate"); await camera0InputPromise.getExposureMode() .then(function (data) { console.info(TAG + "Entering get exposure mode auto SUCCESS"); console.info(TAG + "Current exposureMode is: " + data); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_AUTO_PROMISE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_AUTO ends here"); await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 mode auto + * @tc.number : SET_EXPOSURE_POINT_exposure mode auto * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); await camera0InputPromise.setExposurePoint(Point2) .then(function (data) { console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED: " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 mode auto + * @tc.number : GET_EXPOSURE_POINT_exposure mode auto * @tc.name : get exposure Point camera0 api * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); await camera0InputPromise.getExposurePoint() .then(function (data) { console.info(TAG + "Entering getExposurePoint SUCCESS"); console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 FAILED: " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED: " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0200 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 mode auto + * @tc.number : SET_EXPOSURE_BIAS_exposure mode auto * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(1) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 mode auto + * @tc.number : GET_EXPOSURE_VALUE_exposure mode auto * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 to operate"); + it('GET_EXPOSURE_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(1); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 PASSED"); + console.info(TAG + "GET_EXPOSURE_VALUE PASSED"); + }) + .catch((err) => { + expect().assertFail(); + console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message); + }); + console.info(TAG + "GET_EXPOSURE_VALUE ends here"); + await sleep(1); + done(); + }) + + /** + * @tc.number : IS_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : check is exposure mode continuous auto supported-camera0Input api + * @tc.desc : check is exposure mode continuous auto supported-camera0Input api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('IS_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.isExposureModeSupported(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function (data) { + console.info(TAG + "Entering IS_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED: " + data); + expect(data).assertEqual(false); }) .catch((err) => { + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); + expect().assertFail(); + }); + console.info(TAG + "IS_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); + await sleep(1); + done(); + }) + */ + + /** + * @tc.number : SET_EXPOSURE_MODE_CONTINUOUS_AUTO + * @tc.name : set exposure mode continuous auto camera0 api + * @tc.desc : set exposure mode continuous auto camera0 api + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + /* EXPOSUREMODE Interface will be change + it('SET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); + await camera0InputPromise.setExposureMode(cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO) + .then(function () { + console.info(TAG + "Entering set exposure mode auto SUCCESS, current ExposureMode is: " + cameraObj.ExposureMode.EXPOSURE_MODE_CONTINUOUS_AUTO); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED") expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 FAILED : " + err.message); + }) + .catch((err) => { + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED : " + err.message); + expect(true).assertTrue(); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0200 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 + * @tc.number : GET_EXPOSURE_MODE_CONTINUOUS_AUTO * @tc.name : get exposure mode continuous auto camera0 api * @tc.desc : get exposure mode continuous auto camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 to operate"); + /* EXPOSUREMODE Interface will be change + it('GET_EXPOSURE_MODE_CONTINUOUS_AUTO', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_MODE_CONTINUOUS_AUTO to operate"); await camera0InputPromise.getExposureMode() .then(function (data) { console.info(TAG + "Entering get exposure mode auto SUCCESS"); console.info(TAG + "Current exposureMode is: " + data); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 PASSED"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_MODE_CONTINUOUS_AUTO_PROMISE_0100 ends here"); + console.info(TAG + "GET_EXPOSURE_MODE_CONTINUOUS_AUTO ends here"); await sleep(1); done(); }) + */ /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 + * @tc.number : SET_EXPOSURE_POINT * @tc.name : set exposure Point camera0 api * @tc.desc : set exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 to operate"); + it('SET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_POINT to operate"); await camera0InputPromise.setExposurePoint(Point3) .then(function (data) { console.info(TAG + "Entering set exposure Point SUCCESS, current ExposurePoint is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_POINT PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_POINT FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_POINT_PROMISE_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 + * @tc.number : GET_EXPOSURE_POINT * @tc.name : get exposure Point camera0 api * @tc.desc : get exposure Point camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 to operate"); + it('GET_EXPOSURE_POINT', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_POINT to operate"); await camera0InputPromise.getExposurePoint() .then(function (data) { console.info(TAG + "Entering getExposurePoint SUCCESS"); console.info(TAG + "Current ExposurePoint is: " + JSON.stringify(data)); expect(true).assertTrue(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_POINT PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_POINT FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_POINT_PROMISE_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_POINT ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 mode continuous auto + * @tc.number : SET_EXPOSURE_BIAS_exposure mode continuous auto * @tc.name : set exposure bias camera0 api * @tc.desc : set exposure bias camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 to operate"); + it('SET_EXPOSURE_BIAS', 0, async function (done) { + console.info(TAG + "Entering SET_EXPOSURE_BIAS to operate"); await camera0InputPromise.setExposureBias(4) .then(function (data) { console.info(TAG + "Entering set exposure bias SUCCESS, current Exposurebias is: " + JSON.stringify(data)); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 PASSED") + console.info(TAG + "Entering SET_EXPOSURE_BIAS PASSED") expect(true).assertTrue(); }) .catch((err) => { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 FAILED : " + err.message); + console.info(TAG + "Entering SET_EXPOSURE_BIAS FAILED : " + err.message); expect().assertFail(); }); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SET_EXPOSURE_BIAS_PROMISE_0300 ends here"); + console.info(TAG + "Entering SET_EXPOSURE_BIAS ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 + * @tc.number : GET_EXPOSURE_VALUE * @tc.name : get exposure value camera0 api * @tc.desc : get exposure value camera0 api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300', 0, async function (done) { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 to operate"); + it('GET_EXPOSURE_VALUE', 0, async function (done) { + console.info(TAG + "Entering GET_EXPOSURE_VALUE to operate"); await camera0InputPromise.getExposureValue() .then(function (data) { console.info(TAG + "Entering getExposureValue SUCCESS"); console.info(TAG + "Current ExposureValue is: " + JSON.stringify(data)); expect(data).assertEqual(4); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 PASSED"); + console.info(TAG + "GET_EXPOSURE_VALUE PASSED"); }) .catch((err) => { expect().assertFail(); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 FAILED : " + err.message); + console.info(TAG + "GET_EXPOSURE_VALUE FAILED : " + err.message); }); - console.info(TAG + "SUB_MULTIMEDIA_CAMERA_GET_EXPOSURE_VALUE_PROMISE_0300 ends here"); + console.info(TAG + "GET_EXPOSURE_VALUE ends here"); await sleep(1); done(); }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 + * @tc.number : VIDEO_OUTPUT_START_PROMISE * @tc.name : VideoOutput start promise api * @tc.desc : VideoOutput start promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100', 0, async function (done) { + it('VIDEO_OUTPUT_START_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { console.info(TAG + 'Entering Video Output start videoOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE to operate') await videoOutputPromise.start() expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_START_PROMISE_0100 ends here') + console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE PASSED') + console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE ends here') await sleep(1) done() } @@ -3221,22 +3661,22 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 + * @tc.number : VIDEO_OUTPUT_STOP_PROMISE * @tc.name : VideoOutput stop promise api * @tc.desc : VideoOutput stop promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100', 0, async function (done) { + it('VIDEO_OUTPUT_STOP_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { console.info(TAG + 'Entering Video Output Stop videoOutputPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 to operate') + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE to operate') await videoOutputPromise.stop() expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_VIDEO_OUTPUT_STOP_PROMISE_0100 ends here') + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE PASSED') + console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE ends here') await sleep(1) done() } @@ -3245,22 +3685,22 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 + * @tc.number : CAPTURE_SESSION_STOP_PROMISE * @tc.name : CaptureSession stop promise api * @tc.desc : CaptureSession stop promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100', 0, async function (done) { + it('CAPTURE_SESSION_STOP_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + 'Entering Capture Session Stop captureSessionPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 to operate') + console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE to operate') await captureSessionPromise.stop() expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_STOP_PROMISE_0100 ends here') + console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE PASSED') + console.info(TAG + 'Entering CAPTURE_SESSION_STOP_PROMISE ends here') await sleep(1) done() } @@ -3269,22 +3709,22 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 + * @tc.number : CAPTURE_SESSION_RELEASE_PROMISE * @tc.name : CaptureSession release promise api * @tc.desc : CaptureSession release promise api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100', 0, async function (done) { + it('CAPTURE_SESSION_RELEASE_PROMISE', 0, async function (done) { if (captureSessionPromise == null || captureSessionPromise == undefined) { console.info(TAG + 'Entering Capture session release captureSessionPromise == null || undefined') } else { - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 to operate') + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE_PROMISE to operate') await captureSessionPromise.release() expect(true).assertTrue() - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 PASSED') - console.info(TAG + 'Entering SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_RELEASE_PROMISE_0100 ends here') + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE_PROMISE PASSED') + console.info(TAG + 'Entering CAPTURE_SESSION_RELEASE_PROMISE ends here') await sleep(1) done() } @@ -3293,22 +3733,22 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE * @tc.name : videoOutput release api * @tc.desc : videoOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (videoOutputPromise == null || videoOutputPromise == undefined) { console.info(TAG + "Entering Video Output release previewOutputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); await videoOutputPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1); done(); } @@ -3317,22 +3757,22 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE * @tc.name : PreviewOutput release api * @tc.desc : PreviewOutput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (previewOutputPromise == null || previewOutputPromise == undefined) { console.info(TAG + "Entering previewOutputPromise.release previewOutputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE to operate"); await previewOutputPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1); done(); } @@ -3341,22 +3781,22 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) { }) /** - * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 + * @tc.number : CAMERAINPUT_RELEASE_SUCCESS_PROMISE * @tc.name : cameraInput release api * @tc.desc : cameraInput release api * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100', 0, async function (done) { + it('CAMERAINPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) { if (camera0InputPromise == null || camera0InputPromise == undefined) { console.info(TAG + "Entering camera0InputPromise.release camera0InputPromise == null || undefined"); } else { - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 to operate"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE to operate"); await camera0InputPromise.release(); expect(true).assertTrue(); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 PASSED"); - console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERAINPUT_RELEASE_SUCCESS_PROMISE_0100 ends here"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE PASSED"); + console.info(TAG + "Entering CAMERAINPUT_RELEASE_SUCCESS_PROMISE ends here"); await sleep(1); done(); } diff --git a/multimedia/camera/cameraDepthOffield/src/main/resources/base/element/string.json b/multimedia/camera/camera_js_standard/src/main/resources/base/element/string.json similarity index 100% rename from multimedia/camera/cameraDepthOffield/src/main/resources/base/element/string.json rename to multimedia/camera/camera_js_standard/src/main/resources/base/element/string.json diff --git a/multimedia/camera/cameraDepthOffield/src/main/resources/base/media/icon.png b/multimedia/camera/camera_js_standard/src/main/resources/base/media/icon.png similarity index 100% rename from multimedia/camera/cameraDepthOffield/src/main/resources/base/media/icon.png rename to multimedia/camera/camera_js_standard/src/main/resources/base/media/icon.png diff --git a/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js b/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js index 5e9d459036c062b78284aa0b3e8f291e3b3710aa..29b96b5ef5225ddfc7b5eb664b9f1adb6f28e966 100644 --- a/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js +++ b/multimedia/image/image_js_standard/image/src/main/js/test/addImage.test.js @@ -60,6 +60,101 @@ export default function addImage() { }) } + async function createIncrementalSourceCb(done, testNum, type, opts) { + let testimagebuffer = testPng; + let incSouce; + console.info(`${testNum} 0001 ` + testimagebuffer.length); + let bufferSize = 5000; + let offset = 0; + if (type == 'sourceOpts') { + incSouce = image.createIncrementalSource(new ArrayBuffer(1), opts); + } else { + incSouce = image.createIncrementalSource(new ArrayBuffer(1)); + } + let ret; + let isFinished = false; + while (offset < testimagebuffer.length) { + var oneStep = testimagebuffer.slice(offset, offset + bufferSize); + console.info(`${testNum} 0002 ` + oneStep.length); + if (oneStep.length < bufferSize) { + isFinished = true; + } + ret = await new Promise(res => { + incSouce.updateData(oneStep, isFinished, 0, oneStep.length, (err, ret) => { + res(ret); + }) + }) + + if (!ret) { + console.info(`${testNum} updateData failed`); + expect(ret).assertTrue(); + break; + } + offset = offset + oneStep.length; + console.info(`${testNum} 0003 ` + offset); + } + if (ret) { + console.info(`${testNum} updateData success `); + let decodingOptions = { + sampleSize: 1 + }; + incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { + console.info(`${testNum} 0004` + pixelmap); + expect(pixelmap != undefined).assertTrue(); + done(); + }) + } else { + expect(false).assertTrue(); + done(); + } + } + + async function createIncrementalSourcePromise(done, testNum, type, opts) { + let testimagebuffer = testPng; + let incSouce; + console.info(`${testNum} 0001 ` + testimagebuffer.length); + let bufferSize = 5000; + let offset = 0; + if (type == 'sourceOpts') { + console.info(`${testNum} have sourceopts`) + incSouce = image.createIncrementalSource(new ArrayBuffer(1), opts); + } else { + console.info(`${testNum} no sourceopts`) + incSouce = image.createIncrementalSource(new ArrayBuffer(1)); + } + let ret; + let isFinished = false; + while (offset < testimagebuffer.length) { + var oneStep = testimagebuffer.slice(offset, offset + bufferSize); + console.info(`${testNum} 0002 ` + oneStep.length); + if (oneStep.length < bufferSize) { + isFinished = true; + } + ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length); + if (!ret) { + console.info(`${testNum} updateData failed`); + expect(ret).assertTrue(); + break; + } + offset = offset + oneStep.length; + console.info(`${testNum} 0003 ` + offset); + } + if (ret) { + console.info(`${testNum} updateData success `); + let decodingOptions = { + sampleSize: 1 + }; + incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { + console.info(`${testNum} 0004` + pixelmap); + expect(pixelmap != undefined).assertTrue(); + done(); + }) + } else { + expect(false).assertTrue(); + done(); + } + } + /** * @tc.number : SUB_GRAPHIC_IMAGE_CREATEPIXELMAP_PROMISE_0100 * @tc.name : create pixelmap-promise (editable: true, pixelFormat: RGBA_8888, size: { height: 4, width: 6 }, bytes = buffer,scaleMode: 1, alphaType: 0) @@ -199,52 +294,11 @@ export default function addImage() { * @tc.level : Level 1 */ it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100', 0, async function (done) { - try { - let testimagebuffer = testPng; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0003 ' + testimagebuffer.length); - let bufferSize = 5000; - let offset = 0; - const incSouce = image.createIncrementalSource(new ArrayBuffer(1)); - let ret; - let isFinished = false; - while (offset < testimagebuffer.length) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0006 ' + testimagebuffer.length); - var oneStep = testimagebuffer.slice(offset, offset + bufferSize); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0007 ' + oneStep.length); - if (oneStep.length < bufferSize) { - isFinished = true; - } - ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length); - if (!ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 updateData failed'); - expect(ret).assertTrue(); - break; - } - offset = offset + oneStep.length; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0011 ' + offset); - } - if (ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 updateData success '); - let decodingOptions = { - sampleSize: 1 - }; - incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 0014' + pixelmap); - expect(pixelmap != undefined).assertTrue(); - done(); - }) - } else { - expect(false).assertTrue(); - done(); - } - } catch (error) { - expect(false).assertTrue(); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100 updateData failed ' + error); - } + createIncrementalSourcePromise(done, 'SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0100', 'noSourceOpts') }) /** - * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 + * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0100 * @tc.name : createIncrementalSource-updateData-png-promise * @tc.desc : 1.create imagesource * 2.update data @@ -253,52 +307,46 @@ export default function addImage() { * @tc.type : Functional * @tc.level : Level 1 */ - it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200', 0, async function (done) { - try { - let testimagebuffer = testPng; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0001 ' + testimagebuffer.length); - let bufferSize = 5000; - let offset = 0; - const incSouce = image.createIncrementalSource(new ArrayBuffer(1)); - let ret; - let isFinished = false; - while (offset < testimagebuffer.length) { - var oneStep = testimagebuffer.slice(offset, offset + bufferSize); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0002 ' + oneStep.length); - if (oneStep.length < bufferSize) { - isFinished = true; - } - ret = await new Promise(res => { - incSouce.updateData(oneStep, isFinished, 0, oneStep.length, (err, ret) => { - res(ret); - }) - }) - if (!ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 updateData failed'); - expect(ret).assertTrue(); - break; - } - offset = offset + oneStep.length; - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0003 ' + offset); - } - if (ret) { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 updateData success '); - let decodingOptions = { - sampleSize: 1 - }; - incSouce.createPixelMap(decodingOptions, (err, pixelmap) => { - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 0004' + pixelmap); - expect(pixelmap != undefined).assertTrue(); - done(); - }) - } else { - expect(false).assertTrue(); - done(); - } - } catch (error) { - expect(false).assertTrue(); - console.info('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0200 updateData failed ' + error); - } + it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0100', 0, async function (done) { + createIncrementalSourceCb(done, 'SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0100', 'noSourceOpts') + }) + + /** + * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0300 + * @tc.name : createIncrementalSource-updateData-png-promise + * @tc.desc : 1.create imagesource + * 2.update data + * 3.create pixelmap + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0300', 0, async function (done) { + let opts = { + sourceDensity: 240, + pixelFormat: 3, + size: { height: 4, width: 6 } + }; + createIncrementalSourcePromise(done, 'SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_PROMISE_0300', 'sourceOpts', opts) + }) + + /** + * @tc.number : SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0200 + * @tc.name : createIncrementalSource-updateData-png-callback + * @tc.desc : 1.create imagesource + * 2.update data + * 3.create pixelmap + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0200', 0, async function (done) { + let opts = { + sourceDensity: 240, + pixelFormat: 3, + size: { height: 4, width: 6 } + }; + createIncrementalSourceCb(done, 'SUB_GRAPHIC_IMAGE_CREATEINCREMENTALSOURCE_UPDATEDATA_PNG_CALLBACK_0200', 'sourceOpts', opts) }) }) } \ No newline at end of file