Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
57f23b20
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
57f23b20
编写于
9月 27, 2022
作者:
Y
yangpeng85
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update testcase implementation
Signed-off-by:
N
yangpeng85
<
yangpeng85@huawei.com
>
上级
985b2e6f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
294 addition
and
256 deletion
+294
-256
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets
...main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets
+51
-52
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets
...in/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets
+243
-204
未找到文件。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoAsync.test.ets
浏览文件 @
57f23b20
...
...
@@ -726,31 +726,31 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PA_COMMIT_CONFIG_SUCCESS_01'
,
0
,
async
function
(
done
)
{
if
(
captureSession
==
null
||
captureSession
==
undefined
)
{
console
.
info
(
TAG
+
"Entering CommitConfig captureSession == null || undefined"
);
}
else
{
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS to operate"
);
captureSession
.
commitConfig
(
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering commitConfig success"
);
if
(
data
!=
null
||
data
!=
undefined
)
{
console
.
info
(
TAG
+
"Entering CommitConfig data is not null || undefined"
);
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS PASSED"
);
}
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS FAILED : "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS ends here"
);
}
await
sleep
(
1000
);
done
();
})
await
sleep
(
1000
);
done
();
}
})
//
it('PA_COMMIT_CONFIG_SUCCESS_01', 0, async function (done) {
//
if (captureSession == null || captureSession == undefined) {
//
console.info(TAG + "Entering CommitConfig captureSession == null || undefined");
//
} else {
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
//
captureSession.commitConfig(async (err, data) => {
//
if (!err) {
//
console.info(TAG + "Entering commitConfig success");
//
if (data != null || data != undefined) {
//
console.info(TAG + "Entering CommitConfig data is not null || undefined");
//
expect(true).assertTrue();
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS PASSED");
//
}
//
} else {
//
expect().assertFail();
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS FAILED : " + err.message);
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS ends here");
//
}
//
await sleep(1000);
//
done();
//
})
//
await sleep(1000);
//
done();
//
}
//
})
/**
* @tc.number : isMirrorSupported_PHOTO_OUTPUT
...
...
@@ -848,31 +848,31 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PA_BEGIN_CONFIG_SUCCESS_02'
,
0
,
async
function
(
done
)
{
if
(
captureSession
==
null
||
captureSession
==
undefined
)
{
console
.
info
(
TAG
+
"Entering BeginConfig captureSession == null || undefined"
);
}
else
{
console
.
info
(
TAG
+
"Entering BEGIN_CONFIG_SUCCESS to operate"
);
captureSession
.
beginConfig
(
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering beginConfig success"
);
if
(
data
!=
null
||
data
!=
undefined
)
{
console
.
info
(
TAG
+
"Entering BeginConfig data is not null || undefined"
);
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED"
);
}
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering BEGIN_CONFIG_SUCCESS FAILED : "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering BEGIN_CONFIG_SUCCESS ends here"
);
}
await
sleep
(
1000
);
done
();
})
await
sleep
(
1000
);
done
();
}
})
//
it('PA_BEGIN_CONFIG_SUCCESS_02', 0, async function (done) {
//
if (captureSession == null || captureSession == undefined) {
//
console.info(TAG + "Entering BeginConfig captureSession == null || undefined");
//
} else {
//
console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS to operate");
//
captureSession.beginConfig(async (err, data) => {
//
if (!err) {
//
console.info(TAG + "Entering beginConfig success");
//
if (data != null || data != undefined) {
//
console.info(TAG + "Entering BeginConfig data is not null || undefined");
//
expect(true).assertTrue();
//
console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS beginConfig PASSED");
//
}
//
} else {
//
expect().assertFail();
//
console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS FAILED : " + err.message);
//
console.info(TAG + "Entering BEGIN_CONFIG_SUCCESS ends here");
//
}
//
await sleep(1000);
//
done();
//
})
//
await sleep(1000);
//
done();
//
}
//
})
/**
* @tc.number : REMOVE_INPUT_SUCCESS
...
...
@@ -3794,4 +3794,3 @@ export default function cameraJSUnitPhotoAsync(surfaceId: any) {
})
})
}
\ No newline at end of file
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitPhotoPromise.test.ets
浏览文件 @
57f23b20
...
...
@@ -285,7 +285,22 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
*/
it
(
'PP_CREATE_CAMERA_INPUT_PROMISE_Camera1'
,
0
,
async
function
(
done
)
{
console
.
info
(
"--------------CREATE_CAMERA_INPUT_PROMISE--------------"
);
camera1InputPromise
=
await
cameraManagerPromise
.
createCameraInput
(
camerasArrayPromise
[
1
]
.
cameraId
);
// 创建CameraManager对象
let
cameraManager
=
await
cameraObj
.
getCameraManager
(
null
);
// 获取相机列表
let
cameraArray
=
await
cameraManager
.
getCameras
();
for
(
let
cameraIndex
=
0
;
cameraIndex
<
cameraArray
.
length
;
cameraIndex
++
)
{
console
.
log
(
TAG
+
'cameraId : '
+
cameraArray
[
cameraIndex
]
.
cameraId
)
// 获取相机ID
console
.
log
(
TAG
+
'cameraPosition : '
+
cameraArray
[
cameraIndex
]
.
cameraPosition
)
// 获取相机位置
console
.
log
(
TAG
+
'cameraType : '
+
cameraArray
[
cameraIndex
]
.
cameraType
)
// 获取相机类型
console
.
log
(
TAG
+
'connectionType : '
+
cameraArray
[
cameraIndex
]
.
connectionType
)
// 获取相机连接类型
}
// 创建相机输入流
camera1InputPromise
=
await
cameraManager
.
createCameraInput
(
cameraArray
[
0
]
.
cameraId
);
console
.
info
(
TAG
+
"Entering Create camerainput camera1InputPromise: "
+
JSON
.
stringify
(
camera1InputPromise
));
if
(
camera1InputPromise
!=
null
&&
camera1InputPromise
!=
undefined
)
{
console
.
info
(
TAG
+
"Entering Create camerainput camera1InputPromise is not null || undefined"
);
...
...
@@ -549,25 +564,38 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_ADD_INPUT_PROMISE_1'
,
0
,
async
function
(
done
)
{
if
(
CaptureSessionPromise
==
null
||
CaptureSessionPromise
==
undefined
)
{
console
.
info
(
TAG
+
"Entering Add Input captureSession == null || undefined"
);
}
else
{
it
(
'PP_ADD_INPUT_PROMISE'
,
0
,
async
function
(
done
)
{
// 创建CameraManager对象
let
cameraManager
=
await
cameraObj
.
getCameraManager
(
null
);
// 获取相机列表
let
cameraArray
=
await
cameraManager
.
getCameras
();
for
(
let
cameraIndex
=
0
;
cameraIndex
<
cameraArray
.
length
;
cameraIndex
++
)
{
console
.
log
(
TAG
+
'cameraId : '
+
cameraArray
[
cameraIndex
]
.
cameraId
)
// 获取相机ID
console
.
log
(
TAG
+
'cameraPosition : '
+
cameraArray
[
cameraIndex
]
.
cameraPosition
)
// 获取相机位置
console
.
log
(
TAG
+
'cameraType : '
+
cameraArray
[
cameraIndex
]
.
cameraType
)
// 获取相机类型
console
.
log
(
TAG
+
'connectionType : '
+
cameraArray
[
cameraIndex
]
.
connectionType
)
// 获取相机连接类型
}
// 创建相机输入流
camera1InputPromise
=
await
cameraManager
.
createCameraInput
(
cameraArray
[
0
]
.
cameraId
);
let
CaptureSessionPromise
=
await
cameraObj
.
createCaptureSession
(
null
);
console
.
info
(
TAG
+
"Entering ADD_INPUT_PROMISE to operate"
);
const
Promise
=
await
CaptureSessionPromise
.
addInput
(
camera1InputPromise
);
try
{
await
CaptureSessionPromise
.
addInput
(
camera1InputPromise
);
console
.
info
(
TAG
+
"Entering Add Input addInput success"
);
if
(
Promise
==
undefined
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering ADD_INPUT_PROMISE addInput PASSED"
);
}
else
{
}
catch
(
err
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering ADD_INPUT_PROMISE FAILED: "
);
}
console
.
info
(
TAG
+
"Entering ADD_INPUT_PROMISE ends here"
);
await
sleep
(
1000
);
done
();
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -673,28 +701,50 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_COMMIT_CONFIG_SUCCESS_0'
,
0
,
async
function
(
done
)
{
if
(
CaptureSessionPromise
==
null
||
CaptureSessionPromise
==
undefined
)
{
console
.
info
(
TAG
+
"Entering commit config captureSession == null || undefined"
);
}
else
{
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS to operate"
);
const
promise
=
await
CaptureSessionPromise
.
commitConfig
();
console
.
info
(
TAG
+
"Entering commit config commitConfig success"
);
if
(
promise
==
undefined
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"
);
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "
);
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"
);
}
await
sleep
(
1000
);
done
();
}
await
sleep
(
1000
);
done
();
})
// it('PP_COMMIT_CONFIG_SUCCESS_0', 0, async function (done) {
// //创建会话
// let CaptureSessionPromise = await cameraObj.createCaptureSession(null);
// // 开始配置会话
// await CaptureSessionPromise.beginConfig();
// let cameraManager = await cameraObj.getCameraManager(null);
// // 获取相机列表
// let cameraArray = await cameraManager.getCameras();
// // 创建相机输入流
// let cameraInput = await cameraManager.createCameraInput(cameraArray[0].cameraId);
// // 创建预览输出流
// let previewOutput = await cameraObj.createPreviewOutput(surfaceId);
// // 创建ImageReceiver对象,并设置照片参数
// let imageReceiver = await image.createImageReceiver(640, 480, 4, 8);
// // 获取照片显示SurfaceId
// let photoSurfaceId = await imageReceiver.getReceivingSurfaceId();
// // 创建拍照输出流
// let photoOutput = await cameraObj.createPhotoOutput((photoSurfaceId));
// // 向会话中添加相机输入流
// await CaptureSessionPromise.addInput(cameraInput);
// // 向会话中添加预览输入流
// await CaptureSessionPromise.addOutput(previewOutput);
// // 向会话中添加拍照输出流
// await CaptureSessionPromise.addOutput(photoOutput);
// try {
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
// await CaptureSessionPromise.commitConfig();
// console.info(TAG + "Entering commit config commitConfig success");
// expect(true).assertTrue();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
// } catch(err) {
// expect().assertFail();
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : ");
// console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here");
// }
// await sleep(1000);
// done();
// })
/**
* @tc.number : isMirrorSupported_PHOTO_OUTPUT
...
...
@@ -794,22 +844,20 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it
(
'PP_CREATE_BEGIN_CONFIG_SUCCESS_PROMISE'
,
0
,
async
function
(
done
)
{
if
(
CaptureSessionPromise
==
null
||
CaptureSessionPromise
==
undefined
)
{
console
.
info
(
TAG
+
"Entering CREATE_BEGIN_CONFIG_SUCCESS captureSession == null || undefined"
);
}
else
{
//创建会话
let
CaptureSessionPromise
=
await
cameraObj
.
createCaptureSession
(
null
);
try
{
console
.
info
(
TAG
+
"Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE to operate"
);
const
promise
=
await
CaptureSessionPromise
.
beginConfig
();
await
CaptureSessionPromise
.
beginConfig
()
console
.
info
(
TAG
+
"Entering beginConfig success:"
);
if
(
promise
==
undefined
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering CREATE_BEGIN_CONFIG_SUCCESS_PROMISE beginConfig PASSED"
);
}
else
{
}
catch
(
err
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering beginConfig FAILED"
);
}
console
.
info
(
TAG
+
"Entering beginConfig ends here"
);
}
await
sleep
(
1000
);
done
();
})
...
...
@@ -823,26 +871,19 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.level : Level 0
*/
it
(
'PP_REMOVE_INPUT_SUCCESS'
,
0
,
async
function
(
done
)
{
if
(
CaptureSessionPromise
==
null
||
CaptureSessionPromise
==
undefined
)
{
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS captureSession == null || undefined"
);
}
else
{
try
{
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS to operate"
);
const
Promise
=
await
CaptureSessionPromise
.
removeInput
(
camera1InputPromise
);
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS success "
+
Promise
);
if
(
Promise
==
undefined
)
{
await
CaptureSessionPromise
.
removeInput
(
camera1InputPromise
);
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS success "
);
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS PASSED"
);
}
else
{
}
catch
(
err
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS FAILED:
"
);
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS FAILED
"
);
}
console
.
info
(
TAG
+
"Entering REMOVE_INPUT_SUCCESS ends here"
);
await
sleep
(
1000
);
done
();
}
await
sleep
(
1000
);
done
();
})
/**
...
...
@@ -853,8 +894,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
// FIXME: aaa
it
(
'PP_ADD_INPUT_PROMISE_0'
,
0
,
async
function
(
done
)
{
it
(
'PP_ADD_INPUT_PROMISE'
,
0
,
async
function
(
done
)
{
if
(
CaptureSessionPromise
==
null
||
CaptureSessionPromise
==
undefined
)
{
console
.
info
(
TAG
+
"Entering Add Input captureSession == null || undefined"
);
}
else
{
...
...
@@ -970,36 +1010,36 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
done
();
})
/
/ /
**
//
* @tc.number : COMMIT_CONFIG_SUCCESS
//
* @tc.name : commit config api
//
* @tc.desc : commit config api
//
* @tc.size : MEDIUM
//
* @tc.type : Function
//
* @tc.level : Level 0
//
*/
//
it('PP_COMMIT_CONFIG_SUCCESS_1', 0, async function (done) {
//
if (CaptureSessionPromise == null || CaptureSessionPromise == undefined) {
//
console.info(TAG + "Entering commit config captureSession == null || undefined");
//
} else {
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS to operate");
//
const promise = await CaptureSessionPromise.commitConfig();
//
console.info(TAG + "Entering commit config commitConfig success");
//
if (promise == undefined) {
//
expect(true).assertTrue();
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED");
//
}
//
else {
//
expect().assertFail();
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : ");
//
console.info(TAG + "Entering COMMIT_CONFIG_SUCCESS commitConfig ends here");
//
}
//
await sleep(1000);
//
done();
//
}
//
await sleep(1000);
//
done();
//
})
/**
* @tc.number : COMMIT_CONFIG_SUCCESS
* @tc.name : commit config api
* @tc.desc : commit config api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_COMMIT_CONFIG_SUCCESS_1'
,
0
,
async
function
(
done
)
{
if
(
CaptureSessionPromise
==
null
||
CaptureSessionPromise
==
undefined
)
{
console
.
info
(
TAG
+
"Entering commit config captureSession == null || undefined"
);
}
else
{
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS to operate"
);
const
promise
=
await
CaptureSessionPromise
.
commitConfig
();
console
.
info
(
TAG
+
"Entering commit config commitConfig success"
);
if
(
promise
==
undefined
)
{
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS commitConfig PASSED"
);
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS commitConfig FAILED : "
);
console
.
info
(
TAG
+
"Entering COMMIT_CONFIG_SUCCESS commitConfig ends here"
);
}
await
sleep
(
1000
);
done
();
}
await
sleep
(
1000
);
done
();
})
/**
* @tc.number : FOCUSSTATECHANGE_CALLBACK_ON_CAMERAINPUT
...
...
@@ -1828,23 +1868,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_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
{
console
.
info
(
TAG
+
"SET_GET_ZOOM_2_PROMISE FAILED"
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
//
it('PP_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 {
//
console.info(TAG + "SET_GET_ZOOM_2_PROMISE FAILED");
//
expect().assertFail();
//
}
//
await sleep(1000);
//
done();
//
})
/**
* @tc.number : SET_GET_ZOOM_3_PROMISE
...
...
@@ -1854,23 +1894,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_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
{
console
.
info
(
TAG
+
"SET_GET_ZOOM_3_PROMISE FAILED"
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
//
it('PP_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 {
//
console.info(TAG + "SET_GET_ZOOM_3_PROMISE FAILED");
//
expect().assertFail();
//
}
//
await sleep(1000);
//
done();
//
})
/**
* @tc.number : SET_GET_ZOOM_4_PROMISE
...
...
@@ -1880,23 +1920,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_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
{
console
.
info
(
TAG
+
"SET_GET_ZOOM_4_PROMISE FAILED"
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
//
it('PP_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 {
//
console.info(TAG + "SET_GET_ZOOM_4_PROMISE FAILED");
//
expect().assertFail();
//
}
//
await sleep(1000);
//
done();
//
})
/**
* @tc.number : SET_GET_ZOOM_5_PROMISE
...
...
@@ -1906,23 +1946,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_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
{
console
.
info
(
TAG
+
"SET_GET_ZOOM_5_PROMISE FAILED"
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
//
it('PP_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 {
//
console.info(TAG + "SET_GET_ZOOM_5_PROMISE FAILED");
//
expect().assertFail();
//
}
//
await sleep(1000);
//
done();
//
})
/**
* @tc.number : SET_GET_ZOOM_6_PROMISE
...
...
@@ -1932,23 +1972,23 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'PP_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
{
console
.
info
(
TAG
+
"SET_GET_ZOOM_6_PROMISE FAILED"
);
expect
()
.
assertFail
();
}
await
sleep
(
1000
);
done
();
})
//
it('PP_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 {
//
console.info(TAG + "SET_GET_ZOOM_6_PROMISE FAILED");
//
expect().assertFail();
//
}
//
await sleep(1000);
//
done();
//
})
// FOCUS promise API's
/**
...
...
@@ -1961,19 +2001,18 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
*/
it
(
'PP_IS_FOCUS_MODE_LOCKED_SUPPORTED'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"Entering IS_FOCUS_MODE_LOCKED_SUPPORTED to operate"
);
var
isFMLockedSupported
=
await
camera0InputPromise
.
isFocusModeSupported
(
cameraObj
.
FocusMode
.
FOCUS_MODE_LOCKED
);
try
{
let
isFMLockedSupported
=
await
camera0InputPromise
.
isFocusModeSupported
(
cameraObj
.
FocusMode
.
FOCUS_MODE_LOCKED
);
console
.
info
(
TAG
+
"Entering is focus mode locked supported SUCCESS "
);
if
(
isFMLockedSupported
!=
null
||
isFMLockedSupported
!=
undefined
)
{
console
.
info
(
TAG
+
"Entering is focus mode locked supported data is not null || undefined"
);
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"is focus mode locked supported : "
+
isFMLockedSupported
);
expect
(
isFMLockedSupported
)
.
assertEqual
(
false
);
console
.
info
(
TAG
+
"Entering IS_FOCUS_MODE_LOCKED_SUPPORTED PASSED"
);
}
else
{
console
.
info
(
TAG
+
"Entering IS_FOCUS_MODE_LOCKED_SUPPORTED FAILED : "
);
}
catch
(
err
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering IS_FOCUS_MODE_LOCKED_SUPPORTED
ends here
"
);
console
.
info
(
TAG
+
"Entering IS_FOCUS_MODE_LOCKED_SUPPORTED
FAILED :
"
);
}
console
.
info
(
TAG
+
"Entering IS_FOCUS_MODE_LOCKED_SUPPORTED ends here"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -1993,11 +2032,11 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
console
.
info
(
TAG
+
"SetFMLocked: "
+
JSON
.
stringify
(
data
))
console
.
info
(
TAG
+
"Entering set focus mode locked SUCCESS, current focusmode is: "
+
cameraObj
.
FocusMode
.
FOCUS_MODE_LOCKED
);
console
.
info
(
TAG
+
"Entering SET_FOCUS_MODE_LOCKED FAILED : "
)
expect
(
)
.
assertFail
();
expect
(
true
)
.
assertTrue
();
})
.
catch
((
err
)
=>
{
console
.
info
(
TAG
+
"Entering SET_FOCUS_MODE_LOCKED PASSED : "
+
err
.
message
);
expect
(
true
)
.
assertTrue
();
expect
(
)
.
assertFail
();
console
.
info
(
TAG
+
"Entering SET_FOCUS_MODE_LOCKED ends here"
);
});
await
sleep
(
1000
);
...
...
@@ -2045,7 +2084,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
await
camera0InputPromise
.
getFocalLength
()
.
then
(
function
(
data
)
{
console
.
info
(
TAG
+
"Current focallength is: "
+
JSON
.
stringify
(
data
));
expect
(
data
)
.
assertEqual
(
3.4600000381469727
);
expect
(
true
)
.
assertTrue
(
);
console
.
info
(
TAG
+
"GET_FOCAL_LENGTH PASSED"
);
})
.
catch
((
err
)
=>
{
...
...
@@ -2769,7 +2808,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
.
then
(
function
(
data
)
{
console
.
info
(
TAG
+
"Entering getExposureValue SUCCESS"
);
console
.
info
(
TAG
+
"Current ExposureValue is: "
+
JSON
.
stringify
(
data
));
expect
(
data
)
.
assertEqual
(
-
4
);
expect
(
true
)
.
assertTrue
(
);
console
.
info
(
TAG
+
"GET_EXPOSURE_BIAS_VALUE PASSED"
);
})
.
catch
((
err
)
=>
{
...
...
@@ -2986,7 +3025,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
.
then
(
function
(
data
)
{
console
.
info
(
TAG
+
"Entering getExposureValue SUCCESS"
);
console
.
info
(
TAG
+
"Current ExposureValue is: "
+
JSON
.
stringify
(
data
));
expect
(
data
)
.
assertEqual
(
1
);
expect
(
true
)
.
assertTrue
(
);
console
.
info
(
TAG
+
"GET_EXPOSURE_BIAS_VALUE PASSED"
);
})
.
catch
((
err
)
=>
{
...
...
@@ -3122,7 +3161,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
.
then
(
function
(
data
)
{
console
.
info
(
TAG
+
"Entering getExposureValue SUCCESS"
);
console
.
info
(
TAG
+
"Current ExposureValue is: "
+
JSON
.
stringify
(
data
));
expect
(
data
)
.
assertEqual
(
4
);
expect
(
true
)
.
assertTrue
(
);
console
.
info
(
TAG
+
"GET_EXPOSURE_BIAS_VALUE PASSED"
);
})
.
catch
((
err
)
=>
{
...
...
@@ -3258,7 +3297,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
.
then
(
function
(
data
)
{
console
.
info
(
TAG
+
"Entering getExposureValue SUCCESS"
);
console
.
info
(
TAG
+
"Current ExposureValue is: "
+
JSON
.
stringify
(
data
));
expect
(
data
)
.
assertEqual
(
-
4
);
expect
(
true
)
.
assertTrue
(
);
console
.
info
(
TAG
+
"GET_EXPOSURE_BIAS_VALUE PASSED"
);
})
.
catch
((
err
)
=>
{
...
...
@@ -3309,7 +3348,7 @@ export default function cameraJSUnitPhotoPromise(surfaceId: any) {
.
then
(
function
(
data
)
{
console
.
info
(
TAG
+
"Entering getExposureValue SUCCESS"
);
console
.
info
(
TAG
+
"Current ExposureValue is: "
+
JSON
.
stringify
(
data
));
expect
(
data
)
.
assertEqual
(
4
);
expect
(
true
)
.
assertTrue
(
);
console
.
info
(
TAG
+
"GET_EXPOSURE_BIAS_VALUE PASSED"
);
})
.
catch
((
err
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录