提交 f5cf1c29 编写于 作者: Y yygxr

fix xts case error for musl

Signed-off-by: Nyygxr <wuhao30@huawei.com>
上级 401a1ca9
...@@ -557,34 +557,34 @@ export default function CameraInputTest(surfaceId) { ...@@ -557,34 +557,34 @@ export default function CameraInputTest(surfaceId) {
expect(isEmpty(cameraInput)).assertFalse(); expect(isEmpty(cameraInput)).assertFalse();
await cameraInput.open(async (err) => { await cameraInput.open(async (err) => {
if (!err) { if (!err) {
console.info(TAG + "PASSED open with CameraID :" + camerasArray[i].cameraId); console.info(TAG + " PASSED open with CameraID :" + camerasArray[i].cameraId);
} else { } else {
successFlag = false; successFlag = false;
console.info(TAG + "open FAILED: " + err.message); console.info(TAG + " open FAILED: " + err.message);
} }
}); });
await sleep(400); await sleep(400);
await cameraInput.close(async (err) => { await cameraInput.close(async (err) => {
if (!err) { if (!err) {
console.info(TAG + "PASSED close with CameraID :" + camerasArray[i].cameraId); console.info(TAG + " PASSED close with CameraID :" + camerasArray[i].cameraId);
} else { } else {
successFlag = false; successFlag = false;
console.info(TAG + "close FAILED: " + err.message); console.info(TAG + " close FAILED: " + err.message);
} }
}); });
await sleep(100); await sleep(100);
await cameraInput.release(async (err) => { await cameraInput.release(async (err) => {
if (!err) { if (!err) {
console.info(TAG + "PASSED release with CameraID :" + camerasArray[i].cameraId); console.info(TAG + " PASSED release with CameraID :" + camerasArray[i].cameraId);
} else { } else {
successFlag = false; successFlag = false;
console.info(TAG + "release FAILED: " + err.message); console.info(TAG + " release FAILED: " + err.message);
} }
}); });
expect(successFlag).assertEqual(true); expect(successFlag).assertEqual(true);
}).catch((err) => { }).catch((err) => {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Failed To create cameraInput cameraId: " + camerasArray[i].cameraId + +JSON.stringify(err)); console.info(TAG + " Failed To create cameraInput cameraId: " + camerasArray[i].cameraId + +JSON.stringify(err));
}); });
} }
} }
...@@ -617,24 +617,24 @@ export default function CameraInputTest(surfaceId) { ...@@ -617,24 +617,24 @@ export default function CameraInputTest(surfaceId) {
expect(isEmpty(cameraInput)).assertFalse(); expect(isEmpty(cameraInput)).assertFalse();
console.info(TAG + functionTag + "Entering cameraInput open with camera: " + camerasArray[i].cameraId); console.info(TAG + functionTag + "Entering cameraInput open with camera: " + camerasArray[i].cameraId);
await cameraInput.open().then(async () => { await cameraInput.open().then(async () => {
console.info(TAG + functionTag + "PASSED open with CameraID :" + camerasArray[i].cameraId); console.info(TAG + functionTag + " PASSED open with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => { }).catch((err) => {
successFlag = false; successFlag = false;
console.info(TAG + functionTag + "open FAILED: " + err.message); console.info(TAG + functionTag + " open FAILED: " + err.message);
});; });
await sleep(400); await sleep(400);
await cameraInput.close().then(async () => { await cameraInput.close().then(async () => {
console.info(TAG + functionTag + "PASSED close with CameraID :" + camerasArray[i].cameraId); console.info(TAG + functionTag + " PASSED close with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => { }).catch((err) => {
successFlag = false; successFlag = false;
console.info(TAG + functionTag + "close FAILED: " + err.message); console.info(TAG + functionTag + " close FAILED: " + err.message);
}); });
await sleep(100); await sleep(100);
await cameraInput.release().then(async () => { await cameraInput.release().then(async () => {
console.info(TAG + functionTag + "PASSED release with CameraID :" + camerasArray[i].cameraId); console.info(TAG + functionTag + " PASSED release with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => { }).catch((err) => {
successFlag = false; successFlag = false;
console.info(TAG + functionTag + "release FAILED: " + err.message); console.info(TAG + functionTag + " release FAILED: " + err.message);
}); });
expect(successFlag).assertEqual(true); expect(successFlag).assertEqual(true);
} else { } else {
...@@ -642,8 +642,10 @@ export default function CameraInputTest(surfaceId) { ...@@ -642,8 +642,10 @@ export default function CameraInputTest(surfaceId) {
console.info(TAG + functionTag + " FAILED: " + err.message); console.info(TAG + functionTag + " FAILED: " + err.message);
} }
}); });
await sleep(600);
} }
await sleep(400 * camerasArray.length); //await sleep(400 * camerasArray.length);
} }
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 ends here"); console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 ends here");
done(); done();
......
...@@ -22,7 +22,17 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -22,7 +22,17 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const TAG = "CameraUnitTest: "; const TAG = "CameraUnitTest: ";
let captureLocation = {
latitude: 0,
longitude: 0,
altitude: 0,
}
let captureSetting = { let captureSetting = {
quality: cameraObj.QualityLevel.QUALITY_LEVEL_LOW,
rotation: cameraObj.ImageRotation.ROTATION_0,
location: captureLocation,
mirror: false
} }
// 创建视频录制的参数 // 创建视频录制的参数
...@@ -1092,6 +1102,7 @@ export default function cameraJSUnitOutput(surfaceId: any) { ...@@ -1092,6 +1102,7 @@ export default function cameraJSUnitOutput(surfaceId: any) {
expect().assertFail(); expect().assertFail();
}); });
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.width + "x" + boundingBox.height); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.width + "x" + boundingBox.height);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.topLeftX + "x" + boundingBox.topLeftY);
} }
await sleep(1000); await sleep(1000);
done(); done();
...@@ -1478,6 +1489,13 @@ export default function cameraJSUnitOutput(surfaceId: any) { ...@@ -1478,6 +1489,13 @@ export default function cameraJSUnitOutput(surfaceId: any) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 photoOutput == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 photoOutput == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.quality = ' + captureSetting.quality);
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.rotation = ' + captureSetting.rotation);
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.location.latitude = ' + captureSetting.location.latitude);
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.location.longitude = ' + captureSetting.location.longitude);
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.location.altitude = ' + captureSetting.location.altitude);
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 captureSetting.mirror = ' + captureSetting.mirror);
await photoOutput.capture(captureSetting).then((result) => { await photoOutput.capture(captureSetting).then((result) => {
console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 success :' + result); console.info('SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CAPTURE_SETTING_PROMISE_0100 success :' + result);
}).catch((err) => { }).catch((err) => {
...@@ -1575,6 +1593,8 @@ export default function cameraJSUnitOutput(surfaceId: any) { ...@@ -1575,6 +1593,8 @@ export default function cameraJSUnitOutput(surfaceId: any) {
if (!err) { if (!err) {
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100 success"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100 success");
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100, captureId = " + data.captureId);
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100, timestamp = " + data.timestamp);
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message); console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_FRAME_SHUTTER_0100 FAILED: " + err.message);
...@@ -1608,6 +1628,8 @@ export default function cameraJSUnitOutput(surfaceId: any) { ...@@ -1608,6 +1628,8 @@ export default function cameraJSUnitOutput(surfaceId: any) {
if (!err) { if (!err) {
expect(true).assertTrue(); expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 success"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 success");
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100, captureId = " + data.captureId);
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100, frameCount = " + data.frameCount);
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 FAILED: " + err.message); console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_PHOTO_OUTPUT_CALLBACK_ON_CAPTURE_END_0100 FAILED: " + err.message);
......
...@@ -223,17 +223,14 @@ export default function cameraManagerTest(surfaceId: any) { ...@@ -223,17 +223,14 @@ export default function cameraManagerTest(surfaceId: any) {
mCameraManager.getSupportedOutputCapability(cameraDevice, async (err, data) => { mCameraManager.getSupportedOutputCapability(cameraDevice, async (err, data) => {
if (!err) { if (!err) {
if (!isEmpty(data)) { if (!isEmpty(data)) {
console.info(TAG + "Entering SupportedOutputCapability data is not null || undefined"); console.info(TAG + "getSupportedOutputCapabilityInCallback data is not null || undefined");
outputCapabilityCallback = data; outputCapabilityCallback = data;
expect(outputCapabilityCallback).assertNotNull();
} }
else { else {
console.info(TAG + "getSupportedOutputCapabilityInCallback FAILED"); console.info(TAG + "getSupportedOutputCapabilityInCallback FAILED");
expect().assertFail();
} }
} else { } else {
console.info(TAG + "getSupportedOutputCapabilityInCallback FAILED: " + err.message); console.info(TAG + "getSupportedOutputCapabilityInCallback FAILED: " + err.message);
expect().assertFail();
} }
console.info(TAG + "getSupportedOutputCapabilityInCallback ends here"); console.info(TAG + "getSupportedOutputCapabilityInCallback ends here");
}) })
...@@ -247,12 +244,19 @@ export default function cameraManagerTest(surfaceId: any) { ...@@ -247,12 +244,19 @@ export default function cameraManagerTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
return undefined; return undefined;
} }
let outputCapabilityPromise = await mCameraManager.getSupportedOutputCapability(cameraDevice);
let outputCapabilityPromise = null;
await mCameraManager.getSupportedOutputCapability(cameraDevice).then((result) => {
console.info('getSupportedOutputCapabilityInPromise success');
outputCapabilityPromise = result;
}).catch((err) => {
console.info('getSupportedOutputCapabilityInPromise failed, err = ' + err.message);
});
if (isEmpty(outputCapabilityPromise)) { if (isEmpty(outputCapabilityPromise)) {
console.info(TAG + "Entering getSupportedOutputCapabilityInPromise outputCapabilityPromise == null || undefined") console.info(TAG + "Entering getSupportedOutputCapabilityInPromise outputCapabilityPromise == null || undefined")
expect().assertFail();
} else { } else {
console.info("CameraUnitTest: Entering testSupportedOutputCapabilityPromise: " + JSON.stringify(outputCapabilityPromise)); console.info("CameraUnitTest: getSupportedOutputCapabilityInPromise: " + JSON.stringify(outputCapabilityPromise));
} }
return outputCapabilityPromise; return outputCapabilityPromise;
...@@ -505,33 +509,31 @@ describe('CameraManagerTest', function () { ...@@ -505,33 +509,31 @@ describe('CameraManagerTest', function () {
let cameraOutputCap = await getSupportedOutputCapabilityInCallback(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInCallback(camerasArray[i]);
await sleep(100); 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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 cameraOutputCap == null || undefined") let previewProfilesArray = cameraOutputCap.previewProfiles;
expect().assertFail(); if (isEmpty(previewProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 previewProfilesArray == null || undefined")
expect().assertFail();
}
let previewProfilesArray = cameraOutputCap.previewProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
if (isEmpty(previewProfilesArray)) { if (isEmpty(photoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 previewProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 photoProfilesArray == null || undefined")
expect().assertFail(); expect().assertFail();
} }
let photoProfilesArray = cameraOutputCap.photoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
if (isEmpty(photoProfilesArray)) { if (isEmpty(videoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 photoProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 videoProfilesArray == null || undefined")
expect().assertFail(); expect().assertFail();
} }
let videoProfilesArray = cameraOutputCap.videoProfiles; let metadataObjectTypesArray = cameraOutputCap.supportedMetadataObjectTypes;
if (isEmpty(videoProfilesArray)) { if (isEmpty(metadataObjectTypesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 videoProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 metadataObjectTypesArray == null || undefined")
expect().assertFail(); }
} }
let metadataObjectTypesArray = cameraOutputCap.supportedMetadataObjectTypes;
if (isEmpty(metadataObjectTypesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100 metadataObjectTypesArray == null || undefined")
}
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");
...@@ -552,34 +554,33 @@ describe('CameraManagerTest', function () { ...@@ -552,34 +554,33 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < mCameraDevicesArray.length; i++) { for (let i = 0; i < mCameraDevicesArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(mCameraDevicesArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 cameraOutputCap == null || undefined") let previewProfilesArray = cameraOutputCap.previewProfiles;
expect().assertFail(); if (isEmpty(previewProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 previewProfilesArray == null || undefined")
expect().assertFail();
}
let previewProfilesArray = cameraOutputCap.previewProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
if (isEmpty(previewProfilesArray)) { if (isEmpty(photoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 previewProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 photoProfilesArray == null || undefined")
expect().assertFail(); expect().assertFail();
} }
let photoProfilesArray = cameraOutputCap.photoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
if (isEmpty(photoProfilesArray)) { if (isEmpty(videoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 photoProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 videoProfilesArray == null || undefined")
expect().assertFail(); expect().assertFail();
} }
expect(isEmpty(videoProfilesArray)).assertFalse();
let videoProfilesArray = cameraOutputCap.videoProfiles; let metadataObjectTypesArray = cameraOutputCap.supportedMetadataObjectTypes;
if (isEmpty(videoProfilesArray)) { if (isEmpty(metadataObjectTypesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 videoProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 metadataObjectTypesArray == null || undefined")
expect().assertFail(); }
} }
expect(isEmpty(videoProfilesArray)).assertFalse();
let metadataObjectTypesArray = cameraOutputCap.supportedMetadataObjectTypes;
if (isEmpty(metadataObjectTypesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 metadataObjectTypesArray == null || undefined")
}
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");
...@@ -601,25 +602,23 @@ describe('CameraManagerTest', function () { ...@@ -601,25 +602,23 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 cameraOutputCap == null || undefined") let previewProfilesArray = cameraOutputCap.previewProfiles;
expect().assertFail(); if (isEmpty(previewProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 previewProfilesArray == null || undefined")
expect().assertFail();
}
let previewProfilesArray = cameraOutputCap.previewProfiles; for (let i = 0; i < previewProfilesArray.length; i++) {
if (isEmpty(previewProfilesArray)) { let previewProfilesFormat = previewProfilesArray[i].format;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 previewProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 previewProfilesFormat: " + previewProfilesFormat);
expect().assertFail(); let previewProfilesSize = previewProfilesArray[i].size;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 width: " + previewProfilesSize.width);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 height: " + previewProfilesSize.height);
}
expect(true).assertTrue();
} }
for (let i = 0; i < previewProfilesArray.length; i++) {
let previewProfilesFormat = previewProfilesArray[i].format;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 previewProfilesFormat: " + previewProfilesFormat);
let previewProfilesSize = previewProfilesArray[i].size;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 width: " + previewProfilesSize.width);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 height: " + previewProfilesSize.height);
}
expect(true).assertTrue();
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); await sleep(1000);
...@@ -640,25 +639,23 @@ describe('CameraManagerTest', function () { ...@@ -640,25 +639,23 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 cameraOutputCap == null || undefined") let photoProfilesArray = cameraOutputCap.photoProfiles;
expect().assertFail(); if (isEmpty(cameraOutputCap)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 photoProfilesArray == null || undefined")
expect().assertFail();
}
let photoProfilesArray = cameraOutputCap.photoProfiles; for (let i = 0; i < photoProfilesArray.length; i++) {
if (isEmpty(cameraOutputCap)) { let photoProfilesFormat = photoProfilesArray[i].format;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 photoProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 photoProfilesFormat: " + photoProfilesFormat);
expect().assertFail(); let photoProfilesSize = photoProfilesArray[i].size;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 width: " + photoProfilesSize.width);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 height: " + photoProfilesSize.height);
}
expect(true).assertTrue();
} }
for (let i = 0; i < photoProfilesArray.length; i++) {
let photoProfilesFormat = photoProfilesArray[i].format;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 photoProfilesFormat: " + photoProfilesFormat);
let photoProfilesSize = photoProfilesArray[i].size;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 width: " + photoProfilesSize.width);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 height: " + photoProfilesSize.height);
}
expect(true).assertTrue();
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); await sleep(1000);
...@@ -679,28 +676,26 @@ describe('CameraManagerTest', function () { ...@@ -679,28 +676,26 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 cameraOutputCap == null || undefined") let videoProfilesArray = cameraOutputCap.videoProfiles;
expect().assertFail(); if (isEmpty(videoProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 videoProfilesArray == null || undefined")
expect().assertFail();
}
let videoProfilesArray = cameraOutputCap.videoProfiles; for (let i = 0; i < videoProfilesArray.length; i++) {
if (isEmpty(videoProfilesArray)) { let videoProfilesFormat = videoProfilesArray[i].format;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 videoProfilesArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 videoProfilesFormat: " + videoProfilesFormat);
expect().assertFail(); let videoProfilesSize = videoProfilesArray[i].size;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 width: " + videoProfilesSize.width);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 height: " + videoProfilesSize.height);
let videoProfilesFrameRateRange = videoProfilesArray[i].frameRateRange;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 min: " + videoProfilesFrameRateRange.min);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 max: " + videoProfilesFrameRateRange.max);
}
expect(true).assertTrue();
} }
for (let i = 0; i < videoProfilesArray.length; i++) {
let videoProfilesFormat = videoProfilesArray[i].format;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 videoProfilesFormat: " + videoProfilesFormat);
let videoProfilesSize = videoProfilesArray[i].size;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 width: " + videoProfilesSize.width);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 height: " + videoProfilesSize.height);
let videoProfilesFrameRateRange = videoProfilesArray[i].frameRateRange;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 min: " + videoProfilesFrameRateRange.min);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 max: " + videoProfilesFrameRateRange.max);
}
expect(true).assertTrue();
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); await sleep(1000);
...@@ -852,21 +847,24 @@ describe('CameraManagerTest', function () { ...@@ -852,21 +847,24 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId);
expect(isEmpty(cameraOutputCap)).assertFalse();
let previewProfilesArray = cameraOutputCap.previewProfiles; if (!isEmpty(cameraOutputCap)) {
if (isEmpty(previewProfilesArray)) { let previewProfilesArray = cameraOutputCap.previewProfiles;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined") if (isEmpty(previewProfilesArray)) {
expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 previewProfilesArray == null || undefined")
} expect().assertFail();
for (let j = 0; j < previewProfilesArray.length; j++) { } else {
mCameraManager.createPreviewOutput(previewProfilesArray[j], surfaceId, async (err, data) => { for (let j = 0; j < previewProfilesArray.length; j++) {
if (isEmpty(data)) { mCameraManager.createPreviewOutput(previewProfilesArray[j], surfaceId, async (err, data) => {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 data == null || undefined") if (isEmpty(data)) {
expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 data == null || undefined")
} expect().assertFail();
}) }
await sleep(100); })
await sleep(100);
}
}
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_CALLBACK_0100 PASS");
...@@ -888,24 +886,24 @@ describe('CameraManagerTest', function () { ...@@ -888,24 +886,24 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 cameraOutputCap == null || undefined") let previewProfilesArray = cameraOutputCap.previewProfiles;
expect().assertFail(); if (isEmpty(previewProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewProfilesArray == null || undefined")
let previewProfilesArray = cameraOutputCap.previewProfiles;
if (isEmpty(previewProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewProfilesArray == null || undefined")
expect().assertFail();
}
for (let j = 0; j < previewProfilesArray.length; j++) {
let previewOutputPromise = await mCameraManager.createPreviewOutput(previewProfilesArray[j], surfaceId);
if (isEmpty(previewOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} } else {
await sleep(100); for (let j = 0; j < previewProfilesArray.length; j++) {
} let previewOutputPromise = await mCameraManager.createPreviewOutput(previewProfilesArray[j], surfaceId);
if (isEmpty(previewOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 previewOutputPromise == null || undefined")
expect().assertFail();
}
await sleep(100);
}
}
}
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 PASS");
await sleep(1000); await sleep(1000);
...@@ -926,25 +924,24 @@ describe('CameraManagerTest', function () { ...@@ -926,25 +924,24 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId);
if (isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 cameraOutputCap == null || undefined") let photoProfilesArray = cameraOutputCap.photoProfiles;
expect().assertFail(); if (isEmpty(photoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 photoProfilesArray == null || undefined")
expect().assertFail();
} else {
for (let j = 0; j < photoProfilesArray.length; j++) {
mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface, async (err, data) => {
if (isEmpty(data)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 data == null || undefined")
expect().assertFail();
}
})
await sleep(100);
}
}
} }
let photoProfilesArray = cameraOutputCap.photoProfiles;
if (isEmpty(photoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 photoProfilesArray == null || undefined")
expect().assertFail();
}
for (let j = 0; j < photoProfilesArray.length; j++) {
mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface, async (err, data) => {
if (isEmpty(data)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 data == null || undefined")
expect().assertFail();
}
})
await sleep(100);
}
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_CALLBACK_0100 PASS");
await sleep(1000); await sleep(1000);
...@@ -965,24 +962,23 @@ describe('CameraManagerTest', function () { ...@@ -965,24 +962,23 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 cameraOutputCap == null || undefined") let photoProfilesArray = cameraOutputCap.photoProfiles;
expect().assertFail(); if (isEmpty(photoProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoProfilesArray == null || undefined")
let photoProfilesArray = cameraOutputCap.photoProfiles;
if (isEmpty(photoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoProfilesArray == null || undefined")
expect().assertFail();
}
for (let j = 0; j < photoProfilesArray.length; j++) {
let photoOutputPromise = await mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface);
if (isEmpty(photoOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} } else {
await sleep(100); for (let j = 0; j < photoProfilesArray.length; j++) {
} let photoOutputPromise = await mCameraManager.createPhotoOutput(photoProfilesArray[j], mPhotoSurface);
if (isEmpty(photoOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 photoOutputPromise == null || undefined")
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); await sleep(1000);
...@@ -1004,38 +1000,35 @@ describe('CameraManagerTest', function () { ...@@ -1004,38 +1000,35 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId);
if (isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 cameraOutputCap == null || undefined") let videoProfilesArray = cameraOutputCap.videoProfiles;
expect().assertFail(); if (isEmpty(videoProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoProfilesArray == null || undefined")
expect().assertFail();
let videoProfilesArray = cameraOutputCap.videoProfiles; } else {
if (isEmpty(videoProfilesArray)) { createVideoOutputFlag = false;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoProfilesArray == null || undefined") for (let j = 0; j < videoProfilesArray.length; j++) {
expect().assertFail(); mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface, async (err, data) => {
} if (!err) {
if (isEmpty(data)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data == null || undefined");
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data = " + data);
createVideoOutputFlag = true;
}
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 failed, err = " + err.message);
expect().assertFail();
}
})
await sleep(100);
createVideoOutputFlag = false; if (createVideoOutputFlag == true) {
for (let j = 0; j < videoProfilesArray.length; j++) { break;
mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface, async (err, data) => {
if (!err) {
if (isEmpty(data)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data == null || undefined");
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 data = " + data);
createVideoOutputFlag = true;
} }
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 failed, err = " + err.message);
expect().assertFail();
} }
})
await sleep(100);
if (createVideoOutputFlag == true) {
break;
} }
} }
} }
...@@ -1058,26 +1051,25 @@ describe('CameraManagerTest', function () { ...@@ -1058,26 +1051,25 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 cameraOutputCap == null || undefined") let videoProfilesArray = cameraOutputCap.videoProfiles;
expect().assertFail(); if (isEmpty(videoProfilesArray)) {
} console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoProfilesArray == null || undefined")
let videoProfilesArray = cameraOutputCap.videoProfiles;
if (isEmpty(videoProfilesArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoProfilesArray == null || undefined")
expect().assertFail();
}
for (let j = 0; j < videoProfilesArray.length; j++) {
let videoOutputPromise = await mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface);
if (isEmpty(videoOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoOutputPromise == null || undefined")
expect().assertFail(); expect().assertFail();
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoOutputPromise = " + videoOutputPromise); for (let j = 0; j < videoProfilesArray.length; j++) {
break; let videoOutputPromise = await mCameraManager.createVideoOutput(videoProfilesArray[j], mVideoSurface);
if (isEmpty(videoOutputPromise)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 videoOutputPromise == null || undefined")
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_CALLBACK_0100 videoOutputPromise = " + videoOutputPromise);
break;
}
await sleep(100);
}
} }
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");
...@@ -1099,32 +1091,29 @@ describe('CameraManagerTest', function () { ...@@ -1099,32 +1091,29 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId);
if (isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 cameraOutputCap == null || undefined") let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes;
expect().assertFail(); if (!isEmpty(metadataObjectTypeArray)) {
} mCameraManager.createMetadataOutput(metadataObjectTypeArray, async (err, data) => {
if (!err) {
let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; if (isEmpty(data)) {
if (!isEmpty(metadataObjectTypeArray)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data == null || undefined")
mCameraManager.createMetadataOutput(metadataObjectTypeArray, async (err, data) => { expect().assertFail();
if (!err) { } else {
if (isEmpty(data)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data = " + data)
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data == null || undefined") }
expect().assertFail();
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data = " + data) console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 err = " + err.message)
expect().assertFail();
} }
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 err = " + err.message) })
expect().assertFail(); await sleep(100);
} } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 metadataObjectTypeArray == null || undefined")
}) }
await sleep(100); await sleep(300);
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 metadataObjectTypeArray == null || undefined")
} }
await sleep(1000);
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 PASS");
await sleep(1000); await sleep(1000);
...@@ -1145,25 +1134,21 @@ describe('CameraManagerTest', function () { ...@@ -1145,25 +1134,21 @@ describe('CameraManagerTest', function () {
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapabilityInPromise(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)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 cameraOutputCap == null || undefined") let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes;
expect().assertFail(); if (!isEmpty(metadataObjectTypeArray)) {
} let metadataOutputPromise = await mCameraManager.createMetadataOutput(metadataObjectTypeArray);
if (isEmpty(metadataOutputPromise)) {
let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 metadataOutputPromise == null || undefined")
if (!isEmpty(metadataObjectTypeArray)) { expect().assertFail();
let metadataOutputPromise = await mCameraManager.createMetadataOutput(metadataObjectTypeArray); } else {
if (isEmpty(metadataOutputPromise)) { 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 == null || undefined") }
expect().assertFail(); await sleep(100);
} 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 metadataObjectTypeArray == null || undefined")
} }
await sleep(100);
} 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 PASS"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 PASS");
await sleep(1000); await sleep(1000);
...@@ -1194,9 +1179,9 @@ describe('CameraManagerTest', function () { ...@@ -1194,9 +1179,9 @@ describe('CameraManagerTest', function () {
} else { } else {
expect().assertFail(); expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : " + err.message);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here");
} }
await sleep(1000); await sleep(300);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_MANAGER_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here");
}) })
await sleep(1000); await sleep(1000);
await cameraSession.release(); await cameraSession.release();
......
...@@ -392,61 +392,71 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -392,61 +392,71 @@ export default function cameraSessionTest(surfaceId: any) {
async function createOutput(idx:any) { async function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); let cameraOutputCap = null;
if (!isEmpty(cameraOutputCap.previewProfiles)) { await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info('getSupportedOutputCapability success');
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { cameraOutputCap = result;
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); }).catch((err) => {
if (!isEmpty(mPreviewOutput)) { console.info('getSupportedOutputCapability failed, err = ' + err.message);
break; });
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId);
if (!isEmpty(mPreviewOutput)) {
break;
}
} }
}
if (isEmpty(mPreviewOutput)) {
if (isEmpty(mPreviewOutput)) { console.info(TAG + "createPreviewOutput FAILED");
console.info(TAG + "createPreviewOutput FAILED");
}
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
} }
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
} }
if (isEmpty(mPhotoOutput)) { if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "createPhotoOutput FAILED"); console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
}
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
console.info(TAG + "createPhotoOutput: " + mPhotoOutput); mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
} if (!isEmpty(mPhotoOutput)) {
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break; break;
} }
} }
catch {
console.info(TAG + "createVideoOutput FAILED"); if (isEmpty(mPhotoOutput)) {
console.info(TAG + "createPhotoOutput FAILED");
} }
console.info(TAG + "createPhotoOutput: " + mPhotoOutput);
} }
/*
if (isEmpty(mVideoOutput)) { if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "createVideoOutput FAILED"); console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info('Exit createOutputs'); console.info('Exit createOutputs');
return true; return true;
...@@ -518,7 +528,7 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -518,7 +528,7 @@ export default function cameraSessionTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
console.info(TAG + "Exit startCameraSession"); console.info(TAG + "Exit startCameraSession");
...@@ -537,7 +547,7 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -537,7 +547,7 @@ export default function cameraSessionTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
...@@ -1553,7 +1563,7 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -1553,7 +1563,7 @@ export default function cameraSessionTest(surfaceId: any) {
await commitCameraSessionConfig(); await commitCameraSessionConfig();
await sleep(1000); await sleep(100);
await beginCameraSessionConfig(); await beginCameraSessionConfig();
...@@ -1561,7 +1571,7 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -1561,7 +1571,7 @@ export default function cameraSessionTest(surfaceId: any) {
await commitCameraSessionConfig(); await commitCameraSessionConfig();
await sleep(1000); await sleep(100);
if (nfyFlag == false) { if (nfyFlag == false) {
//expect().assertFail(); //expect().assertFail();
...@@ -1616,14 +1626,17 @@ export default function cameraSessionTest(surfaceId: any) { ...@@ -1616,14 +1626,17 @@ export default function cameraSessionTest(surfaceId: any) {
} }
await sleep(1); await sleep(1);
}) })
await mCameraSession.start();
await sleep(3000); await sleep(400);
if (nfyFlag == false) { if (nfyFlag == false) {
//expect().assertFail(); //expect().assertFail();
//console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!"); //console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!");
} }
await mCameraSession.stop();
await beginCameraSessionConfig(); await beginCameraSessionConfig();
await stopCameraSession(); await stopCameraSession();
......
...@@ -452,61 +452,71 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -452,61 +452,71 @@ export default function cameraSessionExposureTest(surfaceId: any) {
async function createOutput(idx:any) { async function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); let cameraOutputCap = null;
if (!isEmpty(cameraOutputCap.previewProfiles)) { await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info('getSupportedOutputCapability success');
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { cameraOutputCap = result;
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); }).catch((err) => {
if (!isEmpty(mPreviewOutput)) { console.info('getSupportedOutputCapability failed, err = ' + err.message);
break; });
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId);
if (!isEmpty(mPreviewOutput)) {
break;
}
} }
}
if (isEmpty(mPreviewOutput)) {
if (isEmpty(mPreviewOutput)) { console.info(TAG + "createPreviewOutput FAILED");
console.info(TAG + "createPreviewOutput FAILED");
}
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
} }
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
} }
if (isEmpty(mPhotoOutput)) { if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "createPhotoOutput FAILED"); console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
}
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
console.info(TAG + "createPhotoOutput: " + mPhotoOutput); mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
} if (!isEmpty(mPhotoOutput)) {
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break; break;
} }
} }
catch {
console.info(TAG + "createVideoOutput FAILED"); if (isEmpty(mPhotoOutput)) {
console.info(TAG + "createPhotoOutput FAILED");
} }
console.info(TAG + "createPhotoOutput: " + mPhotoOutput);
} }
/*
if (isEmpty(mVideoOutput)) { if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "createVideoOutput FAILED"); console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info('Exit createOutputs'); console.info('Exit createOutputs');
return true; return true;
...@@ -577,7 +587,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -577,7 +587,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
console.info(TAG + "Exit startCameraSession"); console.info(TAG + "Exit startCameraSession");
...@@ -596,7 +606,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -596,7 +606,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
...@@ -698,7 +708,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -698,7 +708,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -740,7 +750,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -740,7 +750,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -902,7 +912,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -902,7 +912,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -944,7 +954,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -944,7 +954,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1106,7 +1116,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -1106,7 +1116,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1148,7 +1158,7 @@ export default function cameraSessionExposureTest(surfaceId: any) { ...@@ -1148,7 +1158,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
......
...@@ -403,61 +403,71 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -403,61 +403,71 @@ export default function cameraSessionFlashTest(surfaceId: any) {
async function createOutput(idx:any) { async function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); let cameraOutputCap = null;
if (!isEmpty(cameraOutputCap.previewProfiles)) { await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info('getSupportedOutputCapability success');
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { cameraOutputCap = result;
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); }).catch((err) => {
if (!isEmpty(mPreviewOutput)) { console.info('getSupportedOutputCapability failed, err = ' + err.message);
break; });
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId);
if (!isEmpty(mPreviewOutput)) {
break;
}
} }
}
if (isEmpty(mPreviewOutput)) {
if (isEmpty(mPreviewOutput)) { console.info(TAG + "createPreviewOutput FAILED");
console.info(TAG + "createPreviewOutput FAILED");
}
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
} }
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
} }
if (isEmpty(mPhotoOutput)) { if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "createPhotoOutput FAILED"); console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
}
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
console.info(TAG + "createPhotoOutput: " + mPhotoOutput); mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
} if (!isEmpty(mPhotoOutput)) {
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break; break;
} }
} }
catch {
console.info(TAG + "createVideoOutput FAILED"); if (isEmpty(mPhotoOutput)) {
console.info(TAG + "createPhotoOutput FAILED");
} }
console.info(TAG + "createPhotoOutput: " + mPhotoOutput);
} }
/*
if (isEmpty(mVideoOutput)) { if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "createVideoOutput FAILED"); console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info('Exit createOutputs'); console.info('Exit createOutputs');
return true; return true;
...@@ -528,7 +538,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -528,7 +538,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
console.info(TAG + "Exit startCameraSession"); console.info(TAG + "Exit startCameraSession");
...@@ -547,7 +557,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -547,7 +557,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
...@@ -649,7 +659,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -649,7 +659,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -691,7 +701,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -691,7 +701,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 FAILED with hasFlash is: " + hasFlashPromise); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_HAS_FLASH_PROMISE_0100 FAILED with hasFlash is: " + hasFlashPromise);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -742,7 +752,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -742,7 +752,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0100 not support");
} }
...@@ -788,7 +798,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -788,7 +798,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0100 not support");
} }
...@@ -955,7 +965,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -955,7 +965,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0101 not support");
} }
...@@ -1001,7 +1011,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -1001,7 +1011,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0101 not support");
} }
...@@ -1167,7 +1177,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -1167,7 +1177,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0102 not support");
} }
...@@ -1213,7 +1223,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -1213,7 +1223,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0102 not support");
} }
...@@ -1379,7 +1389,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -1379,7 +1389,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_CALLBACK_0103 not support");
} }
...@@ -1425,7 +1435,7 @@ export default function cameraSessionFlashTest(surfaceId: any) { ...@@ -1425,7 +1435,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_FLASH_MODE_SUPPORT_PROMISE_0103 not support");
} }
......
...@@ -448,61 +448,71 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -448,61 +448,71 @@ export default function cameraSessionFocusTest(surfaceId: any) {
async function createOutput(idx:any) { async function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); let cameraOutputCap = null;
if (!isEmpty(cameraOutputCap.previewProfiles)) { await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info('getSupportedOutputCapability success');
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { cameraOutputCap = result;
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); }).catch((err) => {
if (!isEmpty(mPreviewOutput)) { console.info('getSupportedOutputCapability failed, err = ' + err.message);
break; });
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId);
if (!isEmpty(mPreviewOutput)) {
break;
}
} }
}
if (isEmpty(mPreviewOutput)) {
if (isEmpty(mPreviewOutput)) { console.info(TAG + "createPreviewOutput FAILED");
console.info(TAG + "createPreviewOutput FAILED");
}
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
} }
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
} }
if (isEmpty(mPhotoOutput)) { if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "createPhotoOutput FAILED"); console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
}
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
console.info(TAG + "createPhotoOutput: " + mPhotoOutput); mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
} if (!isEmpty(mPhotoOutput)) {
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break; break;
} }
} }
catch {
console.info(TAG + "createVideoOutput FAILED"); if (isEmpty(mPhotoOutput)) {
console.info(TAG + "createPhotoOutput FAILED");
} }
console.info(TAG + "createPhotoOutput: " + mPhotoOutput);
} }
/*
if (isEmpty(mVideoOutput)) { if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "createVideoOutput FAILED"); console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info('Exit createOutputs'); console.info('Exit createOutputs');
return true; return true;
...@@ -573,7 +583,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -573,7 +583,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
console.info(TAG + "Exit startCameraSession"); console.info(TAG + "Exit startCameraSession");
...@@ -592,7 +602,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -592,7 +602,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
...@@ -694,7 +704,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -694,7 +704,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -736,7 +746,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -736,7 +746,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -898,7 +908,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -898,7 +908,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -940,7 +950,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -940,7 +950,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1102,7 +1112,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -1102,7 +1112,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1144,7 +1154,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -1144,7 +1154,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1306,7 +1316,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -1306,7 +1316,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1348,7 +1358,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -1348,7 +1358,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1457,7 +1467,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -1457,7 +1467,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with FocusMode is: " + focusMode); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 FAILED with FocusMode is: " + focusMode);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 not support"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_SET_GET_FOCUS_MODE_PROMISE_0103 not support");
} }
...@@ -2438,7 +2448,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -2438,7 +2448,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -2475,7 +2485,7 @@ export default function cameraSessionFocusTest(surfaceId: any) { ...@@ -2475,7 +2485,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 finish");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 PASSED with FocalLength is: " + focalLength); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 PASSED with FocalLength is: " + focalLength);
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
......
...@@ -401,61 +401,71 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -401,61 +401,71 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
async function createOutput(idx:any) { async function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); let cameraOutputCap = null;
if (!isEmpty(cameraOutputCap.previewProfiles)) { await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info('getSupportedOutputCapability success');
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { cameraOutputCap = result;
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); }).catch((err) => {
if (!isEmpty(mPreviewOutput)) { console.info('getSupportedOutputCapability failed, err = ' + err.message);
break; });
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId);
if (!isEmpty(mPreviewOutput)) {
break;
}
} }
}
if (isEmpty(mPreviewOutput)) {
if (isEmpty(mPreviewOutput)) { console.info(TAG + "createPreviewOutput FAILED");
console.info(TAG + "createPreviewOutput FAILED");
}
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
} }
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
} }
if (isEmpty(mPhotoOutput)) { if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "createPhotoOutput FAILED"); console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
}
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
console.info(TAG + "createPhotoOutput: " + mPhotoOutput); mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
} if (!isEmpty(mPhotoOutput)) {
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break; break;
} }
} }
catch {
console.info(TAG + "createVideoOutput FAILED"); if (isEmpty(mPhotoOutput)) {
console.info(TAG + "createPhotoOutput FAILED");
} }
console.info(TAG + "createPhotoOutput: " + mPhotoOutput);
} }
/*
if (isEmpty(mVideoOutput)) { if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "createVideoOutput FAILED"); console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info('Exit createOutputs'); console.info('Exit createOutputs');
return true; return true;
...@@ -526,7 +536,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -526,7 +536,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
console.info(TAG + "Exit startCameraSession"); console.info(TAG + "Exit startCameraSession");
...@@ -545,7 +555,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -545,7 +555,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
...@@ -637,12 +647,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -637,12 +647,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
if (!err) { if (!err) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
mIsVideoStabilizationModeSupportedArray[i] = data; mIsVideoStabilizationModeSupportedArray[i] = data;
if ((deviceInfo.deviceType != 'default') && (data == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 PASSED with isVideoStabilizationModeSupported is: " + data);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 PASSED with isVideoStabilizationModeSupported is: " + data);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 FAILED with isVideoStabilizationModeSupported is: " + data); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0100 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail(); expect().assertFail();
...@@ -652,7 +657,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -652,7 +657,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -688,18 +693,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -688,18 +693,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.OFF);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 finish");
if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) {
if ((deviceInfo.deviceType != 'default') && (isVideoStabilizationModeSupported == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0100 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -851,12 +851,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -851,12 +851,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
if (!err) { if (!err) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
mIsVideoStabilizationModeSupportedArray[i] = data; mIsVideoStabilizationModeSupportedArray[i] = data;
if ((deviceInfo.deviceType != 'default') && (data == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 PASSED with isVideoStabilizationModeSupported is: " + data);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 PASSED with isVideoStabilizationModeSupported is: " + data);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with isVideoStabilizationModeSupported is: " + data); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0101 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail(); expect().assertFail();
...@@ -866,7 +861,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -866,7 +861,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -902,18 +897,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -902,18 +897,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.LOW);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 finish");
if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) {
if ((deviceInfo.deviceType != 'default') && (isVideoStabilizationModeSupported == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0101 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1065,12 +1055,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1065,12 +1055,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
if (!err) { if (!err) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
mIsVideoStabilizationModeSupportedArray[i] = data; mIsVideoStabilizationModeSupportedArray[i] = data;
if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (data == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 PASSED with isVideoStabilizationModeSupported is: " + data);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 PASSED with isVideoStabilizationModeSupported is: " + data);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with isVideoStabilizationModeSupported is: " + data); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0102 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail(); expect().assertFail();
...@@ -1080,7 +1065,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1080,7 +1065,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1116,18 +1101,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1116,18 +1101,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.MIDDLE);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 finish");
if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) {
if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (isVideoStabilizationModeSupported == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0102 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1279,12 +1259,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1279,12 +1259,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
if (!err) { if (!err) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
mIsVideoStabilizationModeSupportedArray[i] = data; mIsVideoStabilizationModeSupportedArray[i] = data;
if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (data == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 PASSED with isVideoStabilizationModeSupported is: " + data);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 PASSED with isVideoStabilizationModeSupported is: " + data);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with isVideoStabilizationModeSupported is: " + data); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0103 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail(); expect().assertFail();
...@@ -1294,7 +1269,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1294,7 +1269,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1330,18 +1305,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1330,18 +1305,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.HIGH);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 finish");
if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) {
if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (isVideoStabilizationModeSupported == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0103 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1493,12 +1463,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1493,12 +1463,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
if (!err) { if (!err) {
if (data != null || data != undefined) { if (data != null || data != undefined) {
mIsVideoStabilizationModeSupportedArray[i] = data; mIsVideoStabilizationModeSupportedArray[i] = data;
if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (data == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 PASSED with isVideoStabilizationModeSupported is: " + data);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 PASSED with isVideoStabilizationModeSupported is: " + data);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with isVideoStabilizationModeSupported is: " + data); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_CALLBACK_0104 FAILED with isVideoStabilizationModeSupported is: " + data);
expect().assertFail(); expect().assertFail();
...@@ -1508,7 +1473,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1508,7 +1473,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
expect().assertFail(); expect().assertFail();
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -1544,18 +1509,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) { ...@@ -1544,18 +1509,13 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO); let isVideoStabilizationModeSupported = await mCameraSession.isVideoStabilizationModeSupported(cameraObj.VideoStabilizationMode.AUTO);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 finish"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 finish");
if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) { if (isVideoStabilizationModeSupported != null || isVideoStabilizationModeSupported != undefined) {
if ((deviceInfo.deviceType != 'default' && deviceInfo.deviceType != 'tablet') && (isVideoStabilizationModeSupported == false)) { console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 PASSED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
}
} else { } else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_VIDEO_STABILIZATION_MODE_SUPPORT_PROMISE_0104 FAILED with isVideoStabilizationModeSupported is: " + isVideoStabilizationModeSupported);
expect().assertFail(); expect().assertFail();
} }
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
......
...@@ -405,61 +405,71 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -405,61 +405,71 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
async function createOutput(idx:any) { async function createOutput(idx:any) {
console.info('Enter createOutput'); console.info('Enter createOutput');
let cameraOutputCap = await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]); let cameraOutputCap = null;
if (!isEmpty(cameraOutputCap.previewProfiles)) { await mCameraManager.getSupportedOutputCapability(mCameraDevicesArray[idx]).then((result) => {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length); console.info('getSupportedOutputCapability success');
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) { cameraOutputCap = result;
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId); }).catch((err) => {
if (!isEmpty(mPreviewOutput)) { console.info('getSupportedOutputCapability failed, err = ' + err.message);
break; });
if (!isEmpty(cameraOutputCap)) {
if (!isEmpty(cameraOutputCap.previewProfiles)) {
console.info(TAG + "cameraOutputCap.previewProfiles.length: " + cameraOutputCap.previewProfiles.length);
for (let i = 0; i < cameraOutputCap.previewProfiles.length; i++) {
mPreviewOutput = await mCameraManager.createPreviewOutput(cameraOutputCap.previewProfiles[i], surfaceId);
if (!isEmpty(mPreviewOutput)) {
break;
}
} }
}
if (isEmpty(mPreviewOutput)) {
if (isEmpty(mPreviewOutput)) { console.info(TAG + "createPreviewOutput FAILED");
console.info(TAG + "createPreviewOutput FAILED");
}
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
}
if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
if (!isEmpty(mPhotoOutput)) {
break;
} }
console.info(TAG + "createPreviewOutput: " + mPreviewOutput);
} }
if (isEmpty(mPhotoOutput)) { if (!isEmpty(cameraOutputCap.photoProfiles)) {
console.info(TAG + "createPhotoOutput FAILED"); console.info(TAG + "cameraOutputCap.photoProfiles.length: " + cameraOutputCap.photoProfiles.length);
}
for (let i = 0; i < cameraOutputCap.photoProfiles.length; i++) {
console.info(TAG + "createPhotoOutput: " + mPhotoOutput); mPhotoOutput = await mCameraManager.createPhotoOutput(cameraOutputCap.photoProfiles[i], mPhotoSurface);
} if (!isEmpty(mPhotoOutput)) {
/*
if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break; break;
} }
} }
catch {
console.info(TAG + "createVideoOutput FAILED"); if (isEmpty(mPhotoOutput)) {
console.info(TAG + "createPhotoOutput FAILED");
} }
console.info(TAG + "createPhotoOutput: " + mPhotoOutput);
} }
/*
if (isEmpty(mVideoOutput)) { if (!isEmpty(cameraOutputCap.videoProfiles)) {
console.info(TAG + "createVideoOutput FAILED"); console.info(TAG + "cameraOutputCap.videoProfiles.length: " + cameraOutputCap.videoProfiles.length);
for (let i = 0; i < cameraOutputCap.videoProfiles.length; i++) {
try {
mVideoOutput = await mCameraManager.createVideoOutput(cameraOutputCap.videoProfiles[i], mVideoSurface);
if (!isEmpty(mVideoOutput)) {
break;
}
}
catch {
console.info(TAG + "createVideoOutput FAILED");
}
}
if (isEmpty(mVideoOutput)) {
console.info(TAG + "createVideoOutput FAILED");
}
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info(TAG + "createVideoOutput: " + mVideoOutput);
} }
*/
console.info('Exit createOutputs'); console.info('Exit createOutputs');
return true; return true;
...@@ -530,7 +540,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -530,7 +540,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
console.info(TAG + "Exit startCameraSession"); console.info(TAG + "Exit startCameraSession");
...@@ -549,7 +559,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -549,7 +559,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
} }
}) })
await sleep(1000); await sleep(100);
*/ */
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
...@@ -662,7 +672,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -662,7 +672,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED : " + err.message); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_CALLBACK_0100 PASSED : " + err.message);
} }
}) })
await sleep(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
...@@ -713,7 +723,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) { ...@@ -713,7 +723,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
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(1000); await sleep(100);
await stopCameraSession(); await stopCameraSession();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册