Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cb6ba5fd
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看板
提交
cb6ba5fd
编写于
10月 24, 2022
作者:
S
supeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update camera xts on monthly branch
Signed-off-by:
N
supeng
<
supeng13@huawei.com
>
上级
c4ac7384
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
3375 addition
and
3040 deletion
+3375
-3040
multimedia/camera/camera_js_standard/src/main/config.json
multimedia/camera/camera_js_standard/src/main/config.json
+6
-2
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
...src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
+33
-21
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
.../src/main/ets/MainAbility/test/CameraManagerTest.test.ets
+71
-59
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
.../main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
+458
-265
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
...n/ets/MainAbility/test/CameraSessionExposureTest.test.ets
+710
-682
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
...main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
+495
-467
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
...main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
+643
-615
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
...Ability/test/CameraSessionVideoStabilizationTest.test.ets
+439
-461
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
.../ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
+520
-468
未找到文件。
multimedia/camera/camera_js_standard/src/main/config.json
浏览文件 @
cb6ba5fd
...
...
@@ -78,8 +78,12 @@
"reason"
:
"use ohos.permission.READ_MEDIA"
},
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
"name"
:
"ohos.permission.WRITE_MEDIA"
,
"reason"
:
"use ohos.permission.WRITE_MEDIA"
},
{
"name"
:
"ohos.permission.START_ABILIIES_FROM_BACKGROUND"
,
"reason"
:
"use ohos.permission.START_ABILIIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
,
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraJSUnitOutput.test.ets
浏览文件 @
cb6ba5fd
...
...
@@ -113,23 +113,35 @@ export default function cameraJSUnitOutput(surfaceId: any) {
}
}
async
function
getvideosurface
()
{
await
getFd
(
'CameraOutput.mp4'
);
videoConfig
.
url
=
fdPath
;
videoConfig
.
url
=
fdPath
;
media
.
createVideoRecorder
((
err
,
recorder
)
=>
{
console
.
info
(
TAG
+
'createVideoRecorder called'
)
videoRecorder
=
recorder
console
.
info
(
TAG
+
'videoRecorder is :'
+
JSON
.
stringify
(
videoRecorder
))
console
.
info
(
TAG
+
'videoRecorder.prepare called.'
)
videoRecorder
.
prepare
(
videoConfig
,
(
err
)
=>
{
console
.
info
(
TAG
+
'videoRecorder.prepare success.'
)
})
videoRecorder
.
getInputSurface
((
err
,
id
)
=>
{
console
.
info
(
TAG
+
'getInputSurface called'
)
videoSurfaceId
=
id
console
.
info
(
TAG
+
'getInputSurface surfaceId: '
+
JSON
.
stringify
(
videoSurfaceId
))
})
if
(
!
err
)
{
console
.
info
(
TAG
+
'createVideoRecorder called'
)
videoRecorder
=
recorder
console
.
info
(
TAG
+
'videoRecorder is :'
+
JSON
.
stringify
(
videoRecorder
))
console
.
info
(
TAG
+
'videoRecorder.prepare called.'
)
videoRecorder
.
prepare
(
videoConfig
,
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
'videoRecorder.prepare success.'
)
videoRecorder
.
getInputSurface
((
err
,
id
)
=>
{
console
.
info
(
TAG
+
'getInputSurface called'
)
if
(
!
err
)
{
videoSurfaceId
=
id
console
.
info
(
TAG
+
'getInputSurface surfaceId: '
+
JSON
.
stringify
(
videoSurfaceId
))
}
else
{
console
.
info
(
TAG
+
'getInputSurface FAILED'
)
}
})
}
else
{
console
.
info
(
TAG
+
'prepare FAILED'
)
}
})
}
else
{
console
.
info
(
TAG
+
'createVideoRecorder FAILED'
)
}
})
}
...
...
@@ -164,7 +176,7 @@ export default function cameraJSUnitOutput(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_ABILI
T
IES_FROM_BACKGROUND'
;
let
permissionName6
=
'ohos.permission.START_ABILIIES_FROM_BACKGROUND'
;
let
permissionName7
=
'ohos.permission.START_INVISIBLE_ABILITY'
;
let
permissionName8
=
'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
)
.
then
((
result
)
=>
{
...
...
@@ -342,28 +354,28 @@ export default function cameraJSUnitOutput(surfaceId: any) {
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
IN
PUT_PROMISE_0100
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
OUT
PUT_PROMISE_0100
* @tc.name : Create previewOutput instance async api
* @tc.desc : Create previewOutput instance async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
IN
PUT_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
TAG
+
" --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
IN
PUT_PROMISE_0100--------------"
);
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
OUT
PUT_PROMISE_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
TAG
+
" --------------SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
OUT
PUT_PROMISE_0100--------------"
);
if
(
isEmpty
(
cameraManager
))
{
console
.
info
(
TAG
+
"Entering CREATE_CAMERA_INPUT cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
cameraInput
=
await
cameraManager
.
createCameraInput
(
cameraDevicesArray
[
0
]);
if
(
isEmpty
(
cameraInput
))
{
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
IN
PUT_PROMISE_0100 FAILED"
);
console
.
info
(
TAG
+
"SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
OUT
PUT_PROMISE_0100 FAILED"
);
}
cameraInput
.
open
(
async
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
IN
PUT_PROMISE_0100 open callback"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
OUT
PUT_PROMISE_0100 open callback"
);
}
else
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
IN
PUT_PROMISE_0100 FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAMERA_
OUT
PUT_PROMISE_0100 FAILED: "
+
err
.
message
);
}
await
sleep
(
1000
);
done
();
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraManagerTest.test.ets
浏览文件 @
cb6ba5fd
...
...
@@ -82,47 +82,59 @@ export default function cameraManagerTest(surfaceId: any) {
let
publicPath
=
await
mediaTest
.
getPublicDirectory
(
mediaLibrary
.
DirectoryType
.
DIR_VIDEO
);
let
dataUri
=
await
mediaTest
.
createAsset
(
mediaType
,
displayName
,
publicPath
);
if
(
dataUri
!=
undefined
)
{
let
args
=
dataUri
.
id
.
toString
();
let
fetchOp
=
{
selections
:
fileKeyObj
.
ID
+
"=?"
,
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
mFileAsset
=
await
fetchFileResult
.
getAllObject
();
mFdNumber
=
await
mFileAsset
[
0
]
.
open
(
'Rw'
);
mFdPath
=
"fd://"
+
mFdNumber
.
toString
();
let
args
=
dataUri
.
id
.
toString
();
let
fetchOp
=
{
selections
:
fileKeyObj
.
ID
+
"=?"
,
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
mFileAsset
=
await
fetchFileResult
.
getAllObject
();
mFdNumber
=
await
mFileAsset
[
0
]
.
open
(
'Rw'
);
mFdPath
=
"fd://"
+
mFdNumber
.
toString
();
}
}
}
async
function
closeFd
()
{
async
function
closeFd
()
{
if
(
mFileAsset
!=
null
)
{
await
mFileAsset
[
0
]
.
close
(
mFdNumber
)
.
then
(()
=>
{
console
.
info
(
'[mediaLibrary] case close fd success'
);
})
.
catch
((
err
)
=>
{
console
.
info
(
'[mediaLibrary] case close fd failed'
);
});
await
mFileAsset
[
0
]
.
close
(
mFdNumber
)
.
then
(()
=>
{
console
.
info
(
'[mediaLibrary] case close fd success'
);
})
.
catch
((
err
)
=>
{
console
.
info
(
'[mediaLibrary] case close fd failed'
);
});
}
else
{
console
.
info
(
'[mediaLibrary] case fileAsset is null'
);
console
.
info
(
'[mediaLibrary] case fileAsset is null'
);
}
}
}
async
function
getVideoReceiveSurface
()
{
async
function
getVideoReceiveSurface
()
{
console
.
log
(
TAG
+
'Entering getVideoReceiveSurface'
)
await
getFd
(
'CameraManager.mp4'
);
mVideoConfig
.
url
=
mFdPath
;
media
.
createVideoRecorder
((
err
,
recorder
)
=>
{
console
.
info
(
TAG
+
'Entering create video receiver'
)
mVideoRecorder
=
recorder
console
.
info
(
TAG
+
'videoRecorder is :'
+
JSON
.
stringify
(
mVideoRecorder
))
console
.
info
(
TAG
+
'videoRecorder.prepare called.'
)
mVideoRecorder
.
prepare
(
mVideoConfig
,
(
err
)
=>
{
console
.
info
(
TAG
+
'videoRecorder.prepare success.'
)
mVideoRecorder
.
getInputSurface
((
err
,
id
)
=>
{
console
.
info
(
TAG
+
'getInputSurface called'
)
mVideoSurface
=
id
console
.
info
(
TAG
+
'getInputSurface surfaceId: '
+
JSON
.
stringify
(
mVideoSurface
))
if
(
!
err
)
{
console
.
info
(
TAG
+
'Entering create video receiver'
)
mVideoRecorder
=
recorder
console
.
info
(
TAG
+
'videoRecorder is :'
+
JSON
.
stringify
(
mVideoRecorder
))
console
.
info
(
TAG
+
'videoRecorder.prepare called.'
)
mVideoRecorder
.
prepare
(
mVideoConfig
,
(
err
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
'videoRecorder.prepare success.'
)
mVideoRecorder
.
getInputSurface
((
err
,
id
)
=>
{
console
.
info
(
TAG
+
'getInputSurface called'
)
if
(
!
err
)
{
mVideoSurface
=
id
console
.
info
(
TAG
+
'getInputSurface surfaceId: '
+
JSON
.
stringify
(
mVideoSurface
))
}
else
{
console
.
info
(
TAG
+
'getInputSurface FAILED'
)
}
})
}
else
{
console
.
info
(
TAG
+
'prepare FAILED'
)
}
})
})
}
else
{
console
.
info
(
TAG
+
'createVideoRecorder FAILED'
)
}
})
console
.
log
(
TAG
+
'Exit getVideoReceiveSurface'
)
}
...
...
@@ -218,7 +230,7 @@ export default function cameraManagerTest(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_ABILI
T
IES_FROM_BACKGROUND'
;
let
permissionName6
=
'ohos.permission.START_ABILIIES_FROM_BACKGROUND'
;
let
permissionName7
=
'ohos.permission.START_INVISIBLE_ABILITY'
;
let
permissionName8
=
'ohos.permission.ABILITY_BACKGROUND_COMMUNICATION'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
)
.
then
((
result
)
=>
{
...
...
@@ -293,24 +305,24 @@ describe('CameraManagerTest', function () {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA
_MANAGER
_0100
* @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERA
MANAGER_CALLBACK
_0100
* @tc.name : Create camera manager instance async api
* @tc.desc : Create camera manager instance async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_GET_CAMERA
_
MANAGER_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA
_MANAGER
_0100--------------"
);
it
(
'SUB_MULTIMEDIA_CAMERA_GET_CAMERAMANAGER_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERA
MANAGER_CALLBACK
_0100--------------"
);
cameraObj
.
getCameraManager
(
null
,
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
expect
(
isEmpty
(
data
))
.
assertFalse
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA
_MANAGER
_0100 success"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA
MANAGER_CALLBACK
_0100 success"
);
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA
_MANAGER
_0100 FAILED: "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA
MANAGER_CALLBACK
_0100 FAILED: "
+
err
.
message
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA
_MANAGER
_0100 ends here"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERA
MANAGER_CALLBACK
_0100 ends here"
);
await
sleep
(
1000
);
done
();
})
...
...
@@ -336,57 +348,57 @@ describe('CameraManagerTest', function () {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100
* @tc.number : SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100
* @tc.name : Get camera from cameramanager to get array of camera async api
* @tc.desc : Get camera from cameramanager to get array of camera async api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100--------------"
);
it
(
'SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
"--------------SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100--------------"
);
if
(
isEmpty
(
mCameraManager
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 cameraManager == null || undefined"
)
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 cameraManager == null || undefined"
)
expect
()
.
assertFail
();
}
mCameraManager
.
getSupportedCameras
(
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 success"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 success"
);
if
(
!
isEmpty
(
data
))
{
mCameraDevicesArray
=
data
;
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 data is "
+
mCameraDevicesArray
.
length
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 data is "
+
mCameraDevicesArray
.
length
);
if
(
mCameraDevicesArray
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
mCameraDevicesArray
.
length
;
i
++
)
{
// Get the variables from camera object
let
cameraId
=
mCameraDevicesArray
[
i
]
.
cameraId
;
expect
(
isEmpty
(
cameraId
))
.
assertFalse
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera"
+
i
+
"Id: "
+
cameraId
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 camera"
+
i
+
"Id: "
+
cameraId
);
let
cameraPosition
=
mCameraDevicesArray
[
i
]
.
cameraPosition
;
expect
(
isEmpty
(
cameraPosition
))
.
assertFalse
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera"
+
i
+
"Position: "
+
cameraPosition
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 camera"
+
i
+
"Position: "
+
cameraPosition
);
let
cameraType
=
mCameraDevicesArray
[
i
]
.
cameraType
;
expect
(
isEmpty
(
cameraType
))
.
assertFalse
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 camera"
+
i
+
"Type: "
+
cameraType
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 camera"
+
i
+
"Type: "
+
cameraType
);
let
connectionType
=
mCameraDevicesArray
[
i
]
.
connectionType
expect
(
isEmpty
(
connectionType
))
.
assertFalse
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 connection"
+
i
+
"Type: "
+
connectionType
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 connection"
+
i
+
"Type: "
+
connectionType
);
}
expect
(
true
)
.
assertTrue
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 PASSED"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 PASSED"
);
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"
);
}
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 ends here"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 ends here"
);
await
sleep
(
1000
);
done
();
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 FAILED cameraArray is null || undefined"
);
}
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_CAMERAS_CALLBACK_0100 FAILED , err = "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_GET_
SUPPORTED_
CAMERAS_CALLBACK_0100 FAILED , err = "
+
err
.
message
);
}
})
await
sleep
(
1000
);
...
...
@@ -958,30 +970,30 @@ describe('CameraManagerTest', function () {
})
/**
* @tc.number : SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100
* @tc.number : SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100
* @tc.name : Create CaptureSession instance api
* @tc.desc : Create CaptureSession instance api
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate"
);
it
(
'SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100'
,
2
,
async
function
(
done
)
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100 to operate"
);
let
cameraSession
;
mCameraManager
.
createCaptureSession
(
async
(
err
,
data
)
=>
{
if
(
!
err
)
{
console
.
info
(
TAG
+
"Entering createCaptureSession success"
);
if
(
isEmpty
(
data
))
{
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 data == null || undefined"
)
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100 data == null || undefined"
)
expect
()
.
assertFail
();
}
else
{
cameraSession
=
data
;
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100 PASSED"
);
}
}
else
{
expect
()
.
assertFail
();
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100 FAILED : "
+
err
.
message
);
console
.
info
(
TAG
+
"Entering SUB_MULTIMEDIA_CAMERA_
MANAGER_
CREATE_CAPTURE_SESSION_CALLBACK_0100 ends here"
);
}
await
sleep
(
1000
);
done
();
...
...
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionBaseTest.test.ets
浏览文件 @
cb6ba5fd
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionExposureTest.test.ets
浏览文件 @
cb6ba5fd
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFlashTest.test.ets
浏览文件 @
cb6ba5fd
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionFocusTest.test.ets
浏览文件 @
cb6ba5fd
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionVideoStabilizationTest.test.ets
浏览文件 @
cb6ba5fd
此差异已折叠。
点击以展开。
multimedia/camera/camera_js_standard/src/main/ets/MainAbility/test/CameraSessionZoomRatioTest.test.ets
浏览文件 @
cb6ba5fd
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录