未验证 提交 7e073cfc 编写于 作者: O openharmony_ci 提交者: Gitee

!7139 相机xts同步接口修改

Merge pull request !7139 from SongChunPeng/master
...@@ -96,12 +96,12 @@ export default function cameraEnumTest() { ...@@ -96,12 +96,12 @@ export default function cameraEnumTest() {
*/ */
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100--------------");
console.info("CameraType: "+ JSON.stringify(camera.CameraType));
expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_DEFAULT == 0).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_WIDE_ANGLE == 1).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_ULTRA_WIDE == 2).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_TELEPHOTO == 3).assertTrue();
expect(camera.CameraType.CAMERA_TYPE_TRUE_DEPTH == 4).assertTrue(); expect(camera.CameraType.CAMERA_TYPE_TRUE_DEPTH == 4).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERATYPE_0100 ends here");
done(); done();
}) })
...@@ -291,5 +291,29 @@ export default function cameraEnumTest() { ...@@ -291,5 +291,29 @@ export default function cameraEnumTest() {
done(); done();
}) })
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100
* @tc.name : Camera CameraErrorCode Eunm
* @tc.desc : Camera CameraErrorCode Eunm
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100--------------");
expect(camera.CameraErrorCode.INVALID_ARGUMENT == 7400101).assertTrue();
expect(camera.CameraErrorCode.OPERATION_NOT_ALLOWED == 7400102).assertTrue();
expect(camera.CameraErrorCode.SESSION_NOT_CONFIG == 7400103).assertTrue();
expect(camera.CameraErrorCode.SESSION_NOT_RUNNING == 7400104).assertTrue();
expect(camera.CameraErrorCode.SESSION_CONFIG_LOCKED == 7400105).assertTrue();
expect(camera.CameraErrorCode.DEVICE_SETTING_LOCKED == 7400106).assertTrue();
expect(camera.CameraErrorCode.CONFILICT_CAMERA == 7400107).assertTrue();
expect(camera.CameraErrorCode.DEVICE_DISABLED == 7400108).assertTrue();
expect(camera.CameraErrorCode.SERVICE_FATAL_ERROR == 7400201).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ENUM_CAMERAERRORCODE_0100 ends here");
done();
})
}) })
} }
\ No newline at end of file
...@@ -69,10 +69,10 @@ export default function CameraInputTest() { ...@@ -69,10 +69,10 @@ export default function CameraInputTest() {
} }
} }
async function getCameraManagerInstance() { function getCameraManagerInstance() {
console.info('Enter getCameraManagerInstance'); console.info('Enter getCameraManagerInstance');
mCameraManager = await cameraObj.getCameraManager(null); mCameraManager = cameraObj.getCameraManager(null);
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "getCameraManager FAILED"); console.info(TAG + "getCameraManager FAILED");
return false; return false;
...@@ -83,10 +83,10 @@ export default function CameraInputTest() { ...@@ -83,10 +83,10 @@ export default function CameraInputTest() {
return true; return true;
} }
async function getCameraSupportDevicesArray() { function getCameraSupportDevicesArray() {
console.info('Enter getCameraSupportDevicesArray'); console.info('Enter getCameraSupportDevicesArray');
mCameraDevicesArray = await mCameraManager.getSupportedCameras(); mCameraDevicesArray = mCameraManager.getSupportedCameras();
/* /*
mCameraManager.getSupportedCameras(async (err, data) => { mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback"); console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...@@ -118,15 +118,12 @@ export default function CameraInputTest() { ...@@ -118,15 +118,12 @@ export default function CameraInputTest() {
return true; return true;
} }
async function beginCameraSessionConfig() { function beginCameraSessionConfig() {
console.info('Enter beginCameraSessionConfig'); console.info('Enter beginCameraSessionConfig');
console.info(TAG + "Entering beginConfig start"); console.info(TAG + "Entering beginConfig start");
mCameraSession.beginConfig(); mCameraSession.beginConfig();
console.info(TAG + "Entering beginConfig end"); console.info(TAG + "Entering beginConfig end");
await sleep(30);
console.info('Exit beginCameraSessionConfig'); console.info('Exit beginCameraSessionConfig');
return true; return true;
...@@ -150,11 +147,11 @@ export default function CameraInputTest() { ...@@ -150,11 +147,11 @@ export default function CameraInputTest() {
return true; return true;
} }
async function createCameraSessionInstance() { function createCameraSessionInstance() {
console.info('Enter createCameraSessionInstance'); console.info('Enter createCameraSessionInstance');
try { try {
mCameraSession = await mCameraManager.createCaptureSession(); mCameraSession = mCameraManager.createCaptureSession();
} }
catch { catch {
console.info('createCaptureSession FAILED'); console.info('createCaptureSession FAILED');
...@@ -165,7 +162,7 @@ export default function CameraInputTest() { ...@@ -165,7 +162,7 @@ export default function CameraInputTest() {
return false; return false;
} }
await beginCameraSessionConfig(); beginCameraSessionConfig();
console.info('Exit createCameraSessionInstance'); console.info('Exit createCameraSessionInstance');
...@@ -184,23 +181,16 @@ export default function CameraInputTest() { ...@@ -184,23 +181,16 @@ export default function CameraInputTest() {
return false; return false;
} }
mCameraInput = await mCameraManager.createCameraInput(mCameraDevicesArray[idx]); mCameraInput = mCameraManager.createCameraInput(mCameraDevicesArray[idx]);
if (isEmpty(mCameraInput)) { if (isEmpty(mCameraInput)) {
console.info(TAG + "createCameraInput FAILED"); console.info(TAG + "createCameraInput FAILED");
return false; return false;
} }
mCameraInput.open(async (err) => { await mCameraInput.open();
console.info(TAG + "Entering mCameraInput open callback");
if (!err) {
console.info(TAG + "Entering mCameraInput open PASSED ");
} else {
console.info(TAG + "Entering mCameraInput open FAILED : " + err.message);
}
})
await sleep(100); sleep(100);
console.info(idx + 'th CameraInput is: ' + mCameraInput); console.info(idx + 'th CameraInput is: ' + mCameraInput);
...@@ -221,16 +211,16 @@ export default function CameraInputTest() { ...@@ -221,16 +211,16 @@ export default function CameraInputTest() {
return true; return true;
} }
async function createOutput(idx:any) { function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = mCameraManager.getSupportedOutputCapability(); let cameraOutputCap = mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) { if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], globalThis.surfaceId); mPreviewOutput = mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], globalThis.surfaceId);
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
break; break;
} }
...@@ -253,7 +243,6 @@ export default function CameraInputTest() { ...@@ -253,7 +243,6 @@ export default function CameraInputTest() {
console.info('Enter releaseOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop();
await mPreviewOutput.release(); await mPreviewOutput.release();
} }
...@@ -266,18 +255,18 @@ export default function CameraInputTest() { ...@@ -266,18 +255,18 @@ export default function CameraInputTest() {
console.info(TAG + "Enter startCameraSession"); console.info(TAG + "Enter startCameraSession");
await createInput(idx); await createInput(idx);
await createOutput(idx); createOutput(idx);
await sleep(1); await sleep(1);
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to addInput"); console.info(TAG + "Start to addInput");
await mCameraSession.addInput(mCameraInput); mCameraSession.addInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to addOutput mPreviewOutput"); console.info(TAG + "Start to addOutput mPreviewOutput");
await mCameraSession.addOutput(mPreviewOutput); mCameraSession.addOutput(mPreviewOutput);
} }
await sleep(1); await sleep(1);
...@@ -294,12 +283,12 @@ export default function CameraInputTest() { ...@@ -294,12 +283,12 @@ export default function CameraInputTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to removeInput input"); console.info(TAG + "Start to removeInput input");
await mCameraSession.removeInput(mCameraInput); mCameraSession.removeInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to removeOutput mPreviewOutput"); console.info(TAG + "Start to removeOutput mPreviewOutput");
await mCameraSession.removeOutput(mPreviewOutput); mCameraSession.removeOutput(mPreviewOutput);
} }
await releaseInput(); await releaseInput();
...@@ -316,9 +305,9 @@ export default function CameraInputTest() { ...@@ -316,9 +305,9 @@ export default function CameraInputTest() {
await getPermission(); await getPermission();
sleep(1000); sleep(1000);
await driveFn(); await driveFn();
await getCameraManagerInstance(); getCameraManagerInstance();
await getCameraSupportDevicesArray(); getCameraSupportDevicesArray();
await createCameraSessionInstance(); createCameraSessionInstance();
console.info('beforeAll case'); console.info('beforeAll case');
}); });
beforeEach(function () { beforeEach(function () {
......
...@@ -296,7 +296,7 @@ export default function cameraJSUnitOutput() { ...@@ -296,7 +296,7 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "Entering CREATE_CAMERA_INPUT cameraManager == null || undefined") console.info(TAG + "Entering CREATE_CAMERA_INPUT cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
cameraInput = await cameraManager.createCameraInput(cameraDevicesArray[0]); cameraInput = cameraManager.createCameraInput(cameraDevicesArray[0]);
if (isEmpty(cameraInput)) { if (isEmpty(cameraInput)) {
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED"); console.info(TAG + "SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 FAILED");
} }
...@@ -329,7 +329,7 @@ export default function cameraJSUnitOutput() { ...@@ -329,7 +329,7 @@ export default function cameraJSUnitOutput() {
expect().assertFail(); expect().assertFail();
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100")
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]); let cameraOutputCap = getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]);
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
if (isEmpty(previewProfilesArray)) { if (isEmpty(previewProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined")
...@@ -337,7 +337,6 @@ export default function cameraJSUnitOutput() { ...@@ -337,7 +337,6 @@ export default function cameraJSUnitOutput() {
} }
previewOutput = cameraManager.createPreviewOutput(previewProfilesArray[0], globalThis.surfaceId); previewOutput = cameraManager.createPreviewOutput(previewProfilesArray[0], globalThis.surfaceId);
} }
await sleep(1000);
done(); done();
}) })
...@@ -357,19 +356,18 @@ export default function cameraJSUnitOutput() { ...@@ -357,19 +356,18 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 cameraManager == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]); let cameraOutputCap = getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]);
let photoProfilesArray = cameraOutputCap.photoProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
if (isEmpty(photoProfilesArray)) { if (isEmpty(photoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 previewProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 previewProfilesArray == null || undefined")
expect().assertFalse(); expect().assertFalse();
} }
photoOutput = await cameraManager.createPhotoOutput(photoProfilesArray[0], surfaceId1); photoOutput = cameraManager.createPhotoOutput(photoProfilesArray[0], surfaceId1);
if (isEmpty(photoOutput)) { if (isEmpty(photoOutput)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 data is empty"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_PHOTO_OUTPUT_PROMISE_0100 data is empty");
expect().assertFalse(); expect().assertFalse();
} }
} }
await sleep(1000);
done(); done();
}) })
...@@ -389,7 +387,7 @@ export default function cameraJSUnitOutput() { ...@@ -389,7 +387,7 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 cameraManager == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]); let cameraOutputCap = getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 camera:" + cameraDevicesArray[0].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 camera:" + cameraDevicesArray[0].cameraId);
expect(isEmpty(cameraOutputCap)).assertFalse(); expect(isEmpty(cameraOutputCap)).assertFalse();
let videoProfilesArray = cameraOutputCap.videoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
...@@ -397,7 +395,6 @@ export default function cameraJSUnitOutput() { ...@@ -397,7 +395,6 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 start createVideoOutput") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_VIDEO_OUTPUT_CALLBACK_0100 start createVideoOutput")
videoOutput = cameraManager.createVideoOutput(videoProfilesArray[0], videoSurfaceId); videoOutput = cameraManager.createVideoOutput(videoProfilesArray[0], videoSurfaceId);
} }
await sleep(1000);
done(); done();
}) })
...@@ -416,7 +413,7 @@ export default function cameraJSUnitOutput() { ...@@ -416,7 +413,7 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 cameraManager == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]); let cameraOutputCap = getSupportedOutputCapabilityInPromise(cameraDevicesArray[0]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 camera:" + cameraDevicesArray[0].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_METADATA_OUTPUT_CALLBACK_0100 camera:" + cameraDevicesArray[0].cameraId);
expect(isEmpty(cameraOutputCap)).assertFalse(); expect(isEmpty(cameraOutputCap)).assertFalse();
mMetadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; mMetadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes;
...@@ -427,7 +424,6 @@ export default function cameraJSUnitOutput() { ...@@ -427,7 +424,6 @@ export default function cameraJSUnitOutput() {
metadataOutput = cameraManager.createMetadataOutput(mMetadataObjectTypeArray); metadataOutput = cameraManager.createMetadataOutput(mMetadataObjectTypeArray);
} }
} }
await sleep(1000);
done(); done();
}) })
...@@ -450,7 +446,6 @@ export default function cameraJSUnitOutput() { ...@@ -450,7 +446,6 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100")
captureSession = cameraManager.createCaptureSession(); captureSession = cameraManager.createCaptureSession();
} }
await sleep(1000);
done(); done();
}) })
...@@ -471,7 +466,6 @@ export default function cameraJSUnitOutput() { ...@@ -471,7 +466,6 @@ export default function cameraJSUnitOutput() {
} else { } else {
captureSession.beginConfig(); captureSession.beginConfig();
} }
await sleep(1000);
done(); done();
}) })
...@@ -493,7 +487,6 @@ export default function cameraJSUnitOutput() { ...@@ -493,7 +487,6 @@ export default function cameraJSUnitOutput() {
} else { } else {
captureSession.addInput(cameraInput) captureSession.addInput(cameraInput)
} }
await sleep(1000);
done(); done();
}) })
...@@ -519,7 +512,6 @@ export default function cameraJSUnitOutput() { ...@@ -519,7 +512,6 @@ export default function cameraJSUnitOutput() {
} }
captureSession.addOutput(previewOutput) captureSession.addOutput(previewOutput)
} }
await sleep(1000);
done(); done();
}) })
...@@ -545,7 +537,6 @@ export default function cameraJSUnitOutput() { ...@@ -545,7 +537,6 @@ export default function cameraJSUnitOutput() {
console.info(TAG + "captureSession start add photoOutput") console.info(TAG + "captureSession start add photoOutput")
captureSession.addOutput(photoOutput) captureSession.addOutput(photoOutput)
} }
await sleep(1000);
done(); done();
}) })
...@@ -566,7 +557,6 @@ export default function cameraJSUnitOutput() { ...@@ -566,7 +557,6 @@ export default function cameraJSUnitOutput() {
} else { } else {
captureSession.addOutput(videoOutput) captureSession.addOutput(videoOutput)
} }
await sleep(1000);
done(); done();
}) })
...@@ -588,7 +578,6 @@ export default function cameraJSUnitOutput() { ...@@ -588,7 +578,6 @@ export default function cameraJSUnitOutput() {
if (!isEmpty(metadataOutput)) { if (!isEmpty(metadataOutput)) {
captureSession.addOutput(metadataOutput) captureSession.addOutput(metadataOutput)
} }
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -671,8 +660,7 @@ export default function cameraJSUnitOutput() { ...@@ -671,8 +660,7 @@ export default function cameraJSUnitOutput() {
it('SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100', 1, async function (done) { it('SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------");
if (isEmpty(metadataOutput)) { if (isEmpty(metadataOutput)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadataOutput == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadata is not support")
expect().assertFail();
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate");
metadataOutput.on('error', async (err, data) => { metadataOutput.on('error', async (err, data) => {
......
...@@ -161,10 +161,10 @@ export default function cameraManagerTest() { ...@@ -161,10 +161,10 @@ export default function cameraManagerTest() {
return false; return false;
} }
async function getCameraManagerInstance() { function getCameraManagerInstance() {
console.info('Enter getCameraManagerInstance'); console.info('Enter getCameraManagerInstance');
mCameraManager = await cameraObj.getCameraManager(null); mCameraManager = cameraObj.getCameraManager(null);
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "getCameraManager FAILED"); console.info(TAG + "getCameraManager FAILED");
return false; return false;
...@@ -175,10 +175,10 @@ export default function cameraManagerTest() { ...@@ -175,10 +175,10 @@ export default function cameraManagerTest() {
return true; return true;
} }
async function getCameraSupportDevicesArray() { function getCameraSupportDevicesArray() {
console.info('Enter getCameraSupportDevicesArray'); console.info('Enter getCameraSupportDevicesArray');
mCameraDevicesArray = await mCameraManager.getSupportedCameras(); mCameraDevicesArray = mCameraManager.getSupportedCameras();
/* /*
mCameraManager.getSupportedCameras(async (err, data) => { mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback"); console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...@@ -210,7 +210,7 @@ export default function cameraManagerTest() { ...@@ -210,7 +210,7 @@ export default function cameraManagerTest() {
return true; return true;
} }
async function getSupportedOutputCapability(cameraDevice) { function getSupportedOutputCapability(cameraDevice) {
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering getSupportedOutputCapability cameraManager == null || undefined") console.info(TAG + "Entering getSupportedOutputCapability cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
...@@ -232,10 +232,10 @@ describe('CameraManagerTest', function () { ...@@ -232,10 +232,10 @@ describe('CameraManagerTest', function () {
console.info(TAG + '----------CameraManagerTest--------------') console.info(TAG + '----------CameraManagerTest--------------')
beforeAll(async function () { beforeAll(async function () {
await getCameraManagerInstance(); getCameraManagerInstance();
await getImageReceiverSurfaceId(); await getImageReceiverSurfaceId();
await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraSupportDevicesArray(); getCameraSupportDevicesArray();
console.info('beforeAll case'); console.info('beforeAll case');
}) })
...@@ -266,10 +266,9 @@ describe('CameraManagerTest', function () { ...@@ -266,10 +266,9 @@ describe('CameraManagerTest', function () {
*/ */
it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100--------------");
let cameraManagerPromise = await cameraObj.getCameraManager(null); let cameraManagerPromise = cameraObj.getCameraManager(null);
expect(isEmpty(cameraManagerPromise)).assertFalse(); expect(isEmpty(cameraManagerPromise)).assertFalse();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA_MANAGER_PROMISE_0100 cameraManagerPromise: " + JSON.stringify(cameraManagerPromise));
await sleep(1000);
done(); done();
}) })
...@@ -287,7 +286,7 @@ describe('CameraManagerTest', function () { ...@@ -287,7 +286,7 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 cameraManager == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
let mCameraDevicesArrayPromise = await mCameraManager.getSupportedCameras(); let mCameraDevicesArrayPromise = mCameraManager.getSupportedCameras();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(mCameraDevicesArrayPromise)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100: " + JSON.stringify(mCameraDevicesArrayPromise));
if (mCameraDevicesArrayPromise != null && mCameraDevicesArrayPromise.length > 0) { if (mCameraDevicesArrayPromise != null && mCameraDevicesArrayPromise.length > 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_PROMISE_0100 success");
...@@ -331,8 +330,7 @@ describe('CameraManagerTest', function () { ...@@ -331,8 +330,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
await sleep(100);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 camera:" + camerasArray[i].cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -362,7 +360,6 @@ describe('CameraManagerTest', function () { ...@@ -362,7 +360,6 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 PASSED camera:" + camerasArray[i].cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 PASSED camera:" + camerasArray[i].cameraId);
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 ends here");
await sleep(1000);
done(); done();
}) })
...@@ -377,7 +374,7 @@ describe('CameraManagerTest', function () { ...@@ -377,7 +374,7 @@ describe('CameraManagerTest', function () {
it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100--------------");
for (let i = 0; i < mCameraDevicesArray.length; i++) { for (let i = 0; i < mCameraDevicesArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(mCameraDevicesArray[i]); let cameraOutputCap = getSupportedOutputCapability(mCameraDevicesArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 camera:" + mCameraDevicesArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 camera:" + mCameraDevicesArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -409,7 +406,6 @@ describe('CameraManagerTest', function () { ...@@ -409,7 +406,6 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 PASSED camera:" + mCameraDevicesArray[i].cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 PASSED camera:" + mCameraDevicesArray[i].cameraId);
} }
console.info("CameraUnitTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 ends here"); console.info("CameraUnitTest: Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 ends here");
await sleep(1000);
done(); done();
}) })
...@@ -425,7 +421,7 @@ describe('CameraManagerTest', function () { ...@@ -425,7 +421,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 camera:" + camerasArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -446,7 +442,6 @@ describe('CameraManagerTest', function () { ...@@ -446,7 +442,6 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 PASSED camera:" + camerasArray[i].cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 PASSED camera:" + camerasArray[i].cameraId);
} }
await sleep(1000);
done(); done();
}) })
...@@ -462,7 +457,7 @@ describe('CameraManagerTest', function () { ...@@ -462,7 +457,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 camera:" + camerasArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let photoProfilesArray = cameraOutputCap.photoProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
...@@ -483,7 +478,6 @@ describe('CameraManagerTest', function () { ...@@ -483,7 +478,6 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 PASSED camera:" + camerasArray[i].cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 PASSED camera:" + camerasArray[i].cameraId);
} }
await sleep(1000);
done(); done();
}) })
...@@ -499,7 +493,7 @@ describe('CameraManagerTest', function () { ...@@ -499,7 +493,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 camera:" + camerasArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let videoProfilesArray = cameraOutputCap.videoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
...@@ -523,7 +517,6 @@ describe('CameraManagerTest', function () { ...@@ -523,7 +517,6 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 PASSED camera:" + camerasArray[i].cameraId); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 PASSED camera:" + camerasArray[i].cameraId);
} }
await sleep(1000);
done(); done();
}) })
...@@ -543,7 +536,7 @@ describe('CameraManagerTest', function () { ...@@ -543,7 +536,7 @@ describe('CameraManagerTest', function () {
} else { } else {
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraInputPromise = await mCameraManager.createCameraInput(camerasArray[i]); let cameraInputPromise = mCameraManager.createCameraInput(camerasArray[i]);
if (isEmpty(cameraInputPromise)) { if (isEmpty(cameraInputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 cameraInputPromise == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 cameraInputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
...@@ -552,7 +545,6 @@ describe('CameraManagerTest', function () { ...@@ -552,7 +545,6 @@ describe('CameraManagerTest', function () {
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_PROMISE_0100 ends here");
await sleep(1000);
done(); done();
}) })
...@@ -572,7 +564,7 @@ describe('CameraManagerTest', function () { ...@@ -572,7 +564,7 @@ describe('CameraManagerTest', function () {
} else { } else {
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraInputPromiseByType = await mCameraManager.createCameraInput(camerasArray[i].cameraPosition, camerasArray[i].cameraType); let cameraInputPromiseByType = mCameraManager.createCameraInput(camerasArray[i].cameraPosition, camerasArray[i].cameraType);
if (isEmpty(cameraInputPromiseByType)) { if (isEmpty(cameraInputPromiseByType)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 cameraInputPromiseByType == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 cameraInputPromiseByType == null || undefined")
expect().assertFail(); expect().assertFail();
...@@ -581,7 +573,6 @@ describe('CameraManagerTest', function () { ...@@ -581,7 +573,6 @@ describe('CameraManagerTest', function () {
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_INPUT_BY_POSITION_AND_TYPE_PROMISE_0100 ends here");
await sleep(1000);
done(); done();
}) })
...@@ -597,7 +588,7 @@ describe('CameraManagerTest', function () { ...@@ -597,7 +588,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -606,12 +597,11 @@ describe('CameraManagerTest', function () { ...@@ -606,12 +597,11 @@ describe('CameraManagerTest', function () {
expect().assertFail(); expect().assertFail();
} else { } else {
for (let j = 0; j < previewProfilesArray.length; j++) { for (let j = 0; j < previewProfilesArray.length; j++) {
let previewOutputPromise = await mCameraManager.createPreviewOutput(previewProfilesArray[j], globalThis.surfaceId); let previewOutputPromise = mCameraManager.createPreviewOutput(previewProfilesArray[j], globalThis.surfaceId);
if (isEmpty(previewOutputPromise)) { if (isEmpty(previewOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewOutputPromise == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} }
await sleep(100);
} }
} }
...@@ -635,7 +625,7 @@ describe('CameraManagerTest', function () { ...@@ -635,7 +625,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let photoProfilesArray = cameraOutputCap.photoProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
...@@ -644,19 +634,17 @@ describe('CameraManagerTest', function () { ...@@ -644,19 +634,17 @@ describe('CameraManagerTest', function () {
expect().assertFail(); expect().assertFail();
} else { } else {
for (let j = 0; j < photoProfilesArray.length; j++) { for (let j = 0; j < photoProfilesArray.length; j++) {
let photoOutputPromise = await mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface); let photoOutputPromise = mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface);
if (isEmpty(photoOutputPromise)) { if (isEmpty(photoOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoOutputPromise == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} }
await sleep(100);
} }
} }
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 PASS");
await sleep(1000);
done(); done();
}) })
...@@ -673,7 +661,7 @@ describe('CameraManagerTest', function () { ...@@ -673,7 +661,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let videoProfilesArray = cameraOutputCap.videoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
...@@ -682,7 +670,7 @@ describe('CameraManagerTest', function () { ...@@ -682,7 +670,7 @@ describe('CameraManagerTest', function () {
expect().assertFail(); expect().assertFail();
} else { } else {
for (let j = 0; j < videoProfilesArray.length; j++) { for (let j = 0; j < videoProfilesArray.length; j++) {
let videoOutputPromise = await mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface); let videoOutputPromise = mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface);
if (isEmpty(videoOutputPromise)) { if (isEmpty(videoOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoOutputPromise == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
...@@ -690,14 +678,12 @@ describe('CameraManagerTest', function () { ...@@ -690,14 +678,12 @@ describe('CameraManagerTest', function () {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoOutputPromise = " + videoOutputPromise); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoOutputPromise = " + videoOutputPromise);
break; break;
} }
await sleep(100);
} }
} }
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 PASS");
await sleep(1000);
done(); done();
}) })
...@@ -713,26 +699,24 @@ describe('CameraManagerTest', function () { ...@@ -713,26 +699,24 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]); let cameraOutputCap = getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes;
if (!isEmpty(metadataObjectTypeArray)) { if (!isEmpty(metadataObjectTypeArray)) {
let metadataOutputPromise = await mCameraManager.createMetadataOutput(metadataObjectTypeArray); let metadataOutputPromise = mCameraManager.createMetadataOutput(metadataObjectTypeArray);
if (isEmpty(metadataOutputPromise)) { if (isEmpty(metadataOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise = " + metadataOutputPromise) console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise = " + metadataOutputPromise)
} }
await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataObjectTypeArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataObjectTypeArray == null || undefined")
} }
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 PASS");
await sleep(1000);
done(); done();
}) })
...@@ -746,13 +730,12 @@ describe('CameraManagerTest', function () { ...@@ -746,13 +730,12 @@ describe('CameraManagerTest', function () {
*/ */
it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100', 2, async function (done) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 to operate");
let captureSessionPromise = await mCameraManager.createCaptureSession(); let captureSessionPromise = mCameraManager.createCaptureSession();
if (isEmpty(captureSessionPromise)) { if (isEmpty(captureSessionPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 captureSessionPromise == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 captureSessionPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_PROMISE_0100 PASSED");
await sleep(1000);
await captureSessionPromise.release(); await captureSessionPromise.release();
done(); done();
}) })
...@@ -779,7 +762,6 @@ describe('CameraManagerTest', function () { ...@@ -779,7 +762,6 @@ describe('CameraManagerTest', function () {
console.log(TAG + "isCameraMuted has failed for " + err.message); console.log(TAG + "isCameraMuted has failed for " + err.message);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000);
done(); done();
}) })
......
...@@ -180,10 +180,10 @@ export default function cameraSessionZoomRatioTest() { ...@@ -180,10 +180,10 @@ export default function cameraSessionZoomRatioTest() {
console.log(TAG + 'Exit releaseVideoReceiveSurface') console.log(TAG + 'Exit releaseVideoReceiveSurface')
} }
async function getCameraManagerInstance() { function getCameraManagerInstance() {
console.info('Enter getCameraManagerInstance'); console.info('Enter getCameraManagerInstance');
mCameraManager = await cameraObj.getCameraManager(null); mCameraManager = cameraObj.getCameraManager(null);
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "getCameraManager FAILED"); console.info(TAG + "getCameraManager FAILED");
return false; return false;
...@@ -194,10 +194,10 @@ export default function cameraSessionZoomRatioTest() { ...@@ -194,10 +194,10 @@ export default function cameraSessionZoomRatioTest() {
return true; return true;
} }
async function getCameraSupportDevicesArray() { function getCameraSupportDevicesArray() {
console.info('Enter getCameraSupportDevicesArray'); console.info('Enter getCameraSupportDevicesArray');
mCameraDevicesArray = await mCameraManager.getSupportedCameras(); mCameraDevicesArray = mCameraManager.getSupportedCameras();
/* /*
mCameraManager.getSupportedCameras(async (err, data) => { mCameraManager.getSupportedCameras(async (err, data) => {
console.info(TAG + "Entering getCameraSupportDevicesArray callback"); console.info(TAG + "Entering getCameraSupportDevicesArray callback");
...@@ -233,41 +233,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -233,41 +233,11 @@ export default function cameraSessionZoomRatioTest() {
return true; return true;
} }
async function beginCameraSessionConfig() { function createCameraSessionInstance() {
console.info('Enter beginCameraSessionConfig');
mCameraSession.beginConfig();
await sleep(30);
console.info('Exit beginCameraSessionConfig');
return true;
}
async function commitCameraSessionConfig() {
console.info('Enter commitCameraSessionConfig');
mCameraSession.commitConfig(async (err) => {
if (!err) {
console.info(TAG + "Entering commitConfig PASSED");
} else {
console.info(TAG + "Entering commitConfig FAILED : " + err.message);
}
})
await sleep(500);
console.info('Exit commitCameraSessionConfig');
return true;
}
async function createCameraSessionInstance() {
console.info('Enter createCameraSessionInstance'); console.info('Enter createCameraSessionInstance');
try { try {
mCameraSession = await mCameraManager.createCaptureSession(); mCameraSession = mCameraManager.createCaptureSession();
} }
catch { catch {
console.info('createCaptureSession FAILED'); console.info('createCaptureSession FAILED');
...@@ -278,7 +248,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -278,7 +248,7 @@ export default function cameraSessionZoomRatioTest() {
return false; return false;
} }
// await beginCameraSessionConfig(); mCameraSession.beginConfig();
console.info('Exit createCameraSessionInstance'); console.info('Exit createCameraSessionInstance');
...@@ -304,14 +274,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -304,14 +274,7 @@ export default function cameraSessionZoomRatioTest() {
return false; return false;
} }
mCameraInput.open(async (err) => { await mCameraInput.open();
console.info(TAG + "Entering mCameraInput open callback");
if (!err) {
console.info(TAG + "Entering mCameraInput open PASSED ");
} else {
console.info(TAG + "Entering mCameraInput open FAILED : " + err.message);
}
})
await sleep(100); await sleep(100);
...@@ -405,7 +368,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -405,7 +368,6 @@ export default function cameraSessionZoomRatioTest() {
console.info('Enter releaseOutput'); console.info('Enter releaseOutput');
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mPreviewOutput.stop();
await mPreviewOutput.release(); await mPreviewOutput.release();
} }
...@@ -427,9 +389,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -427,9 +389,7 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Enter startCameraSession"); console.info(TAG + "Enter startCameraSession");
await createInput(idx); await createInput(idx);
await createOutput(idx); createOutput(idx);
await beginCameraSessionConfig();
console.info(TAG + "Start to addInput"); console.info(TAG + "Start to addInput");
...@@ -438,17 +398,17 @@ export default function cameraSessionZoomRatioTest() { ...@@ -438,17 +398,17 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to addInput"); console.info(TAG + "Start to addInput");
await mCameraSession.addInput(mCameraInput); mCameraSession.addInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to addOutput mPreviewOutput"); console.info(TAG + "Start to addOutput mPreviewOutput");
await mCameraSession.addOutput(mPreviewOutput); mCameraSession.addOutput(mPreviewOutput);
} }
if (!isEmpty(mPhotoOutput)) { if (!isEmpty(mPhotoOutput)) {
console.info(TAG + "Start to addOutput mPhotoOutput"); console.info(TAG + "Start to addOutput mPhotoOutput");
await mCameraSession.addOutput(mPhotoOutput); mCameraSession.addOutput(mPhotoOutput);
} }
/* /*
if (!isEmpty(mVideoOutput)) { if (!isEmpty(mVideoOutput)) {
...@@ -458,13 +418,9 @@ export default function cameraSessionZoomRatioTest() { ...@@ -458,13 +418,9 @@ export default function cameraSessionZoomRatioTest() {
*/ */
await sleep(1); await sleep(1);
await commitCameraSessionConfig(); await mCameraSession.commitConfig();
console.info(TAG + "Entering startCameraSession start session begin"); console.info(TAG + "Entering startCameraSession start session begin");
await mCameraSession.start();
console.info(TAG + "Entering startCameraSession start session end");
/* /*
await mCameraSession.start(async (err) => { await mCameraSession.start(async (err) => {
...@@ -485,6 +441,8 @@ export default function cameraSessionZoomRatioTest() { ...@@ -485,6 +441,8 @@ export default function cameraSessionZoomRatioTest() {
async function stopCameraSession() { async function stopCameraSession() {
console.info(TAG + "Enter stopCameraSession"); console.info(TAG + "Enter stopCameraSession");
mCameraSession.beginConfig();
/* /*
mCameraSession.stop(async (err) => { mCameraSession.stop(async (err) => {
console.info(TAG + "Entering mCameraSession stop callback"); console.info(TAG + "Entering mCameraSession stop callback");
...@@ -498,19 +456,20 @@ export default function cameraSessionZoomRatioTest() { ...@@ -498,19 +456,20 @@ export default function cameraSessionZoomRatioTest() {
await sleep(100); await sleep(100);
*/ */
// await commitCameraSessionConfig();
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
console.info(TAG + "Start to removeInput input"); console.info(TAG + "Start to removeInput input");
await mCameraSession.removeInput(mCameraInput); mCameraSession.removeInput(mCameraInput);
} }
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
console.info(TAG + "Start to removeOutput mPreviewOutput"); console.info(TAG + "Start to removeOutput mPreviewOutput");
await mCameraSession.removeOutput(mPreviewOutput); mCameraSession.removeOutput(mPreviewOutput);
} }
if (!isEmpty(mPhotoOutput)) { if (!isEmpty(mPhotoOutput)) {
console.info(TAG + "Start to removeOutput mPhotoOutput"); console.info(TAG + "Start to removeOutput mPhotoOutput");
await mCameraSession.removeOutput(mPhotoOutput); mCameraSession.removeOutput(mPhotoOutput);
} }
/* /*
if (!isEmpty(mVideoOutput)) { if (!isEmpty(mVideoOutput)) {
...@@ -518,6 +477,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -518,6 +477,7 @@ export default function cameraSessionZoomRatioTest() {
await mCameraSession.removeOutput(mVideoOutput); await mCameraSession.removeOutput(mVideoOutput);
} }
*/ */
await releaseInput(); await releaseInput();
await releaseOutput(); await releaseOutput();
...@@ -533,9 +493,9 @@ export default function cameraSessionZoomRatioTest() { ...@@ -533,9 +493,9 @@ export default function cameraSessionZoomRatioTest() {
sleep(100); sleep(100);
await getPhotoReceiverSurface(); await getPhotoReceiverSurface();
await getVideoReceiveSurface(); await getVideoReceiveSurface();
await getCameraManagerInstance(); getCameraManagerInstance();
await getCameraSupportDevicesArray(); getCameraSupportDevicesArray();
await createCameraSessionInstance(); createCameraSessionInstance();
console.info('Device type = ' + deviceInfo.deviceType); console.info('Device type = ' + deviceInfo.deviceType);
...@@ -582,7 +542,7 @@ export default function cameraSessionZoomRatioTest() { ...@@ -582,7 +542,7 @@ export default function cameraSessionZoomRatioTest() {
await startCameraSession(i); await startCameraSession(i);
try { try {
let zoomRatioRange = await mCameraSession.getZoomRatioRange(); let zoomRatioRange = mCameraSession.getZoomRatioRange();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 finish");
if (zoomRatioRange.length > 0) { if (zoomRatioRange.length > 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: " + zoomRatioRange.length); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_PROMISE_0100 PASSED with ZoomRatioRange length is: " + zoomRatioRange.length);
...@@ -598,8 +558,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -598,8 +558,6 @@ export default function cameraSessionZoomRatioTest() {
catch { catch {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED");
} }
await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -635,12 +593,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -635,12 +593,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0]); mCameraSession.setZoomRatio(mZoomRatioRangeArray[i][0]);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + mZoomRatioRangeArray[i][0]);
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 finish");
if (zoomRatio == mZoomRatioRangeArray[i][0]) { if (zoomRatio == mZoomRatioRangeArray[i][0]) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -648,7 +605,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -648,7 +605,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0100 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -684,12 +640,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -684,12 +640,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1)); mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 finish");
if (zoomRatio != (mZoomRatioMaxArray[i] + 1)) { if (zoomRatio != (mZoomRatioMaxArray[i] + 1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -697,7 +652,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -697,7 +652,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0101 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -734,12 +688,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -734,12 +688,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1)); mCameraSession.setZoomRatio((mZoomRatioMaxArray[i] + 0.1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] + 0.1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 finish");
if (zoomRatio != (mZoomRatioMaxArray[i] + 0.1)) { if (zoomRatio != (mZoomRatioMaxArray[i] + 0.1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -747,7 +700,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -747,7 +700,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0102 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -784,12 +736,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -784,12 +736,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1)); mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 finish");
if (zoomRatio != (mZoomRatioMinArray[i] - 1)) { if (zoomRatio != (mZoomRatioMinArray[i] - 1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -797,7 +748,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -797,7 +748,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0103 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
...@@ -834,12 +784,11 @@ export default function cameraSessionZoomRatioTest() { ...@@ -834,12 +784,11 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mZoomRatioRangeArray[i])) { if (!isEmpty(mZoomRatioRangeArray[i])) {
await startCameraSession(i); await startCameraSession(i);
await mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 0.1)); mCameraSession.setZoomRatio((mZoomRatioMinArray[i] - 0.1));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1)); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + (mZoomRatioMaxArray[i] - 0.1));
await sleep(500);
let zoomRatio = await mCameraSession.getZoomRatio(); let zoomRatio = mCameraSession.getZoomRatio();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 finish");
if (zoomRatio != (mZoomRatioMinArray[i] - 0.1)) { if (zoomRatio != (mZoomRatioMinArray[i] - 0.1)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 PASSED with ZoomRatio is: " + zoomRatio);
...@@ -847,7 +796,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -847,7 +796,6 @@ export default function cameraSessionZoomRatioTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with ZoomRatio is: " + zoomRatio); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_ZOOM_RATIO_PROMISE_0104 FAILED with ZoomRatio is: " + zoomRatio);
expect().assertFail(); expect().assertFail();
} }
await sleep(500);
await stopCameraSession(); await stopCameraSession();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册