提交 0877af34 编写于 作者: N Nagaprasad Shet 00903433 提交者: Veeresh Kadasani

Add Camera xts_acts testcode

Signed-off-by: NNagaprasad Shet 00903433 <nagaprasad@huawei.com>
Signed-off-by: NVeeresh Kadasani <veeresh.kadasani@huawei.com>
上级 009ee674
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("camera_standard_ets_hap") {
hap_profile = "./src/main/config.json"
deps = []
# shared_libraries = [
# "//third_party/giflib:libgif",
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "CameraStandardETSTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
}
ohos_js_assets("camera_standard_ets_assets") {
source_dir = "./src/main/ets/default"
}
ohos_resources("camera_standard_ets_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for camerastandard Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1000000",
"package": "com.example.cameramoduletestetsv2",
"shell-timeout": "60000"
},
"kits": [
{
"type": "ShellKit",
"run-command": [
"touch /data/media/01.mp4",
"chmod -R 777 /data/media",
"setenforce 0"
],
"teardown-command":[
"setenforce 1"
]
},
{
"test-file-name": [
"CameraStandardETSTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.cameramoduletestetsv2",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.cameramoduletestetsv2",
"name": ".MyApplication",
"mainAbility": "com.example.cameramoduletestetsv2.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.cameramoduletestetsv2.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"reqPermissions": [
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.CAMERA",
"reason" : "use ohos.permission.CAMERA"
},
{
"name" : "ohos.permission.MICROPHONE",
"reason" : "use ohos.permission.MICROPHONE"
},
{
"name" : "ohos.permission.MEDIA_LOCATION",
"reason" : "use ohos.permission.MEDIA_LOCATION"
},
{
"name" : "ohos.permission.READ_MEDIA",
"reason" : "use ohos.permission.READ_MEDIA"
},
{
"name" : "ohos.permission.WRITE_MEDIA",
"reason" : "use ohos.permission.WRITE_MEDIA"
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from "deccjsunit/index"
//import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import cameraKit from "../test/Camera.test"
import featureAbility from "@ohos.ability.featureAbility"
//import {PreviewArea} from '../view/PreviewArea.ets'
let TAG = 'CameraModuleTest: '
var mXComponentController: XComponentController = new XComponentController()
var surfaceId: any
@Entry
@Component
struct CameraIndex {
@State isShowSettings: boolean = false
@State previewSize: string = '75%'
aboutToAppear() {
console.info('--------------aboutToAppear--------------')
// featureAbility.getWant()
// .then((Want) => {
// const core = Core.getInstance()
//// const instrumentLog = new InstrumentLog({
//// 'id': 'report', 'unity': 'true'
//// })
//// console.info(TAG + 'Entering instrumentLog')
// const expectExtend = new ExpectExtend({
// 'id': 'extend'
// })
// console.info(TAG + 'Entering expectExtend')
// core.addService('expect', expectExtend)
//// core.addService('report', instrumentLog)
// console.info(TAG + 'Entering addService')
// core.init()
// console.info(TAG + 'Entering core.init()')
//// core.subscribeEvent('spec', instrumentLog)
//// core.subscribeEvent('suite', instrumentLog)
//// core.subscribeEvent('task', instrumentLog)
// console.info(TAG + 'Entering subscribeEvent')
// const configService = core.getDefaultService('config')
// configService.setConfig(Want.parameters)
// console.info(TAG + 'Entering configService')
// cameraKit(surfaceId)
//// console.info(TAG + 'Entering PreviewArea')
//// PreviewArea({
//// previewSize: $previewSize
//// })
// core.execute()
// console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want));
// })
// .catch((error) => {
// console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error));
// })
}
/*build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}*/
build() {
Flex() {
XComponent({
id: '',
type: 'surface',
libraryname: '',
source: '',
controller: mXComponentController
})
.onLoad(() => {
console.info('CameraModuleTest: OnLoad() is called!')
surfaceId = mXComponentController.getXComponentSurfaceId()
console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + surfaceId)
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
console.info(TAG + 'Entering expectExtend')
core.addService('expect', expectExtend)
console.info(TAG + 'Entering addService')
core.init()
console.info(TAG + 'Entering core.init()')
console.info(TAG + 'Entering subscribeEvent')
const configService = core.getDefaultService('config')
configService.setConfig(Want.parameters)
console.info(TAG + 'Entering configService')
cameraKit(surfaceId)
core.execute()
console.info(TAG + 'Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error(TAG + 'Operation failed. Cause: ' + JSON.stringify(error));
})
})
.width('640px')
.height('480px')
}
}
}
\ No newline at end of file
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import cameraTestCase from '../test/CameraJSUnitPhotoPromise.test'
import cameraTestCase from '../test/CameraJSUnitVideoPromise.test'
import cameraTestCase from '../test/CameraJSUnitCameraFormat.test'
import cameraTestCase from '../test/CameraJSUnitPhotoAsync.test'
import cameraTestCase from '../test/CameraJSUnitVideoAsync.test'
let TAG = 'CameraModuleTest: '
export default function cameraKit(surfaceId:any) {
console.info(TAG + 'Entering cameraKit')
console.info(TAG + 'surfaceId: ' +surfaceId)
cameraTestCase(surfaceId)
// cameraService()
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册