Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ffd8c9b8
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ffd8c9b8
编写于
10月 27, 2022
作者:
Y
yygxr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add xts case for camera_framework
Signed-off-by:
N
yygxr
<
wuhao30@huawei.com
>
上级
09130093
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
1542 addition
and
234 deletion
+1542
-234
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets
...rd/src/main/ets/MainAbility/test/CameraInputTest.test.ets
+555
-177
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
...src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
+444
-2
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
.../src/main/ets/MainAbility/test/CameraManagerTest.test.ets
+417
-26
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
.../main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
+103
-6
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
...n/ets/MainAbility/test/CameraSessionExposureTest.test.ets
+6
-6
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
...main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
...main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
...Ability/test/CameraSessionVideoStabilizationTest.test.ets
+4
-4
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
.../ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
+5
-5
未找到文件。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraInputTest.test.ets
浏览文件 @
ffd8c9b8
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
浏览文件 @
ffd8c9b8
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
浏览文件 @
ffd8c9b8
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
浏览文件 @
ffd8c9b8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
let
mVideoRecorder
;
let
mVideoSurface
;
let
mFileAsset
;
...
...
@@ -183,8 +183,8 @@ export default function cameraSessionTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Photo receiver is created successfully'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
else
{
console
.
log
(
TAG
+
'Photo receiver is created failed'
)
}
...
...
@@ -409,12 +409,11 @@ export default function cameraSessionTest(surfaceId: any) {
console
.
info
(
TAG
+
"createPreviewOutput: "
+
mPreviewOutput
);
}
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
if
(
!
isEmpty
(
cameraOutputCap
.
photoProfiles
))
{
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
@@ -902,6 +901,104 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100
* @tc.name : Check capture session start/stop with callback or not
* @tc.desc : Check capture session start/stop with callback or not
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100'
,
0
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100--------------"
);
if
(
mCameraNum
==
0
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 FAILED with NoCamera"
);
expect
()
.
assertFail
();
done
();
}
else
{
for
(
let
i
=
0
;
i
<
mCameraNum
;
i
++
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start for camera["
+
i
+
"]"
);
await
startCameraSession
(
i
);
mCameraSession
.
start
(
async
(
err
)
=>
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start callback"
);
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start PASSED"
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start FAILED : "
+
err
.
message
);
expect
()
.
assertFail
();
}
})
await
sleep
(
2000
);
mCameraSession
.
stop
(
async
(
err
)
=>
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop callback"
);
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop PASSED"
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 stop FAILED : "
+
err
.
message
);
expect
()
.
assertFail
();
}
})
await
sleep
(
500
);
await
beginCameraSessionConfig
();
await
stopCameraSession
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 end for camera["
+
i
+
"]"
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 ends here"
);
done
();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100
* @tc.name : Check capture session start/stop output with promise or not
* @tc.desc : Check capture session start/stop output with promise or not
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100'
,
0
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100--------------"
);
if
(
mCameraNum
==
0
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 FAILED with NoCamera"
);
expect
()
.
assertFail
();
done
();
}
else
{
for
(
let
i
=
0
;
i
<
mCameraNum
;
i
++
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start for camera["
+
i
+
"]"
);
await
startCameraSession
(
i
);
await
mCameraSession
.
start
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED"
);
await
sleep
(
2000
);
await
mCameraSession
.
stop
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 stop PASSED"
);
await
sleep
(
500
);
await
beginCameraSessionConfig
();
await
stopCameraSession
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 end for camera["
+
i
+
"]"
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 ends here"
);
done
();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100
* @tc.name : Check capture session add/remove input with callback or not
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
浏览文件 @
ffd8c9b8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
let
mVideoRecorder
;
let
mVideoSurface
;
let
mFileAsset
;
...
...
@@ -238,8 +238,8 @@ export default function cameraSessionExposureTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Photo receiver is created successfully'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
else
{
console
.
log
(
TAG
+
'Photo receiver is created failed'
)
}
...
...
@@ -473,7 +473,7 @@ export default function cameraSessionExposureTest(surfaceId: any) {
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
@@ -1126,11 +1126,11 @@ export default function cameraSessionExposureTest(surfaceId: any) {
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_010
2
'
,
2
,
async
function
(
done
)
{
it
(
'SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_010
1
'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_0102--------------"
);
if
(
mCameraNum
==
0
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_010
2
FAILED with NoCamera"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_IS_EXPOSURE_MODE_SUPPORT_PROMISE_010
1
FAILED with NoCamera"
);
expect
()
.
assertFail
();
done
();
}
else
{
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
浏览文件 @
ffd8c9b8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
let
mVideoRecorder
;
let
mVideoSurface
;
let
mFileAsset
;
...
...
@@ -189,8 +189,8 @@ export default function cameraSessionFlashTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Photo receiver is created successfully'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
else
{
console
.
log
(
TAG
+
'Photo receiver is created failed'
)
}
...
...
@@ -424,7 +424,7 @@ export default function cameraSessionFlashTest(surfaceId: any) {
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
浏览文件 @
ffd8c9b8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
let
mVideoRecorder
;
let
mVideoSurface
;
let
mFileAsset
;
...
...
@@ -235,8 +235,8 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Photo receiver is created successfully'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
else
{
console
.
log
(
TAG
+
'Photo receiver is created failed'
)
}
...
...
@@ -469,7 +469,7 @@ export default function cameraSessionFocusTest(surfaceId: any) {
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
浏览文件 @
ffd8c9b8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
let
mVideoRecorder
;
let
mVideoSurface
;
let
mFileAsset
;
...
...
@@ -188,8 +188,8 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Photo receiver is created successfully'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
else
{
console
.
log
(
TAG
+
'Photo receiver is created failed'
)
}
...
...
@@ -422,7 +422,7 @@ export default function cameraSessionVideoStabilizationTest(surfaceId: any) {
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
浏览文件 @
ffd8c9b8
...
...
@@ -32,7 +32,7 @@ let mCameraManager;
let
mCameraDevicesArray
;
let
mCameraSession
;
let
mPhot
e
Surface
;
let
mPhot
o
Surface
;
let
mVideoRecorder
;
let
mVideoSurface
;
let
mFileAsset
;
...
...
@@ -190,8 +190,8 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console
.
log
(
TAG
+
'before receiver check'
)
if
(
receiver
!==
undefined
)
{
console
.
log
(
TAG
+
'Photo receiver is created successfully'
)
mPhot
e
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
e
Surface
))
mPhot
o
Surface
=
await
receiver
.
getReceivingSurfaceId
()
console
.
log
(
TAG
+
'Photo received id: '
+
JSON
.
stringify
(
mPhot
o
Surface
))
}
else
{
console
.
log
(
TAG
+
'Photo receiver is created failed'
)
}
...
...
@@ -426,7 +426,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
console
.
info
(
TAG
+
"cameraOutputCap.photoProfiles.length: "
+
cameraOutputCap
.
photoProfiles
.
length
);
for
(
let
i
=
0
;
i
<
cameraOutputCap
.
photoProfiles
.
length
;
i
++
)
{
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
e
Surface
);
mPhotoOutput
=
await
mCameraManager
.
createPhotoOutput
(
cameraOutputCap
.
photoProfiles
[
i
],
mPhot
o
Surface
);
if
(
!
isEmpty
(
mPhotoOutput
))
{
break
;
}
...
...
@@ -710,7 +710,7 @@ export default function cameraSessionZoomRatioTest(surfaceId: any) {
}
}
catch
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_
PROMISE
_0100 PASSED"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_GET_ZOOM_RATIO_RANGE_
CALLBACK
_0100 PASSED"
);
}
await
sleep
(
1000
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录