提交 8e28d463 编写于 作者: T tongtongdad 提交者: L刘

fixed 5f2b788 from https://gitee.com/l-liu/xts_acts_2/pulls/2887

<liwei@hisilicon.com>
Signed-off-by: Ntongtongdad <liwei200@hisilicon.com>
上级 323ad514
......@@ -29,7 +29,5 @@ export default function cameraKit(surfaceId: any) {
cameraJSUnitEnum(surfaceId)
cameraJSUnitCameraFormat(surfaceId)
cameraJSUnitPhotoAsync(surfaceId)
cameraJSUnitPhotoPromise(surfaceId)
cameraJSUnitVideoAsync(surfaceId)
cameraJSUnitVideoPromise(surfaceId)
}
\ No newline at end of file
......@@ -1112,70 +1112,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED" + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success");
if (data == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
......@@ -1207,67 +1144,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (data == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
expect(true).assertTrue();
console.info(TAG + "Current FlashMode is: " + data);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITHOUT_PHOTOSETTINGS
......@@ -1335,68 +1212,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED" + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success");
if (data == 0) {
console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000)
done();
})
await sleep(1000)
done()
})
/**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
......@@ -1430,33 +1246,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_AUTO
* @tc.name : set flash mode auto camera0 api
* @tc.desc : set flash mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS which is not supported: ");
console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED")
expect().assertFail();
} else {
expect(true).assertTrue()
console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED: " + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
......@@ -1489,68 +1279,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get focus mode locked camera0 api
* @tc.desc : get focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED SUCCESS: " + data);
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_LOCKED data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : check if focus mode manual is supported-camera0Input api
......@@ -1582,70 +1310,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api
......@@ -1677,70 +1341,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
expect(true).assertTrue()
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (data == 1) {
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api
......@@ -1772,71 +1372,6 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
if (data != null || data != undefined) {
expect(true).assertTrue()
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
}
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (data == 2) {
console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS Rotation-0 & Quality-0
* @tc.name : Photo output capture with photosettings api
......@@ -1936,217 +1471,7 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
done();
}
})
/**
* @tc.number : GET_ZOOM_RATIO
* @tc.name : get zoom ratio camera-0 cameraId api
* @tc.desc : get zoom ratio camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_ZOOM_RATIO', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO--------------");
camera0Input.getZoomRatioRange(async (err, data) => {
if (!err) {
if (data != null && data != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO Success " + data)
}
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message);
}
console.info(TAG + "Entering GET_ZOOM_RATIO ends here");
await sleep(1000);
done();
})
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(1, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_1_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(2, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 2");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(2);
console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_2_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_3_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(3, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 3");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(3);
console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_3_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_4_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(4, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 4");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(4);
console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_4_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_5_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(5, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 5");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(5);
console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_5_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_6_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(6, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 6");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(6);
console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_6_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1000);
done();
})
/**
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-270
* @tc.name : Photo output capture with photosettings api
* @tc.desc : Photo output capture with photosettings api
......
......@@ -1053,58 +1053,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen))
if (SetFMOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
var GetFMOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success: " + JSON.stringify(GetFMOpen));
if (GetFMOpen == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen));
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
......@@ -1131,58 +1079,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen))
if (SetFMAlwaysOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (GetFMAlwaysOpen == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
......@@ -1267,58 +1163,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose))
if (SetFMClose == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
var GetFMClose = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success");
if (GetFMClose == 0) {
console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMClose);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "GET_FLASH_MODE_CLOSE ends here");
}
await sleep(1000);
done();
})
// FOCUS promise API's
/**
......@@ -1347,58 +1191,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
var SetFMLocked = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "SetFMLocked: " + JSON.stringify(SetFMLocked))
if (SetFMLocked == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
var GetFMLocked = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED success: " + GetFMLocked);
if (GetFMLocked == 0) {
console.info(TAG + "Current focusmode is: " + GetFMLocked);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : is focusmode manual supported
......@@ -1426,60 +1218,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
var setFocusManual = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "setFocusManual: " + JSON.stringify(setFocusManual))
if (setFocusManual == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (getfocusmodepromise == 0) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED");
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api
......@@ -1506,58 +1244,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
var setFocusCont = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "setFocusCont: " + JSON.stringify(setFocusCont))
if (setFocusCont == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (getfocusmodepromise == 1) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api
......@@ -1584,58 +1270,6 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto))
if (setFocusAuto == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (getfocusmodepromise == 2) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED");
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1000);
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS with Rotation-90 & Quality-1
* @tc.name : Photo output capture with photosettings api
......@@ -1732,188 +1366,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done();
})
//ZOOM Function
/**
* @tc.number : GET_ZOOM_RATIO_PROMISE
* @tc.name : get zoom ratio camera-0 cameraId api promise api
* @tc.desc : get zoom ratio camera-0 cameraId api promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO_PROMISE--------------");
var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise));
if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise));
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED");
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED");
}
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here");
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(1);
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
var getpromise1 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise1);
if (getpromise1 != null && getpromise1 != undefined) {
expect(getpromise1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED");
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(2);
console.info(TAG + "setZoomRatio success: 2");
console.info(TAG + "getZoomRatio called")
var getpromise2 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise2);
if (getpromise2 != null && getpromise2 != undefined) {
expect(getpromise2).assertEqual(2);
console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED");
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_3_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(3);
console.info(TAG + "setZoomRatio success: 3");
console.info(TAG + "getZoomRatio called")
var getpromise3 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise3);
if (getpromise3 != null && getpromise3 != undefined) {
expect(getpromise3).assertEqual(3);
console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED");
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_4_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(4);
console.info(TAG + "setZoomRatio success: 4");
console.info(TAG + "getZoomRatio called")
var getpromise4 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise4);
if (getpromise4 != null && getpromise4 != undefined) {
expect(getpromise4).assertEqual(4);
console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED");
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_5_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(5);
console.info(TAG + "setZoomRatio success: 5");
console.info(TAG + "getZoomRatio called")
var getpromise5 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise5);
if (getpromise5 != null && getpromise5 != undefined) {
expect(getpromise5).assertEqual(5);
console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED");
}
await sleep(1000);
done();
})
/**
* @tc.number : SET_GET_ZOOM_6_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(6);
console.info(TAG + "setZoomRatio success: 6");
console.info(TAG + "getZoomRatio called")
var getpromise6 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise6);
if (getpromise6 != null && getpromise6 != undefined) {
expect(getpromise6).assertEqual(6);
console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED");
}
await sleep(1000);
done();
})
/**
* @tc.number : PHOTOOUTPUT_CAPTURE_WITH_PHOTOSETTINGS
......
......@@ -424,67 +424,9 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}
})
/**
* @tc.number : CREATE_VIDEO_OUTPUT
* @tc.name : Create videooutput async api
* @tc.desc : Create videooutput async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('CREATE_VIDEO_OUTPUT', 0, async function (done) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT to operate')
await getvideosurface()
await sleep(2)
cameraObj.createVideoOutput(videoId, (err, data) => {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT data is not null || undefined')
videoOutput = data
expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT PASSED')
} else {
expect().assertFail()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT FAILED: ' + err.message)
}
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT ends here')
done()
})
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_ERROR
* @tc.name : VideoOutput callback onerror async api
* @tc.desc : VideoOutput callback onerror async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR videoOutput == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR to operate')
await sleep(1)
videoOutput.on('error', async (err, data) => {
if (!err) {
console.info(TAG + "VideoOutput Errorcallback is success")
if (data != null || data != undefined) {
console.info(TAG + "Error during videoOutput with ErrorCode: " + data.code);
expect(true).assertTrue()
}
} else {
expect().assertFail()
}
await sleep(1)
done()
})
await sleep(1)
done();
}
})
/**
* @tc.number : CREATE_CAPTURE_SESSION
......@@ -646,39 +588,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}
})
/**
* @tc.number : ADD_OUTPUT_VIDEO
* @tc.name : AddOutput video async api
* @tc.desc : AddOutput video async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_OUTPUT_VIDEO', 0, async function (done) {
if (captureSession == null || captureSession == undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO captureSession == null || undefined')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO to operate')
await sleep(1)
captureSession.addOutput(videoOutput, async (err, data) => {
if (!err) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO PASSED')
}
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO FAILED: ' + err.message)
}
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO ends here')
await sleep(1);
done()
})
await sleep(1)
done()
}
})
/**
* @tc.number : REMOVE_INPUT_SUCCESS
......@@ -744,37 +654,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS
* @tc.name : Remove video Output api
* @tc.desc : Remove video Output api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('REMOVE_VIDEO_OUTPUT_SUCCESS', 0, async function (done) {
if (captureSession == null || captureSession == undefined) {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS captureSession == null || undefined");
} else {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS to operate");
captureSession.removeOutput(videoOutput, async (err, data) => {
if (!err) {
console.info(TAG + "Entering remove video Output success");
expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS PASSED");
}
else {
expect().assertFail();
console.info(TAG + "Entering Remove video Output FAILED" + err.message);
console.info(TAG + "Entering Remove video Output ends here");
}
await sleep(1);
done();
})
await sleep(1);
}
done();
})
/**
* @tc.number : ADD_INPUT1
......@@ -842,39 +722,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}
})
/**
* @tc.number : ADD_OUTPUT_VIDEO1
* @tc.name : AddOutput video async api
* @tc.desc : AddOutput video async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_OUTPUT_VIDEO1', 0, async function (done) {
if (captureSession == null || captureSession == undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 captureSession == null || undefined')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 to operate')
await sleep(1)
captureSession.addOutput(videoOutput, (err, data) => {
if (!err) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 success')
if (data != null || data != undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 data is not null || undefined')
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 PASSED')
}
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 FAILED: ' + err.message)
}
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO1 ends here')
done()
})
await sleep(1)
done()
}
})
/**
* @tc.number : COMMIT_CONFIG
* @tc.name : CommitConfig async api
......@@ -971,66 +819,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START
* @tc.name : VideoOutput callback onframestart async api
* @tc.desc : VideoOutput callback onframestart async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START videoOutput == null || undefined");
} else {
console.info(TAG + "Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate");
videoOutput.on("frameStart", async (err, data) => {
if (!err) {
console.info(TAG + "Video frameStart Callback is success");
if (data != null || data != undefined) {
expect(true).assertTrue();
}
} else {
expect().assertFail()
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END
* @tc.name : VideoOutput callback onframeend async api
* @tc.desc : VideoOutput callback onframeend async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END videoOutput == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate')
await sleep(1)
videoOutput.on('frameEnd', async (err, data) => {
if (!err) {
console.info(TAG + 'Video frameEnd callback is success')
if (data != null || data != undefined) {
expect(true).assertTrue()
}
} else {
expect().assertFail()
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : CAPTURE_SESSION_START
......@@ -1126,67 +915,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED" + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success");
if (data == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
......@@ -1218,67 +946,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
camera0Input.getFlashMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (data == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
expect(true).assertTrue();
console.info(TAG + "Current FlashMode is: " + data);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED" + err.message);
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : check if flash mode auto is supported-camera0Input api
......@@ -1310,32 +978,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_AUTO
* @tc.name : set flash mode auto camera0 api
* @tc.desc : set flash mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_AUTO SUCCESS which is not supported: ");
console.info(TAG + "Entering SET_FLASH_MODE_AUTO FAILED")
expect().assertFail();
} else {
expect(true).assertTrue()
console.info(TAG + "Entering SET_FLASH_MODE_AUTO PASSED: " + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_CLOSE_SUPPORTED
......@@ -1368,34 +1010,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
camera0Input.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED" + err.message);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
......@@ -1461,76 +1075,16 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
})
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : check if focus mode manual is supported-camera0Input api
* @tc.desc : check if focus mode manual is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get focus mode locked camera0 api
* @tc.desc : get focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED SUCCESS: " + data);
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_LOCKED data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
* @tc.name : check if focus mode manual is supported-camera0Input api
* @tc.desc : check if focus mode manual is supported-camera0Input api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
it('IS_FOCUS_MODE_MANUAL_SUPPORTED', 0, async function (done) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED to operate");
camera0Input.isFocusModeSupported(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
if (!err) {
console.info(TAG + "Entering IS_FOCUS_MODE_MANUAL_SUPPORTED SUCCESS ");
if (data != null || data != undefined) {
......@@ -1551,69 +1105,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (data == 0) {
console.info(TAG + "GET_FOCUS_MODE_MANUAL data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api
......@@ -1645,67 +1136,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
expect(true).assertTrue()
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (data == 1) {
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api
......@@ -1737,276 +1167,6 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
camera0Input.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO, async (err, data) => {
if (!err) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
expect(true).assertTrue()
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED" + err.message);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
camera0Input.getFocusMode(async (err, data) => {
if (!err) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (data == 2) {
console.info(TAG + "GET_FOCUS_MODE_AUTO data is not null || undefined: ");
console.info(TAG + "Current FocusMode is: " + data);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED" + err.message);
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : GET_ZOOM_RATIO
* @tc.name : get zoom ratio camera-0 cameraId api
* @tc.desc : get zoom ratio camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_ZOOM_RATIO', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO--------------");
camera0Input.getZoomRatioRange(async (err, data) => {
if (!err) {
if (data != null && data != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO Success: " + data);
}
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO FAILED: " + err.message);
}
console.info(TAG + "Entering GET_ZOOM_RATIO ends here");
await sleep(1);
done();
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_1_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(1, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_1_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_2_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(2, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 2");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(2);
console.info(TAG + "SET_GET_ZOOM_2_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_2_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_3_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_3_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(3, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 3");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(3);
console.info(TAG + "SET_GET_ZOOM_3_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_3_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_4_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_4_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(4, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 4");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(4);
console.info(TAG + "SET_GET_ZOOM_4_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_4_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_5_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_5_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(5, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 5");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(5);
console.info(TAG + "SET_GET_ZOOM_5_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_5_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_6_ASYNC
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_6_ASYNC', 0, async function (done) {
camera0Input.setZoomRatio(6, (err, data) => {
if (!err) {
console.info(TAG + "setZoomRatio success: 6");
console.info(TAG + "getZoomRatio called")
camera0Input.getZoomRatio((err, data1) => {
if (!err) {
console.info(TAG + "getZoomRatio success : " + data1);
expect(data1).assertEqual(6);
console.info(TAG + "SET_GET_ZOOM_6_ASYNC PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_6_ASYNC FAILED" + err.message);
}
})
}
})
await sleep(1);
done();
})
/**
* @tc.number : VIDEO_OUTPUT_START
* @tc.name : VideoOutput start async api
......@@ -2063,35 +1223,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
done()
})
/**
* @tc.number : VIDEO_OUTPUT_STOP
* @tc.name : VideoOutput stop async api
* @tc.desc : VideoOutput stop async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_STOP', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP videoOutput == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP to operate')
await sleep(1)
videoOutput.stop(async (err, data) => {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP success: ' + JSON.stringify(data))
if (data == undefined) {
expect(true).assertTrue()
} else {
expect().assertFail()
}
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP ends here')
await sleep(1)
done()
})
await sleep(1)
done()
}
})
/**
* @tc.number : VIDEO_RECORDER_STOP
......@@ -2181,39 +1313,7 @@ export default function cameraJSUnitVideoAsync(surfaceId: any) {
}
})
/**
* @tc.number : VIDEOOUPUT_RELEASE_SUCCESS
* @tc.name : videooutput release api
* @tc.desc : videooutput release api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEOOUPUT_RELEASE_SUCCESS', 0, async function (done) {
if (videoOutput == null || videoOutput == undefined) {
console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS previewOutput == null || undefined");
} else {
console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS to operate");
videoOutput.release(async (err, data) => {
if (!err) {
console.info(TAG + "Entering videooutput.release success");
if (data != null || data != undefined) {
console.info(TAG + "Entering videooutput.release data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering videooutput.release PASSED");
}
} else {
expect().assertFail();
console.info(TAG + "Entering VIDEOOUPUT_RELEASE_SUCCESS FAILED: " + err.message);
console.info(TAG + "Entering videooutput.release ends here");
await sleep(1);
done();
}
})
await sleep(1);
done();
}
})
/**
* @tc.number : PREVIEWOUPUT_RELEASE_SUCCESS
......
......@@ -395,64 +395,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
}
})
/**
* @tc.number : CREATE_VIDEO_OUTPUT_PROMISE
* @tc.name : Create videooutput promise api
* @tc.desc : Create videooutput promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('CREATE_VIDEO_OUTPUT_PROMISE', 0, async function (done) {
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE to operate')
await getvideosurface()
await sleep(2)
videoOutputPromise = await cameraObj.createVideoOutput(videoId)
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE: ' + videoOutputPromise)
if (videoOutputPromise != null && videoOutputPromise != undefined) {
expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE PASSED')
} else {
expect(true).assertTrue()
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE PASSED')
}
console.info(TAG + 'Entering CREATE_VIDEO_OUTPUT_PROMISE ends here');
await sleep(1);
done();
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_ERROR
* @tc.name : VideoOutput callback onerror async api
* @tc.desc : VideoOutput callback onerror async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_ERROR', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_ERROR to operate')
await sleep(1)
videoOutputPromise.on('error', async (err, data) => {
if (!err) {
console.info(TAG + 'VideoOutput Errorcallback is success')
if (data != null || data != undefined) {
console.info(TAG + "Error during videoOutput with ErrorCode: " + data.code);
expect(true).assertTrue()
}
} else {
expect().assertFail()
}
await sleep(1)
done()
})
await sleep(1)
done();
}
})
/**
* @tc.number : CREATE_CAPTURE_SESSION_PROMISE
* @tc.name : Create capturesession promise api
......@@ -582,30 +524,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done()
})
/**
* @tc.number : ADD_OUTPUT_VIDEO_PROMISE
* @tc.name : AddOutput video promise api
* @tc.desc : AddOutput video promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_OUTPUT_VIDEO_PROMISE', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE captureSessionPromise == null || undefined')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE to operate')
await captureSessionPromise.addOutput(videoOutputPromise)
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE PASSED')
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : REMOVE_INPUT_SUCCESS
* @tc.name : remove input api
......@@ -670,38 +588,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : REMOVE_VIDEO_OUTPUT_SUCCESS
* @tc.name : Remove video Output api
* @tc.desc : Remove video Output api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('REMOVE_VIDEO_OUTPUT_SUCCESS', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS captureSession == null || undefined");
} else {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS to operate");
const Promise = await captureSessionPromise.removeOutput(videoOutputPromise);
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS addInput success " + Promise);
if (Promise != null || Promise != undefined) {
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS addInput data is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS addInput PASSED");
}
else {
expect().assertFail();
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS FAILED: ");
}
console.info(TAG + "Entering REMOVE_VIDEO_OUTPUT_SUCCESS ends here");
await sleep(1);
done();
}
await sleep(1);
done();
})
/**
* @tc.number : ADD_INPUT_PROMISE1
* @tc.name : AddInput promise api
......@@ -750,30 +636,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done()
})
/**
* @tc.number : ADD_OUTPUT_VIDEO_PROMISE1
* @tc.name : AddOutput video promise api
* @tc.desc : AddOutput video promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('ADD_OUTPUT_VIDEO_PROMISE1', 0, async function (done) {
if (captureSessionPromise == null || captureSessionPromise == undefined) {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE1 captureSessionPromise == null || undefined')
} else {
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE1 to operate')
await captureSessionPromise.addOutput(videoOutputPromise)
expect(true).assertTrue()
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE1 PASSED')
console.info(TAG + 'Entering ADD_OUTPUT_VIDEO_PROMISE1 ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : COMMIT_CONFIG_PROMISE
* @tc.name : CommitConfig promise api
......@@ -859,68 +721,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_START
* @tc.name : VideoOutput callback onframestart async api
* @tc.desc : VideoOutput callback onframestart async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_START', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_START to operate')
await sleep(1)
videoOutputPromise.on('frameStart', async (err, data) => {
if (!err) {
console.info(TAG + "Video frameStart Callback is success");
if (data != null || data != undefined) {
expect(true).assertTrue();
}
} else {
expect().assertFail()
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : VIDEO_OUTPUT_CALLBACK_ON_FRAME_END
* @tc.name : VideoOutput callback onframeend async api
* @tc.desc : VideoOutput callback onframeend async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_CALLBACK_ON_FRAME_END', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_CALLBACK_ON_FRAME_END to operate')
await sleep(1)
videoOutputPromise.on('frameEnd', async (err, data) => {
if (!err) {
console.info(TAG + 'Video frameEnd callback is success')
if (data != null || data != undefined) {
expect(true).assertTrue()
}
} else {
expect().assertFail()
}
await sleep(1);
done();
})
await sleep(1);
done();
}
})
/**
* @tc.number : CAPTURE_SESSION_START_PROMISE
* @tc.name : CaptureSession start promise api
......@@ -999,58 +799,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_OPEN
* @tc.name : set flash mode open camera0 api
* @tc.desc : set flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN to operate");
var SetFMOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMOpen))
if (SetFMOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_OPEN PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_OPEN FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_OPEN
* @tc.name : get flash mode open camera0 api
* @tc.desc : get flash mode open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_OPEN to operate");
var GetFMOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_OPEN success: " + JSON.stringify(GetFMOpen));
if (GetFMOpen == 1) {
console.info(TAG + "GET_FLASH_MODE_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + JSON.stringify(GetFMOpen));
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_ALWAYS_OPEN_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
......@@ -1077,59 +825,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : set flash mode always open camera0 api
* @tc.desc : set flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN to operate");
var SetFMAlwaysOpen = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMAlwaysOpen))
if (SetFMAlwaysOpen == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_ALWAYS_OPEN);
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_ALWAYS_OPEN
* @tc.name : get flash mode always open camera0 api
* @tc.desc : get flash mode always open camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_ALWAYS_OPEN', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN to operate");
var GetFMAlwaysOpen = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_ALWAYS_OPEN success");
if (GetFMAlwaysOpen == 3) {
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMAlwaysOpen);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN FAILED");
console.info(TAG + "GET_FLASH_MODE_ALWAYS_OPEN ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FLASH_MODE_AUTO_SUPPORTED
* @tc.name : check if flash mode always open is supported-camera0Input api
......@@ -1182,59 +877,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FLASH_MODE_CLOSE
* @tc.name : set flash mode close camera0 api
* @tc.desc : set flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE to operate");
var SetFMClose = await camera0InputPromise.setFlashMode(cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "setFlashModeOPEN: " + JSON.stringify(SetFMClose))
if (SetFMClose == undefined) {
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE SUCCESS, current flashmode is: " + cameraObj.FlashMode.FLASH_MODE_CLOSE);
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "Entering SET_FLASH_MODE_CLOSE ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FLASH_MODE_CLOSE
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FLASH_MODE_CLOSE', 0, async function (done) {
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE to operate");
var GetFMClose = await camera0InputPromise.getFlashMode();
console.info(TAG + "Entering GET_FLASH_MODE_CLOSE success");
if (GetFMClose == 0) {
console.info(TAG + "GET_FLASH_MODE_CLOSE data is not null || undefined: ");
console.info(TAG + "Current FlashMode is: " + GetFMClose);
expect(true).assertTrue();
console.info(TAG + "GET_FLASH_MODE_CLOSE PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FLASH_MODE_CLOSE FAILED");
console.info(TAG + "GET_FLASH_MODE_CLOSE ends here");
}
await sleep(1);
done();
})
// FOCUS promise API's
/**
* @tc.number : IS_FOCUS_MODE_LOCKED_SUPPORTED
......@@ -1262,56 +904,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_LOCKED
* @tc.name : set focus mode locked camera0 api
* @tc.desc : set focus mode locked camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED to operate");
var SetFMLocked = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "SetFMLocked: " + JSON.stringify(SetFMLocked))
if (SetFMLocked == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED SUCCESS, current focusmode is: " + cameraObj.FocusMode.FOCUS_MODE_LOCKED);
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED PASSED")
expect(true).assertTrue()
} else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_LOCKED
* @tc.name : get flash mode close camera0 api
* @tc.desc : get flash mode close camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_LOCKED', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED to operate");
var GetFMLocked = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_LOCKED success: " + GetFMLocked);
if (GetFMLocked == 0) {
console.info(TAG + "Current focusmode is: " + GetFMLocked);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_LOCKED PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_LOCKED FAILED");
console.info(TAG + "GET_FOCUS_MODE_LOCKED ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_MANUAL_SUPPORTED
......@@ -1339,59 +932,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_MANUAL
* @tc.name : set focus mode manual camera0 api
* @tc.desc : set focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL to operate");
var setFocusManual = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "setFocusManual: " + JSON.stringify(setFocusManual))
if (setFocusManual == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_MANUAL);
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_MANUAL
* @tc.name : get focus mode manual camera0 api
* @tc.desc : get focus mode manual camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_MANUAL', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_MANUAL SUCCESS");
if (getfocusmodepromise == 0) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_MANUAL PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_MANUAL FAILED");
console.info(TAG + "GET_FOCUS_MODE_MANUAL ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_CONTINUOUS_SUPPORTED
* @tc.name : check if focus mode continuous is supported-camera0Input api
......@@ -1418,60 +959,7 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_CONTINUOUS
* @tc.name : set focus mode continuous camera0 api
* @tc.desc : set focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS to operate");
var setFocusCont = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "setFocusCont: " + JSON.stringify(setFocusCont))
if (setFocusCont == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_CONTINUOUS
* @tc.name : get focus mode continuous camera0 api
* @tc.desc : get focus mode continuous camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_CONTINUOUS', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_CONTINUOUS SUCCESS");
if (getfocusmodepromise == 1) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS FAILED");
console.info(TAG + "GET_FOCUS_MODE_CONTINUOUS ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : IS_FOCUS_MODE_AUTO_SUPPORTED
* @tc.name : check if focus mode auto is supported-camera0Input api
......@@ -1498,341 +986,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done();
})
/**
* @tc.number : SET_FOCUS_MODE_AUTO
* @tc.name : set focus mode auto camera0 api
* @tc.desc : set focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO to operate");
var setFocusAuto = await camera0InputPromise.setFocusMode(cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "setFocusAuto: " + JSON.stringify(setFocusAuto))
if (setFocusAuto == undefined) {
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO SUCCESS, current FocusMode is: " + cameraObj.FocusMode.FOCUS_MODE_AUTO);
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO PASSED")
expect(true).assertTrue()
}
else {
expect().assertFail();
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO FAILED");
console.info(TAG + "Entering SET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
/**
* @tc.number : GET_FOCUS_MODE_AUTO
* @tc.name : get focus mode auto camera0 api
* @tc.desc : get focus mode auto camera0 api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_FOCUS_MODE_AUTO', 0, async function (done) {
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO to operate");
var getfocusmodepromise = await camera0InputPromise.getFocusMode();
console.info(TAG + "Entering GET_FOCUS_MODE_AUTO SUCCESS");
if (getfocusmodepromise == 2) {
console.info(TAG + "Current FocusMode is: " + getfocusmodepromise);
expect(true).assertTrue();
console.info(TAG + "GET_FOCUS_MODE_AUTO PASSED");
}
else {
expect().assertFail();
console.info(TAG + "GET_FOCUS_MODE_AUTO FAILED");
console.info(TAG + "GET_FOCUS_MODE_AUTO ends here");
}
await sleep(1);
done();
})
//ZOOM Function
/**
* @tc.number : GET_ZOOM_RATIO_PROMISE
* @tc.name : get zoom ratio camera-0 cameraId api promise api
* @tc.desc : get zoom ratio camera-0 cameraId api promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('GET_ZOOM_RATIO_PROMISE', 0, async function (done) {
console.info("--------------GET_ZOOM_RATIO_PROMISE--------------");
var getZoomRatioPromise = await camera0InputPromise.getZoomRatioRange();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE getZoomRatioPromise: " + JSON.stringify(getZoomRatioPromise));
if (getZoomRatioPromise != null && getZoomRatioPromise != undefined) {
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE setZoomRatioPromise is not null || undefined");
expect(true).assertTrue();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE success: " + JSON.stringify(getZoomRatioPromise));
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE PASSED");
} else {
expect().assertFail();
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE FAILED");
}
console.info(TAG + "Entering GET_ZOOM_RATIO_PROMISE ends here");
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_1_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_1_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(1);
console.info(TAG + "setZoomRatio success: 1");
console.info(TAG + "getZoomRatio called")
var getpromise1 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise1);
if (getpromise1 != null && getpromise1 != undefined) {
expect(getpromise1).assertEqual(1);
console.info(TAG + "SET_GET_ZOOM_1_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_1_PROMISE FAILED");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_2_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_2_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(2);
console.info(TAG + "setZoomRatio success: 2");
console.info(TAG + "getZoomRatio called")
var getpromise2 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise2);
if (getpromise2 != null && getpromise2 != undefined) {
expect(getpromise2).assertEqual(2);
console.info(TAG + "SET_GET_ZOOM_2_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_3_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_3_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(3);
console.info(TAG + "setZoomRatio success: 3");
console.info(TAG + "getZoomRatio called")
var getpromise3 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise3);
if (getpromise3 != null && getpromise3 != undefined) {
expect(getpromise3).assertEqual(3);
console.info(TAG + "SET_GET_ZOOM_3_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_4_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_4_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(4);
console.info(TAG + "setZoomRatio success: 4");
console.info(TAG + "getZoomRatio called")
var getpromise4 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise4);
if (getpromise4 != null && getpromise4 != undefined) {
expect(getpromise4).assertEqual(4);
console.info(TAG + "SET_GET_ZOOM_4_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_5_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_5_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(5);
console.info(TAG + "setZoomRatio success: 5");
console.info(TAG + "getZoomRatio called")
var getpromise5 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise5);
if (getpromise5 != null && getpromise5 != undefined) {
expect(getpromise5).assertEqual(5);
console.info(TAG + "SET_GET_ZOOM_5_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED");
}
await sleep(1);
done();
})
/**
* @tc.number : SET_GET_ZOOM_6_PROMISE
* @tc.name : Zoom camera-0 cameraId api
* @tc.desc : Zoom camera-0 cameraId api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SET_GET_ZOOM_6_PROMISE', 0, async function (done) {
var setpromise = await camera0InputPromise.setZoomRatio(6);
console.info(TAG + "setZoomRatio success: 6");
console.info(TAG + "getZoomRatio called")
var getpromise6 = await camera0InputPromise.getZoomRatio();
console.info(TAG + "getZoomRatio success: " + getpromise6);
if (getpromise6 != null && getpromise6 != undefined) {
expect(getpromise6).assertEqual(6);
console.info(TAG + "SET_GET_ZOOM_6_PROMISE PASSED ");
}
else {
expect().assertFail();
console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED");
}
await sleep(1);
done();
})
/**
* @tc.number : VIDEO_OUTPUT_START_PROMISE
* @tc.name : VideoOutput start promise api
* @tc.desc : VideoOutput start promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_START_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE to operate')
await videoOutputPromise.start()
expect(true).assertTrue()
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_OUTPUT_START_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_RECORDER_START_PROMISE
* @tc.name : VideoOutput start promise api
* @tc.desc : VideoOutput start promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_RECORDER_START_PROMISE', 0, async function (done) {
if (videoRecorder == null || videoRecorder == undefined) {
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE videoRecorderPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE to operate')
await videoRecorder.start()
console.info(TAG + 'VIDEO_RECORDER_START_PROMISE called');
sleep(3);
console.info(TAG + 'VIDEO_RECORDER_START_PROMISE done.')
expect(true).assertTrue()
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_RECORDER_START_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_OUTPUT_STOP_PROMISE
* @tc.name : VideoOutput stop promise api
* @tc.desc : VideoOutput stop promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_OUTPUT_STOP_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE to operate')
await videoOutputPromise.stop()
expect(true).assertTrue()
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_OUTPUT_STOP_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : VIDEO_RECORDER_STOP_PROMISE
* @tc.name : VideoRecorder stop promise api
* @tc.desc : VideoRecorder stop promise api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEO_RECORDER_STOP_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE videoOutputPromise == null || undefined')
} else {
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE to operate')
await videoRecorder.stop()
expect(true).assertTrue()
console.info(TAG + 'VIDEO_RECORDER_STOP done.')
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE PASSED')
console.info(TAG + 'Entering VIDEO_RECORDER_STOP_PROMISE ends here')
await sleep(1)
done()
}
await sleep(1)
done()
})
/**
* @tc.number : CAPTURE_SESSION_STOP_PROMISE
* @tc.name : CaptureSession stop promise api
......@@ -1881,33 +1034,6 @@ export default function cameraJSUnitVideoPromise(surfaceId: any) {
done()
})
/**
* @tc.number : VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE
* @tc.name : videoOutput release api
* @tc.desc : videoOutput release api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE', 0, async function (done) {
if (videoOutputPromise == null || videoOutputPromise == undefined) {
console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE previewOutputPromise == null || undefined");
} else {
console.info(TAG + "Entering VIDEOOUTPUT_RELEASE_SUCCESS_PROMISE to operate");
const promise = await videoOutputPromise.release();
console.info(TAG + "Entering VideoOutputPromise.release promise: " + JSON.stringify(promise));
if (promise != null || promise != undefined) {
expect(true).assertTrue();
console.info(TAG + "Entering VideoOutputPromise.release PASSED");
}
console.info(TAG + "Entering VideoOutputPromise.release ends here");
await sleep(1);
done();
}
await sleep(1);
done();
})
/**
* @tc.number : PREVIEWOUTPUT_RELEASE_SUCCESS_PROMISE
* @tc.name : PreviewOutput release api
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册