提交 f92fcbff 编写于 作者: M mali

sync supplement

Signed-off-by: Nmali <mali81@huawei.com>
上级 1ee89b24
...@@ -214,7 +214,6 @@ export default function CameraInputTest() { ...@@ -214,7 +214,6 @@ export default function CameraInputTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
...@@ -393,17 +392,17 @@ export default function CameraInputTest() { ...@@ -393,17 +392,17 @@ export default function CameraInputTest() {
}); });
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100
* @tc.name : open/close/release Camera with cameraInput callback api * @tc.name : open/close Camera with cameraInput callback api
* @tc.desc : open/close/release Camera with cameraInput callback api * @tc.desc : open/close Camera with cameraInput callback api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100', 0, async function (done) { it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100--------------");
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 cameraManager == null || undefined"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 cameraManager == null || undefined");
expect().assertFail(); expect().assertFail();
} else { } else {
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
...@@ -415,10 +414,10 @@ export default function CameraInputTest() { ...@@ -415,10 +414,10 @@ export default function CameraInputTest() {
await cameraInput.open(async (err) => { await cameraInput.open(async (err) => {
if (!err) { if (!err) {
successFlag = true; successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED open with CameraID :" + camerasArray[i].cameraId); console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 PASSED open with CameraID :" + camerasArray[i].cameraId);
} else { } else {
successFlag = false; successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 open FAILED: " + err.message); console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 open FAILED: " + err.message);
} }
}); });
await sleep(400); await sleep(400);
...@@ -426,79 +425,59 @@ export default function CameraInputTest() { ...@@ -426,79 +425,59 @@ export default function CameraInputTest() {
await cameraInput.close(async (err) => { await cameraInput.close(async (err) => {
if (!err) { if (!err) {
successFlag = true; successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED close with CameraID :" + camerasArray[i].cameraId); console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 PASSED close with CameraID :" + camerasArray[i].cameraId);
} else { } else {
successFlag = false; successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 close FAILED: " + err.message); console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 close FAILED: " + err.message);
}
});
await sleep(100);
successFlag = false;
await cameraInput.release(async (err) => {
if (!err) {
successFlag = true;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 PASSED release with CameraID :" + camerasArray[i].cameraId);
} else {
successFlag = false;
console.info(TAG + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 release FAILED: " + err.message);
} }
}); });
await sleep(100); await sleep(100);
expect(successFlag).assertEqual(true); expect(successFlag).assertEqual(true);
} }
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_CALLBACK_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_CALLBACK_0100 ends here");
await sleep(1000); await sleep(1000);
done(); done();
}); });
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100
* @tc.name : open/close/release Camera with cameraInput promise api * @tc.name : open/close Camera with cameraInput promise api
* @tc.desc : open/close/release Camera with cameraInput promise api * @tc.desc : open/close Camera with cameraInput promise api
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100', 0, async function (done) { it('SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100', 0, async function (done) {
let functionTag = "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100"; let functionTag = "SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100";
console.info(functionTag); console.info(functionTag);
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 cameraManager == null || undefined"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 cameraManager == null || undefined");
expect().assertFail(); expect().assertFail();
} else { } else {
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let successFlag = false; let successFlag = false;
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 createCameraInput with camera: " + camerasArray[i].cameraId); console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 createCameraInput with camera: " + camerasArray[i].cameraId);
let cameraInput = mCameraManager.createCameraInput(camerasArray[i]); let cameraInput = mCameraManager.createCameraInput(camerasArray[i]);
expect(isEmpty(cameraInput)).assertFalse(); expect(isEmpty(cameraInput)).assertFalse();
console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 cameraInput open with camera: " + camerasArray[i].cameraId); console.info(TAG + functionTag + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 cameraInput open with camera: " + camerasArray[i].cameraId);
await cameraInput.open().then(async () => { await cameraInput.open().then(async () => {
successFlag = true; successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED open with CameraID :" + camerasArray[i].cameraId); console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 PASSED open with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => { }).catch((err) => {
successFlag = false; successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 open FAILED: " + err.message); console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 open FAILED: " + err.message);
}); });
await sleep(400); await sleep(400);
successFlag = false; successFlag = false;
await cameraInput.close().then(async () => { await cameraInput.close().then(async () => {
successFlag = true; successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED close with CameraID :" + camerasArray[i].cameraId); console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 PASSED close with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => {
successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 close FAILED: " + err.message);
});
await sleep(100);
successFlag = false;
await cameraInput.release().then(async () => {
successFlag = true;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 PASSED release with CameraID :" + camerasArray[i].cameraId);
}).catch((err) => { }).catch((err) => {
successFlag = false; successFlag = false;
console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_RELEASE_PROMISE_0100 release FAILED: " + err.message); console.info(TAG + functionTag + " SUB_MULTIMEDIA_CAMERA_CAMERA_INPUT_OPEN_CLOSE_PROMISE_0100 close FAILED: " + err.message);
}); });
await sleep(100); await sleep(100);
expect(successFlag).assertEqual(true); expect(successFlag).assertEqual(true);
...@@ -506,7 +485,7 @@ export default function CameraInputTest() { ...@@ -506,7 +485,7 @@ export default function CameraInputTest() {
} }
//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_PROMISE_0100 ends here");
done(); done();
}); });
......
...@@ -159,7 +159,6 @@ export default function cameraJSUnitOutput() { ...@@ -159,7 +159,6 @@ export default function cameraJSUnitOutput() {
async function release() { async function release() {
console.log(TAG + "start release"); console.log(TAG + "start release");
await cameraInput.release();
await captureSession.release(); await captureSession.release();
console.log(TAG + "release end") console.log(TAG + "release end")
} }
...@@ -661,6 +660,38 @@ export default function cameraJSUnitOutput() { ...@@ -661,6 +660,38 @@ export default function cameraJSUnitOutput() {
}) })
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100
* @tc.name : metadata output callback on error api
* @tc.desc : metadata output callback on error api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100--------------");
if (isEmpty(metadataOutput)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 metadataOutput == null || undefined")
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 to operate");
metadataOutput.on('error', async (err, data) => {
if (!err) {
expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 success");
} else {
expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_METADATA_OUTPUT_CALLBACK_ON_ERROR_0100 FAILED: " + err.message);
}
await sleep(1000);
done();
})
}
await sleep(1000);
done();
})
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_CAPTURE_SESSION_START_CALLBACK_0100
* @tc.name : captureSession start * @tc.name : captureSession start
...@@ -734,7 +765,7 @@ export default function cameraJSUnitOutput() { ...@@ -734,7 +765,7 @@ export default function cameraJSUnitOutput() {
if (isEmpty(mMetadataObjectArray)) { if (isEmpty(mMetadataObjectArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 mMetadataObjectArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 mMetadataObjectArray == null || undefined")
} else { } else {
let type = mMetadataObjectArray[0].getType(); let type = mMetadataObjectArray[0].type;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 success, type : " + type); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TYPE_PROMISE_0100 success, type : " + type);
} }
await sleep(1000); await sleep(1000);
...@@ -755,7 +786,7 @@ export default function cameraJSUnitOutput() { ...@@ -755,7 +786,7 @@ export default function cameraJSUnitOutput() {
if (isEmpty(mMetadataObjectArray)) { if (isEmpty(mMetadataObjectArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 mMetadataObjectArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 mMetadataObjectArray == null || undefined")
} else { } else {
let timeStamp = mMetadataObjectArray[0].getTimestamp(); let timeStamp = mMetadataObjectArray[0].timestamp;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 success, timeStamp : " + timeStamp); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_TIMESTAMP_PROMISE_0100 success, timeStamp : " + timeStamp);
} }
await sleep(1000); await sleep(1000);
...@@ -776,9 +807,13 @@ export default function cameraJSUnitOutput() { ...@@ -776,9 +807,13 @@ export default function cameraJSUnitOutput() {
if (isEmpty(mMetadataObjectArray)) { if (isEmpty(mMetadataObjectArray)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 mMetadataObjectArray == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 mMetadataObjectArray == null || undefined")
} else { } else {
let boundingBox = mMetadataObjectArray[0].getBoundingBox(); let boundingBox = mMetadataObjectArray[0].boundingBox;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.width + "x" + boundingBox.height); let w = boundingBox.width;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + boundingBox.topLeftX + "x" + boundingBox.topLeftY); let h = boundingBox.height;
let tx = boundingBox.topLeftX;
let ty = boundingBox.topLeftY;
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + w + "x" + h);
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_GET_METADATA_BOUNDING_BOX_PROMISE_0100 success, boundingBox : " + tx + "x" + ty);
} }
await sleep(1000); await sleep(1000);
done(); done();
......
...@@ -210,34 +210,22 @@ export default function cameraManagerTest() { ...@@ -210,34 +210,22 @@ export default function cameraManagerTest() {
return true; return true;
} }
async function getSupportedOutputCapabilityInCallback(cameraDevice) { async function getSupportedOutputCapability(cameraDevice) {
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering getSupportedOutputCapabilityInCallback cameraManager == null || undefined") console.info(TAG + "Entering getSupportedOutputCapability cameraManager == null || undefined")
expect().assertFail();
return undefined;
}
let outputCapabilityCallback =
mCameraManager.getSupportedOutputCapability(cameraDevice);
await sleep(100);
return outputCapabilityCallback;
}
async function getSupportedOutputCapabilityInPromise(cameraDevice) {
if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering getSupportedOutputCapabilityInPromise cameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
return undefined; return undefined;
} }
let outputCapabilityPromise = mCameraManager.getSupportedOutputCapability(cameraDevice); let outputCapability = mCameraManager.getSupportedOutputCapability(cameraDevice);
if (isEmpty(outputCapabilityPromise)) { if (isEmpty(outputCapability)) {
console.info(TAG + "Entering getSupportedOutputCapabilityInPromise outputCapabilityPromise == null || undefined") console.info(TAG + "Entering getSupportedOutputCapability outputCapability == null || undefined")
} else { } else {
console.info("CameraUnitTest: getSupportedOutputCapabilityInPromise: " + JSON.stringify(outputCapabilityPromise)); console.info("CameraUnitTest: getSupportedOutputCapability: " + JSON.stringify(outputCapability));
} }
return outputCapabilityPromise; return outputCapability;
} }
describe('CameraManagerTest', function () { describe('CameraManagerTest', function () {
...@@ -343,7 +331,7 @@ describe('CameraManagerTest', function () { ...@@ -343,7 +331,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_CALLBACK_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInCallback(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(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)) {
...@@ -389,7 +377,7 @@ describe('CameraManagerTest', function () { ...@@ -389,7 +377,7 @@ describe('CameraManagerTest', function () {
it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100', 2, async function (done) { it('SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100--------------");
for (let i = 0; i < mCameraDevicesArray.length; i++) { for (let i = 0; i < mCameraDevicesArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(mCameraDevicesArray[i]); let cameraOutputCap = await getSupportedOutputCapability(mCameraDevicesArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 camera:" + mCameraDevicesArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_GET_SUPPORTED_CAMERA_OUTPUT_CAPABILITY_PROMISE_0100 camera:" + mCameraDevicesArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -437,7 +425,7 @@ describe('CameraManagerTest', function () { ...@@ -437,7 +425,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 camera:" + camerasArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_PREVIEW_PROFILES_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -474,7 +462,7 @@ describe('CameraManagerTest', function () { ...@@ -474,7 +462,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 camera:" + camerasArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_PHOTO_PROFILES_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let photoProfilesArray = cameraOutputCap.photoProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
...@@ -511,7 +499,7 @@ describe('CameraManagerTest', function () { ...@@ -511,7 +499,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 camera:" + camerasArray[i].cameraId); console.info("Entering SUB_MULTIMEDIA_CAMERA_VIDEO_PROFILES_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let videoProfilesArray = cameraOutputCap.videoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
...@@ -609,7 +597,7 @@ describe('CameraManagerTest', function () { ...@@ -609,7 +597,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PREVIEW_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let previewProfilesArray = cameraOutputCap.previewProfiles; let previewProfilesArray = cameraOutputCap.previewProfiles;
...@@ -647,7 +635,7 @@ describe('CameraManagerTest', function () { ...@@ -647,7 +635,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_PHOTO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let photoProfilesArray = cameraOutputCap.photoProfiles; let photoProfilesArray = cameraOutputCap.photoProfiles;
...@@ -685,7 +673,7 @@ describe('CameraManagerTest', function () { ...@@ -685,7 +673,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_VIDEO_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let videoProfilesArray = cameraOutputCap.videoProfiles; let videoProfilesArray = cameraOutputCap.videoProfiles;
...@@ -713,49 +701,6 @@ describe('CameraManagerTest', function () { ...@@ -713,49 +701,6 @@ describe('CameraManagerTest', function () {
done(); done();
}) })
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100
* @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
* @tc.desc : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100', 2, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100--------------");
let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) {
let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes;
if (!isEmpty(metadataObjectTypeArray)) {
mCameraManager.createMetadataOutput(metadataObjectTypeArray, async (err, data) => {
if (!err) {
if (isEmpty(data)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data == null || undefined")
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 data = " + data)
}
} 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(300);
}
}
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_CALLBACK_0100 PASS");
await sleep(1000);
done();
})
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100
* @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api * @tc.name : Create camerainput from camera-0 cameraposition front & cameratype unspecified async api
...@@ -768,7 +713,7 @@ describe('CameraManagerTest', function () { ...@@ -768,7 +713,7 @@ describe('CameraManagerTest', function () {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100--------------");
let camerasArray = mCameraDevicesArray; let camerasArray = mCameraDevicesArray;
for (let i = 0; i < camerasArray.length; i++) { for (let i = 0; i < camerasArray.length; i++) {
let cameraOutputCap = await getSupportedOutputCapabilityInPromise(camerasArray[i]); let cameraOutputCap = await getSupportedOutputCapability(camerasArray[i]);
console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId); console.info("SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_METADATA_OUTPUT_PROMISE_0100 camera:" + camerasArray[i].cameraId);
if (!isEmpty(cameraOutputCap)) { if (!isEmpty(cameraOutputCap)) {
let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes; let metadataObjectTypeArray = cameraOutputCap.supportedMetadataObjectTypes;
...@@ -838,5 +783,37 @@ describe('CameraManagerTest', function () { ...@@ -838,5 +783,37 @@ describe('CameraManagerTest', function () {
done(); done();
}) })
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100
* @tc.name : camera manager on cameraStatus api
* @tc.desc : camera manager on cameraStatus api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100--------------");
if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 mCameraManager == null || undefined")
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 to operate");
mCameraManager.on('cameraStatus', async (err, data) => {
if (!err) {
expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 success");
} else {
expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 FAILED: " + err.message);
}
await sleep(1000);
done();
})
}
await sleep(1000);
done();
})
}) })
} }
\ No newline at end of file
...@@ -307,7 +307,6 @@ export default function cameraSessionTest() { ...@@ -307,7 +307,6 @@ export default function cameraSessionTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
...@@ -395,7 +394,6 @@ export default function cameraSessionTest() { ...@@ -395,7 +394,6 @@ export default function cameraSessionTest() {
} }
if (!isEmpty(mVideoOutput)) { if (!isEmpty(mVideoOutput)) {
//await mVideoOutput.stop();
await mVideoOutput.release(); await mVideoOutput.release();
} }
...@@ -620,13 +618,15 @@ export default function cameraSessionTest() { ...@@ -620,13 +618,15 @@ export default function cameraSessionTest() {
} }
else { else {
try { try {
await mCameraSession.beginConfig(); mCameraSession.beginConfig();
} catch { } catch(error) {
expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it");
} }
try { try {
await mCameraSession.beginConfig(); mCameraSession.beginConfig();
} catch { } catch(error) {
expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_BEGIN_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it");
} }
...@@ -658,15 +658,16 @@ export default function cameraSessionTest() { ...@@ -658,15 +658,16 @@ export default function cameraSessionTest() {
else { else {
try { try {
await mCameraSession.commitConfig(); await mCameraSession.commitConfig();
} catch { } catch(error) {
expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it");
} }
try { try {
await mCameraSession.commitConfig(); await mCameraSession.commitConfig();
} catch { } catch(error) {
expect().assertFail();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 with a error, ingore it");
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 PASSED");
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_COMMIT_CONFIG_DUPLICATED_PROMISE_0100 ends here");
...@@ -677,34 +678,38 @@ export default function cameraSessionTest() { ...@@ -677,34 +678,38 @@ export default function cameraSessionTest() {
/** /**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 * @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100
* @tc.name : Check capture session start/stop output with promise or not * @tc.name : Check capture session start/stop/release output with promise or not
* @tc.desc : Check capture session start/stop output with promise or not * @tc.desc : Check capture session start/stop/release output with promise or not
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100', 0, async function (done) { it('SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100', 0, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100--------------");
if (mCameraNum == 0) { if (mCameraNum == 0) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 FAILED with NoCamera"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 FAILED with NoCamera");
expect().assertFail(); expect().assertFail();
done(); done();
} }
else { else {
for (let i = 0; i < mCameraNum; i++) { for (let i = 0; i < mCameraNum; i++) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start for camera[" + i + "]"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 start for camera[" + i + "]");
await startCameraSession(i); await startCameraSession(i);
if (!isEmpty(mPreviewOutput)) { if (!isEmpty(mPreviewOutput)) {
await mCameraSession.start(); await mCameraSession.start();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 start PASSED");
await sleep(2000); await sleep(2000);
await mCameraSession.stop(); await mCameraSession.stop();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 stop PASSED"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 stop PASSED");
await sleep(500);
await mCameraSession.release();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 release PASSED");
await sleep(500); await sleep(500);
} }
...@@ -712,10 +717,10 @@ export default function cameraSessionTest() { ...@@ -712,10 +717,10 @@ export default function cameraSessionTest() {
await stopCameraSession(); await stopCameraSession();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 end for camera[" + i + "]"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 end for camera[" + i + "]");
} }
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_RELEASE_PROMISE_0100 ends here");
done(); done();
} }
}) })
......
...@@ -374,7 +374,6 @@ export default function cameraSessionExposureTest() { ...@@ -374,7 +374,6 @@ export default function cameraSessionExposureTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
......
...@@ -325,7 +325,6 @@ export default function cameraSessionFlashTest() { ...@@ -325,7 +325,6 @@ export default function cameraSessionFlashTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
......
...@@ -370,7 +370,6 @@ export default function cameraSessionFocusTest() { ...@@ -370,7 +370,6 @@ export default function cameraSessionFocusTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
...@@ -1444,7 +1443,71 @@ export default function cameraSessionFocusTest() { ...@@ -1444,7 +1443,71 @@ export default function cameraSessionFocusTest() {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 ends here"); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_FOCAL_LENGTH_PROMISE_0100 ends here");
done(); done();
} }
}) })
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100
* @tc.name : camera session focusstatechange api
* @tc.desc : camera session focusstatechange api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100--------------");
if (isEmpty(mCameraSession)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 mCameraSession == null || undefined")
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 to operate");
mCameraSession.on('focusStateChange', async (err, data) => {
if (!err) {
expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 success");
} else {
expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_FOCUSSTATECHANGE_0100 FAILED: " + err.message);
}
await sleep(1000);
done();
})
}
await sleep(1000);
done();
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100
* @tc.name : camera session callback on error
* @tc.desc : camera session callback on error
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it('SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100--------------");
if (isEmpty(mCameraSession)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 previewOutput == null || undefined")
expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 to operate");
mCameraSession.on('error', async (err, data) => {
if (!err) {
expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 success");
} else {
expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_CAMERA_SESSION_ON_ERROR_0100 FAILED: " + err.message);
}
await sleep(1000);
done();
})
}
await sleep(1000);
done();
})
}) })
} }
\ No newline at end of file
...@@ -323,7 +323,6 @@ export default function cameraSessionVideoStabilizationTest() { ...@@ -323,7 +323,6 @@ export default function cameraSessionVideoStabilizationTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
......
...@@ -327,7 +327,6 @@ export default function cameraSessionZoomRatioTest() { ...@@ -327,7 +327,6 @@ export default function cameraSessionZoomRatioTest() {
if (!isEmpty(mCameraInput)) { if (!isEmpty(mCameraInput)) {
await mCameraInput.close(); await mCameraInput.close();
await mCameraInput.release();
} }
console.info('Exit releaseInput'); console.info('Exit releaseInput');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册