Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c636d146
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看板
提交
c636d146
编写于
10月 09, 2022
作者:
Y
yygxr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix camera session xts error
Signed-off-by:
N
yygxr
<
wuhao30@huawei.com
>
上级
a4675163
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
61 addition
and
18 deletion
+61
-18
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
.../main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
+61
-18
未找到文件。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
浏览文件 @
c636d146
...
...
@@ -132,6 +132,9 @@ export default function cameraSessionTest(surfaceId: any) {
let
permissionName3
=
'ohos.permission.MEDIA_LOCATION'
;
let
permissionName4
=
'ohos.permission.READ_MEDIA'
;
let
permissionName5
=
'ohos.permission.WRITE_MEDIA'
;
let
permissionName6
=
'ohos.permission.START_ABILITIES_FROM_BACKGROUND'
;
let
permissionName7
=
'ohos.permission.START_INVISIBLE_ABILITY'
;
let
permissionName8
=
'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
)
.
then
((
result
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission success :'
+
result
);
})
.
catch
((
err
)
=>
{
...
...
@@ -157,6 +160,21 @@ export default function cameraSessionTest(surfaceId: any) {
})
.
catch
((
err
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission failed :'
+
err
);
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName6
,
1
)
.
then
((
result
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission success :'
+
result
);
})
.
catch
((
err
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission failed :'
+
err
);
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName7
,
1
)
.
then
((
result
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission success :'
+
result
);
})
.
catch
((
err
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission failed :'
+
err
);
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName8
,
1
)
.
then
((
result
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission success :'
+
result
);
})
.
catch
((
err
)
=>
{
console
.
info
(
'[permission] case grantUserGrantedPermission failed :'
+
err
);
});
}
else
{
console
.
info
(
'[permission] case apply permission failed, createAtManager failed'
);
}
...
...
@@ -280,7 +298,7 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
await
sleep
(
1
00
);
await
sleep
(
3
00
);
console
.
info
(
'Exit commitCameraSessionConfig'
);
...
...
@@ -456,7 +474,6 @@ export default function cameraSessionTest(surfaceId: any) {
}
await
commitCameraSessionConfig
();
await
beginCameraSessionConfig
();
/*
await mCameraSession.start(async (err) => {
...
...
@@ -904,8 +921,6 @@ export default function cameraSessionTest(surfaceId: any) {
await
startCameraSession
(
mCameraInputArray
[
i
]);
await
commitCameraSessionConfig
();
mCameraSession
.
start
(
async
(
err
)
=>
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_CALLBACK_0100 start callback"
);
if
(
!
err
)
{
...
...
@@ -949,7 +964,7 @@ export default function cameraSessionTest(surfaceId: any) {
* @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_
CALLBACK
_0100--------------"
);
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_
PROMISE
_0100--------------"
);
if
(
isEmpty
(
mCameraInputArray
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 FAILED with NoCamera"
);
...
...
@@ -962,8 +977,6 @@ export default function cameraSessionTest(surfaceId: any) {
await
startCameraSession
(
mCameraInputArray
[
i
]);
await
commitCameraSessionConfig
();
await
mCameraSession
.
start
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_START_STOP_PROMISE_0100 start PASSED"
);
await
sleep
(
2000
);
...
...
@@ -1099,10 +1112,13 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
await
mCameraSession
.
addOutput
(
mPreviewOutput
);
await
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
mCameraSession
.
removeInput
(
mCameraInputArray
[
i
],
async
(
err
)
=>
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 callback"
);
...
...
@@ -1114,6 +1130,7 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
await
mCameraSession
.
removeOutput
(
mPreviewOutput
);
await
mCameraSession
.
removeOutput
(
mPhotoOutput
);
await
sleep
(
500
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_CALLBACK_0100 FAILED"
);
...
...
@@ -1151,13 +1168,17 @@ export default function cameraSessionTest(surfaceId: any) {
if
(
mCanAddInputArray
[
i
]
==
true
)
{
await
mCameraSession
.
addInput
(
mCameraInputArray
[
i
]);
await
mCameraSession
.
addOutput
(
mPreviewOutput
);
await
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
mCameraSession
.
removeInput
(
mCameraInputArray
[
i
]);
await
mCameraSession
.
removeOutput
(
mPreviewOutput
);
await
mCameraSession
.
removeOutput
(
mPhotoOutput
);
await
sleep
(
500
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_INPUT_PROMISE_0100 FAILED"
);
...
...
@@ -1206,6 +1227,7 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
await
sleep
(
500
);
mCanAddOutput
=
true
;
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_CAN_ADDOUTPUT_CALLBACK_0100 FAILED with NoReviewOutput"
);
expect
()
.
assertFail
();
...
...
@@ -1279,11 +1301,14 @@ export default function cameraSessionTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
mCameraSession
.
addOutput
(
mPhotoOutput
);
await
mCameraSession
.
addInput
(
mCameraInputArray
[
0
]);
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
sleep
(
500
);
...
...
@@ -1296,6 +1321,7 @@ export default function cameraSessionTest(surfaceId: any) {
expect
()
.
assertFail
();
}
})
await
mCameraSession
.
removeOutput
(
mPhotoOutput
);
await
mCameraSession
.
removeInput
(
mCameraInputArray
[
0
]);
await
sleep
(
500
);
}
else
{
...
...
@@ -1326,18 +1352,22 @@ export default function cameraSessionTest(surfaceId: any) {
}
else
{
if
(
!
isEmpty
(
mPreviewOutput
)
&&
(
mCanAddOutput
==
true
))
{
await
mCameraSession
.
addOutput
(
mPreviewOutput
)
await
mCameraSession
.
addOutput
(
mPreviewOutput
);
await
mCameraSession
.
addOutput
(
mPhotoOutput
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 add PASSED"
);
await
mCameraSession
.
addInput
(
mCameraInputArray
[
0
]);
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
sleep
(
500
);
await
mCameraSession
.
removeOutput
(
mPreviewOutput
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0100 remove PASSED"
);
await
mCameraSession
.
removeOutput
(
mPhotoOutput
);
await
mCameraSession
.
removeInput
(
mCameraInputArray
[
0
]);
await
sleep
(
500
);
}
else
{
...
...
@@ -1384,6 +1414,7 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
await
sleep
(
500
);
mCanAddOutput
=
true
;
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_CAN_ADDOUTPUT_CALLBACK_0101 FAILED with NoPhotoOutput"
);
expect
()
.
assertFail
();
...
...
@@ -1465,7 +1496,9 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
sleep
(
500
);
...
...
@@ -1522,7 +1555,9 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
sleep
(
500
);
...
...
@@ -1578,6 +1613,7 @@ export default function cameraSessionTest(surfaceId: any) {
}
})
await
sleep
(
500
);
mCanAddOutput
=
true
;
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_CAN_ADDOUTPUT_CALLBACK_0102 FAILED with NoVideoOutput"
);
expect
()
.
assertFail
();
...
...
@@ -1655,7 +1691,9 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
sleep
(
500
);
...
...
@@ -1698,13 +1736,15 @@ export default function cameraSessionTest(surfaceId: any) {
}
else
{
if
(
!
isEmpty
(
mVideoOutput
)
&&
(
mCanAddOutput
==
true
))
{
await
mCameraSession
.
addOutput
(
mVideoOutput
)
await
mCameraSession
.
addOutput
(
mVideoOutput
)
;
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_ADD_REMOVE_OUTPUT_PROMISE_0102 PASSED"
);
await
mCameraSession
.
addInput
(
mCameraInputArray
[
0
]);
await
sleep
(
500
);
await
commitCameraSessionConfig
();
await
sleep
(
1
);
await
beginCameraSessionConfig
();
await
sleep
(
1
);
await
sleep
(
500
);
...
...
@@ -1764,10 +1804,11 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
3000
);
if
(
nfyFlag
==
false
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED without any nofity!"
);
//
expect().assertFail();
//
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 FAILED without any nofity!");
}
await
beginCameraSessionConfig
();
await
stopCameraSession
(
mCameraInputArray
[
i
]);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0100 end for camera["
+
i
+
"]"
);
...
...
@@ -1820,10 +1861,11 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
3000
);
if
(
nfyFlag
==
false
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!"
);
//
expect().assertFail();
//
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 FAILED without any nofity!");
}
await
beginCameraSessionConfig
();
await
stopCameraSession
(
mCameraInputArray
[
i
]);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0101 end for camera["
+
i
+
"]"
);
...
...
@@ -1874,10 +1916,11 @@ export default function cameraSessionTest(surfaceId: any) {
await
sleep
(
3000
);
if
(
nfyFlag
==
false
)
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED without any nofity!"
);
//
expect().assertFail();
//
console.info(TAG + "SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 FAILED without any nofity!");
}
await
beginCameraSessionConfig
();
await
stopCameraSession
(
mCameraInputArray
[
i
]);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_SESSION_STATUS_CALLBACK_0102 end for camera["
+
i
+
"]"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录