Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d67e0639
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看板
提交
d67e0639
编写于
3月 15, 2023
作者:
T
tianwenzhe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add validator
Signed-off-by:
N
tian-wenzhe411
<
tianwenzhe2@huawei.com
>
上级
380526a1
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
682 addition
and
546 deletion
+682
-546
validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets
...r/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets
+7
-8
validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
...r/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
+7
-8
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation0.ets
...alidator/src/main/ets/pages/Camera/CameraOrientation0.ets
+0
-97
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation180.ets
...idator/src/main/ets/pages/Camera/CameraOrientation180.ets
+0
-96
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation270.ets
...idator/src/main/ets/pages/Camera/CameraOrientation270.ets
+0
-96
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation90.ets
...lidator/src/main/ets/pages/Camera/CameraOrientation90.ets
+0
-96
validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets
...acts_validator/src/main/ets/pages/Camera/Camera_index.ets
+10
-14
validator/acts_validator/src/main/ets/pages/Experience/ColdStartTest.ets
...validator/src/main/ets/pages/Experience/ColdStartTest.ets
+193
-0
validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets
.../acts_validator/src/main/ets/pages/Experience/DeskFps.ets
+19
-4
validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets
...idator/src/main/ets/pages/Experience/Experience_index.ets
+9
-8
validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets
..._validator/src/main/ets/pages/Experience/HotStartTest.ets
+194
-0
validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
...acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
+19
-4
validator/acts_validator/src/main/ets/pages/Experience/ScrollListTest.ets
...alidator/src/main/ets/pages/Experience/ScrollListTest.ets
+0
-52
validator/acts_validator/src/main/ets/pages/Player/Player_index.ets
...acts_validator/src/main/ets/pages/Player/Player_index.ets
+7
-8
validator/acts_validator/src/main/ets/pages/common/CameraOrientation.ets
...validator/src/main/ets/pages/common/CameraOrientation.ets
+1
-1
validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets
...r/src/main/ets/pages/common/ExperienceCustomContainer.ets
+1
-1
validator/acts_validator/src/main/ets/pages/common/StartExperienceCustomContainer.ets
.../main/ets/pages/common/StartExperienceCustomContainer.ets
+170
-0
validator/acts_validator/src/main/ets/pages/index.ets
validator/acts_validator/src/main/ets/pages/index.ets
+42
-48
validator/acts_validator/src/main/resources/base/profile/main_pages.json
...validator/src/main/resources/base/profile/main_pages.json
+3
-5
未找到文件。
validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets
浏览文件 @
d67e0639
...
...
@@ -291,30 +291,29 @@ struct IndexPage {
}
let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration();
serializer.startElement("testsuite");
serializer.setAttributes("name","ActsArkUITest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsArkUITest");
for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
浏览文件 @
d67e0639
...
...
@@ -270,30 +270,29 @@ struct IndexPage {
}
let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration();
serializer.startElement("testsuite");
serializer.setAttributes("name","ActsAudioTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsAudioTest");
for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation0.ets
已删除
100644 → 0
浏览文件 @
380526a1
/*
* 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 camera from '@ohos.multimedia.camera'
import Logger from '../model/Logger'
import CameraService from '../model/CameraService'
import {CustomContainer} from '../common/CameraOrientation';
import FirstDialog from '../model/FirstDialog';
const CameraMode = {
MODE_PHOTO: 0, // 拍照模式
MODE_VIDEO: 1 // 录像模式
}
@Entry
@Component
struct SetCircle {
@State FillColor: string = '#FF000000';
@State name: string = 'CameraOrientation0';
@State StepTips: string = '测试目的:用于测试相机预览和拍照旋转能力\n-左侧显示给定旋转角度后的预览窗口\n-右侧显示拍照后的图片\n-对于前置摄像头会有镜像效果'+'\n'+'预期结果:拍照图片与预览窗口的画面一致';
private tag: string = 'qlw'
private mXComponentController: XComponentController = new XComponentController()
@State surfaceId: number = 0;
@State curModel: number = CameraMode.MODE_PHOTO
@State cameraDeviceIndex: number = 0
@State imageRotationValue: number = camera.ImageRotation.ROTATION_90
@State qualityLevelValue: number = camera.QualityLevel.QUALITY_LEVEL_LOW
@State assetUri: string = undefined
@State Vue: boolean = false
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
handleTakePicture = (assetUri: string) => {
this.assetUri = assetUri
Logger.info(this.tag, `takePicture end, assetUri: ${this.assetUri}`)
}
@Builder specificNoParam() {
Column() {
}
}
build() {
Column() {
CustomContainer({
title: this.name,
Url:'pages/Camera/Camera_index',
StepTips:this.StepTips,
content: this.specificNoParam,
FillColor:$FillColor,
name: $name,
Vue: $Vue
}).height('30%').width('100%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
XComponent({
id: 'componentId',
type: 'surface',
controller: this.mXComponentController
})
.onLoad(async () => {
Logger.info(this.tag, 'onLoad is called')
// @ts-ignore
this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 10, surfaceHeight: 10 })
// @ts-ignore
this.surfaceId = this.mXComponentController.getXComponentSurfaceId()
Logger.info(this.tag, `onLoad surfaceId: ${this.surfaceId}`)
this.curModel = CameraMode.MODE_PHOTO
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex)
})
.height('40%')
.width('40%')
Text('Camera Preview').fontSize('20fp')
Image(this.assetUri || $r('app.media.img'))
.width('40%').height('40%').border({ width: 1 }).objectFit(ImageFit.Contain)
Text('Oriented Photo').fontSize('20fp')
Button('拍照', {
type: ButtonType.Normal,
stateEffect: true
}).borderRadius(8).backgroundColor(0x317aff).width('20%').onClick(() => {
CameraService.takePicture(this.imageRotationValue, this.qualityLevelValue)
CameraService.setTakePictureCallback(this.handleTakePicture.bind(this))
this.Vue = true
})
}.width('100%').height('70%').backgroundColor(Color.White)
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
\ No newline at end of file
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation180.ets
已删除
100644 → 0
浏览文件 @
380526a1
/*
* 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 camera from '@ohos.multimedia.camera'
import Logger from '../model/Logger'
import CameraService from '../model/CameraService'
import {CustomContainer} from '../common/CameraOrientation';
import FirstDialog from '../model/FirstDialog';
const CameraMode = {
MODE_PHOTO: 0, // 拍照模式
MODE_VIDEO: 1 // 录像模式
}
@Entry
@Component
struct SetCircle {
@State FillColor: string = '#FF000000';
@State name: string = 'CameraOrientation180';
@State StepTips: string = '测试目的:用于测试相机预览和拍照旋转能力\n-左侧显示给定旋转角度后的预览窗口\n-右侧显示拍照后的图片\n-对于前置摄像头会有镜像效果'+'\n'+'预期结果:拍照图片与预览窗口的画面一致';
private tag: string = 'qlw'
private mXComponentController: XComponentController = new XComponentController()
@State surfaceId: number = 0;
@State curModel: number = CameraMode.MODE_PHOTO
@State cameraDeviceIndex: number = 0
@State imageRotationValue: number = camera.ImageRotation.ROTATION_180
@State qualityLevelValue: number = camera.QualityLevel.QUALITY_LEVEL_LOW
@State assetUri: string = undefined
@State Vue: boolean = false
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
handleTakePicture = (assetUri: string) => {
this.assetUri = assetUri
Logger.info(this.tag, `takePicture end, assetUri: ${this.assetUri}`)
}
@Builder specificNoParam() {
Column() {
}
}
build() {
Column() {
CustomContainer({
title: this.name,
Url:'pages/Camera/Camera_index',
StepTips:this.StepTips,
content: this.specificNoParam,
FillColor:$FillColor,
name:$name,
Vue: $Vue,
}).height('30%').width('100%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
XComponent({
id: 'componentId',
type: 'surface',
controller: this.mXComponentController
})
.onLoad(async () => {
Logger.info(this.tag, 'onLoad is called')
// @ts-ignore
this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 10, surfaceHeight: 10 })
// @ts-ignore
this.surfaceId = this.mXComponentController.getXComponentSurfaceId()
Logger.info(this.tag, `onLoad surfaceId: ${this.surfaceId}`)
this.curModel = CameraMode.MODE_PHOTO
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex)
})
.height('40%')
.width('40%')
Text('Camera Preview').fontSize('20fp')
Image(this.assetUri || $r('app.media.img'))
.width('40%').height('40%').border({ width: 1 }).objectFit(ImageFit.Contain)
Text('Oriented Photo').fontSize('20fp')
Button('拍照', {
type: ButtonType.Normal,
stateEffect: true
}).borderRadius(8).backgroundColor(0x317aff).width('20%').onClick(() => {
CameraService.takePicture(this.imageRotationValue, this.qualityLevelValue)
CameraService.setTakePictureCallback(this.handleTakePicture.bind(this))
this.Vue = true
})
}.width('100%').height('70%').backgroundColor(Color.White)
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
\ No newline at end of file
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation270.ets
已删除
100644 → 0
浏览文件 @
380526a1
/*
* 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 camera from '@ohos.multimedia.camera'
import Logger from '../model/Logger'
import CameraService from '../model/CameraService'
import {CustomContainer} from '../common/CameraOrientation';
import FirstDialog from '../model/FirstDialog';
const CameraMode = {
MODE_PHOTO: 0, // 拍照模式
MODE_VIDEO: 1 // 录像模式
}
@Entry
@Component
struct SetCircle {
@State FillColor: string = '#FF000000';
@State name: string = 'CameraOrientation270';
@State StepTips: string = '测试目的:用于测试相机预览和拍照旋转能力\n-左侧显示给定旋转角度后的预览窗口\n-右侧显示拍照后的图片\n-对于前置摄像头会有镜像效果'+'\n'+'预期结果:拍照图片与预览窗口的画面一致';
private tag: string = 'qlw'
private mXComponentController: XComponentController = new XComponentController()
@State surfaceId: number = 0;
@State curModel: number = CameraMode.MODE_PHOTO
@State cameraDeviceIndex: number = 0
@State imageRotationValue: number = camera.ImageRotation.ROTATION_270
@State qualityLevelValue: number = camera.QualityLevel.QUALITY_LEVEL_LOW
@State assetUri: string = undefined
@State Vue: boolean = false
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
handleTakePicture = (assetUri: string) => {
this.assetUri = assetUri
Logger.info(this.tag, `takePicture end, assetUri: ${this.assetUri}`)
}
@Builder specificNoParam() {
Column() {
}
}
build() {
Column() {
CustomContainer({
title: this.name,
Url:'pages/Camera/Camera_index',
StepTips:this.StepTips,
content: this.specificNoParam,
FillColor:$FillColor,
name:$name,
Vue: $Vue
}).height('30%').width('100%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
XComponent({
id: 'componentId',
type: 'surface',
controller: this.mXComponentController
})
.onLoad(async () => {
Logger.info(this.tag, 'onLoad is called')
// @ts-ignore
this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 10, surfaceHeight: 10 })
// @ts-ignore
this.surfaceId = this.mXComponentController.getXComponentSurfaceId()
Logger.info(this.tag, `onLoad surfaceId: ${this.surfaceId}`)
this.curModel = CameraMode.MODE_PHOTO
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex)
})
.height('40%')
.width('40%')
Text('Camera Preview').fontSize('20fp')
Image(this.assetUri || $r('app.media.img'))
.width('40%').height('40%').border({ width: 1 }).objectFit(ImageFit.Contain)
Text('Oriented Photo').fontSize('20fp')
Button('拍照', {
type: ButtonType.Normal,
stateEffect: true
}).borderRadius(8).backgroundColor(0x317aff).width('20%').onClick(() => {
CameraService.takePicture(this.imageRotationValue, this.qualityLevelValue)
CameraService.setTakePictureCallback(this.handleTakePicture.bind(this))
this.Vue = true
})
}.width('100%').height('70%').backgroundColor(Color.White)
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
\ No newline at end of file
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation90.ets
已删除
100644 → 0
浏览文件 @
380526a1
/*
* 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 camera from '@ohos.multimedia.camera'
import Logger from '../model/Logger'
import CameraService from '../model/CameraService'
import {CustomContainer} from '../common/CameraOrientation';
import FirstDialog from '../model/FirstDialog';
const CameraMode = {
MODE_PHOTO: 0, // 拍照模式
MODE_VIDEO: 1 // 录像模式
}
@Entry
@Component
struct SetCircle {
@State FillColor: string = '#FF000000';
@State name: string = 'CameraOrientation90';
@State StepTips: string = '测试目的:用于测试相机预览和拍照旋转能力\n-左侧显示给定旋转角度后的预览窗口\n-右侧显示拍照后的图片\n-对于前置摄像头会有镜像效果'+'\n'+'预期结果:拍照图片与预览窗口的画面一致';
private tag: string = 'qlw'
private mXComponentController: XComponentController = new XComponentController()
@State surfaceId: number = 0;
@State curModel: number = CameraMode.MODE_PHOTO
@State cameraDeviceIndex: number = 0
@State imageRotationValue: number = camera.ImageRotation.ROTATION_0
@State qualityLevelValue: number = camera.QualityLevel.QUALITY_LEVEL_LOW
@State assetUri: string = undefined
@State Vue: boolean = false
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
handleTakePicture = (assetUri: string) => {
this.assetUri = assetUri
Logger.info(this.tag, `takePicture end, assetUri: ${this.assetUri}`)
}
@Builder specificNoParam() {
Column() {
}
}
build() {
Column() {
CustomContainer({
title: this.name,
Url:'pages/Camera/Camera_index',
StepTips:this.StepTips,
content: this.specificNoParam,
FillColor:$FillColor,
name:$name,
Vue: $Vue
}).height('30%').width('100%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
XComponent({
id: 'componentId',
type: 'surface',
controller: this.mXComponentController
})
.onLoad(async () => {
Logger.info(this.tag, 'onLoad is called')
// @ts-ignore
this.mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 10, surfaceHeight: 10 })
// @ts-ignore
this.surfaceId = this.mXComponentController.getXComponentSurfaceId()
Logger.info(this.tag, `onLoad surfaceId: ${this.surfaceId}`)
this.curModel = CameraMode.MODE_PHOTO
CameraService.initCamera(this.surfaceId, this.cameraDeviceIndex)
})
.height('40%')
.width('40%')
Text('Camera Preview').fontSize('20fp')
Image(this.assetUri || $r('app.media.img'))
.width('40%').height('40%').border({ width: 1 }).objectFit(ImageFit.Contain)
Text('Oriented Photo').fontSize('20fp')
Button('拍照', {
type: ButtonType.Normal,
stateEffect: true
}).borderRadius(8).backgroundColor(0x317aff).width('20%').onClick(() => {
CameraService.takePicture(this.imageRotationValue, this.qualityLevelValue)
CameraService.setTakePictureCallback(this.handleTakePicture.bind(this))
this.Vue = true
})
}.width('100%').height('70%').backgroundColor(Color.White)
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
\ No newline at end of file
validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets
浏览文件 @
d67e0639
...
...
@@ -39,12 +39,9 @@ struct IndexPage {
@State result : string = '';
@State TEST : number = 0;
private TestCaseList = [
{title:'CameraOrientation0',uri:'pages/Camera/CameraOrientation0'},
{title:'CameraOrientation90',uri:'pages/Camera/CameraOrientation90'},
{title:'CameraOrientation180',uri:'pages/Camera/CameraOrientation180'},
{title:'CameraOrientation270',uri:'pages/Camera/CameraOrientation270'},
{title:'CameraFormat',uri:'pages/Camera/CameraFormat'},
{title:'CameraVideo',uri:'pages/Camera/CameraVideo'},
{title:'Camera Orientation',uri:'pages/Camera/CameraOrientation'},
{title:'Camera Format',uri:'pages/Camera/CameraFormat'},
{title:'Camera Video',uri:'pages/Camera/CameraVideo'},
]
@State ColorObject : string[] = VarColor;
async onPageShow(){
...
...
@@ -275,30 +272,29 @@ struct IndexPage {
}
let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString();
let ignoreNum = (4-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration();
serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsCameraTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsCameraTest");
for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
validator/acts_validator/src/main/ets/pages/Experience/ColdStartTest.ets
0 → 100644
浏览文件 @
d67e0639
/*
* Copyright (c) 2022-2023 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 fileio from '@ohos.fileio';
import {CustomContainer} from '../common/StartExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog';
import context from '@ohos.app.ability.common';
let abilityContext = getContext(this) as context.UIAbilityContext;
let path = globalThis.dir;
let SettingsColdPath = path + '/coldStartSettings.log';
let PhotosColdPath = path + '/coldStartPhotos.log';
let MmsColdPath = path + '/coldStartMms.log';
let CameraColdPath = path + '/coldStartCamera.log';
let ContactsColdPath = path + '/coldStartContacts.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'ColdStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用冷启动时延低于2000ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
@State setNum: number = 0;
@State photosNum: number = 0;
@State mmsNum: number = 0;
@State cameraNum: number = 0;
@State contactsNum: number = 0;
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
}
@Builder specificNoParam() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Column(){
Row(){
Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n')
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' + `2.清空后台应用`+ '\n' + '\n'
+ `3.双击执行DeskFps.bat选择冷启动测试输入待测应用编号`+ '\n' + '\n' +`4.依次测试完所有应用冷启动返回validator界面`
+ '\n' + '\n' + '5.点击停止键观察测试结果' + '\n' + '\n' + `5.若所有冷启动测试均在规定时延内完成则通过测试`
+ '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
Column(){
Button(`开始`)
.borderRadius(8)
.backgroundColor(0x317aff)
.width('30%')
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
abilityName: "com.ohos.launcher.MainAbility",
}
abilityContext.startAbility(str).then((data) => {
}).catch((error) => {
})
})
}
Column(){
Button(`结束`)
.borderRadius(8)
.backgroundColor(0x317aff)
.width('30%')
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
/*
settings
*/
let setFd = fileio.openSync(SettingsColdPath, 0o100 | 0o2002, 0o664);
let setBuf = new ArrayBuffer(4096);
fileio.readSync(setFd,setBuf);
let setReport = String.fromCharCode.apply(null,new Uint8Array(setBuf));
let setHead = setReport.indexOf(':');
let setTime = setReport.substring(setHead+1);
this.setNum = parseFloat(setTime);
if( this.setNum < 2000 ) {
this.num++
}
/*
photos
*/
let photosFd = fileio.openSync(PhotosColdPath, 0o100 | 0o2002, 0o664);
let photosBuf = new ArrayBuffer(4096);
fileio.readSync(photosFd,photosBuf);
let photosReport = String.fromCharCode.apply(null,new Uint8Array(photosBuf));
let photosHead = photosReport.indexOf(':');
let photosTime = photosReport.substring(photosHead+1);
this.photosNum = parseFloat(photosTime);
if( this.photosNum < 2000 ) {
this.num++
}
/*
mms
*/
let MmsFd = fileio.openSync(MmsColdPath, 0o100 | 0o2002, 0o664);
let MmsBuf = new ArrayBuffer(4096);
fileio.readSync(MmsFd,MmsBuf);
let MmsReport = String.fromCharCode.apply(null,new Uint8Array(MmsBuf));
let MmsHead = MmsReport.indexOf(':');
let MmsTime = MmsReport.substring(MmsHead+1);
this.mmsNum = parseFloat(MmsTime);
if( this.mmsNum < 2000 ) {
this.num++
}
/*
camera
*/
let CameraFd = fileio.openSync(CameraColdPath, 0o100 | 0o2002, 0o664);
let CameraBuf = new ArrayBuffer(4096);
fileio.readSync(CameraFd,CameraBuf);
let CameraReport = String.fromCharCode.apply(null,new Uint8Array(CameraBuf));
let CameraHead = CameraReport.indexOf(':');
let CameraTime = CameraReport.substring(CameraHead+1);
this.cameraNum = parseFloat(CameraTime);
if( this.cameraNum < 2000 ) {
this.num++
}
/*
mms
*/
let ContactsFd = fileio.openSync(ContactsColdPath, 0o100 | 0o2002, 0o664);
let ContactsBuf = new ArrayBuffer(4096);
fileio.readSync(ContactsFd,ContactsBuf);
let ContactsReport = String.fromCharCode.apply(null,new Uint8Array(ContactsBuf));
let ContactsHead = ContactsReport.indexOf(':');
let ContactsTime = ContactsReport.substring(ContactsHead+1);
this.contactsNum = parseFloat(ContactsTime);
if( this.contactsNum < 2000 ) {
this.num++
}
if( this.num === 5 ) {
this.Vue = true;
}
})
}
}
Row(){
Text('\n' + '\n' + `测试结果:` + '设置冷启动时延' + this.setNum + 'ms' + '\n' + '图库冷启动时延' + this.photosNum
+ 'ms' + '\n'+ '信息冷启动时延' + this.mmsNum + 'ms' + '\n' + '相机冷启动时延' + this.cameraNum + 'ms' + '\n'
+ '联系人冷启动时延' + this.contactsNum + 'ms' + '\n' + '通过冷启动测试项' + this.num + '个')
.fontColor(Color.White).fontSize('24fp')
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
.justifyContent(FlexAlign.SpaceEvenly)
}
build() {
Column() {
CustomContainer({
title: this.name,
Url:'pages/Experience/Experience_index',
StepTips:this.StepTips,
content: this.specificNoParam,
name:$name,
Vue: $Vue,
StartEnable: $StartEnable,
num: $num,
setNum: $setNum,
photosNum: $photosNum,
mmsNum: $mmsNum,
cameraNum: $cameraNum,
contactsNum: $contactsNum,
})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets
浏览文件 @
d67e0639
...
...
@@ -83,11 +83,26 @@ struct CustomContainerUser {
let buf = new ArrayBuffer(4096);
fileio.readSync(fd,buf);
let report = String.fromCharCode.apply(null,new Uint8Array(buf));
let head = report.indexOf(':');
let headList = new Array();
let endList = new Array();
let head = report.indexOf(":");
let end = report.indexOf('|');
this.Fps = report.substring(head+1,end);
let num = Number(this.Fps)
if(num >= 54 ) {
let Fps = new Array();
while(head > -1){
headList.push(head);
head = report.indexOf(":",head + 1);
}
while(end > -1){
endList.push(end);
end = report.indexOf("|",end + 1);
}
for(let i = 0; i < headList.length; i++) {
Fps[i] = Number(report.substring(headList[i]+1,endList[i]));
}
let maxFps = Math.max(...Fps);
this.Fps = maxFps.toString();
if(maxFps >= 54) {
this.Vue = true;
}
})
...
...
validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets
浏览文件 @
d67e0639
...
...
@@ -41,6 +41,8 @@ struct IndexPage {
private TestCaseList = [
{title:'DeskFps',uri:'pages/Experience/DeskFps'},
{title:'PhotoFps',uri:'pages/Experience/PhotoFps'},
{title:'ColdStart',uri:'pages/Experience/ColdStartTest'},
{title:'HotStart',uri:'pages/Experience/HotStartTest'},
]
@State ColorObject : string[] = VarColor;
async onPageShow(){
...
...
@@ -271,30 +273,29 @@ struct IndexPage {
}
let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration();
serializer.startElement("testsuite");
serializer.setAttributes("name","ActsExperienceTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsExperienceTest");
for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets
0 → 100644
浏览文件 @
d67e0639
/*
* Copyright (c) 2022-2023 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 fileio from '@ohos.fileio';
import {CustomContainer} from '../common/StartExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog';
import context from '@ohos.app.ability.common';
let abilityContext = getContext(this) as context.UIAbilityContext;
let path = globalThis.dir;
let SettingsColdPath = path + '/hotStartSettings.log';
let PhotosColdPath = path + '/hotStartPhotos.log';
let MmsColdPath = path + '/hotStartMms.log';
let CameraColdPath = path + '/hotStartCamera.log';
let ContactsColdPath = path + '/hotStartContacts.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'HotStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用热启动时延低于1000ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
@State setNum: number = 0;
@State photosNum: number = 0;
@State mmsNum: number = 0;
@State cameraNum: number = 0;
@State contactsNum: number = 0;
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
}
@Builder specificNoParam() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Column(){
Row(){
Text(`根据以下操作步骤完成测试`+ '\n' + '\n' )
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' + `2.开启应用回退到桌面,保证此时后台应用存在`+ '\n' + '\n'
+ `3.双击执行.bat选择热启动测试输入待测应用编号`+ '\n' + '\n' +`4.依次测试完所有应用冷启动返回validator界面`
+ '\n' + '\n' + '5.点击停止键观察测试结果' + '\n' + '\n' + `5.若所有热启动测试均在规定时延内完成则通过测试`
+ '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
Column(){
Button(`开始`)
.borderRadius(8)
.backgroundColor(0x317aff)
.width('30%')
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
abilityName: "com.ohos.launcher.MainAbility",
}
abilityContext.startAbility(str).then((data) => {
}).catch((error) => {
})
})
}
Column(){
Button(`结束`)
.borderRadius(8)
.backgroundColor(0x317aff)
.width('30%')
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
/*
settings
*/
let setFd = fileio.openSync(SettingsColdPath, 0o100 | 0o2002, 0o664);
let setBuf = new ArrayBuffer(4096);
fileio.readSync(setFd,setBuf);
let setReport = String.fromCharCode.apply(null,new Uint8Array(setBuf));
let setHead = setReport.indexOf(':');
let setTime = setReport.substring(setHead+1);
this.setNum = parseFloat(setTime);
if( this.setNum < 1000 ) {
this.num++
}
/*
photos
*/
let photosFd = fileio.openSync(PhotosColdPath, 0o100 | 0o2002, 0o664);
let photosBuf = new ArrayBuffer(4096);
fileio.readSync(photosFd,photosBuf);
let photosReport = String.fromCharCode.apply(null,new Uint8Array(photosBuf));
let photosHead = photosReport.indexOf(':');
let photosTime = photosReport.substring(photosHead+1);
this.photosNum = parseFloat(photosTime);
if( this.photosNum < 1000 ) {
this.num++
}
/*
mms
*/
let MmsFd = fileio.openSync(MmsColdPath, 0o100 | 0o2002, 0o664);
let MmsBuf = new ArrayBuffer(4096);
fileio.readSync(MmsFd,MmsBuf);
let MmsReport = String.fromCharCode.apply(null,new Uint8Array(MmsBuf));
let MmsHead = MmsReport.indexOf(':');
let MmsTime = MmsReport.substring(MmsHead+1);
this.mmsNum = parseFloat(MmsTime);
if( this.mmsNum < 1000 ) {
this.num++
}
/*
camera
*/
let CameraFd = fileio.openSync(CameraColdPath, 0o100 | 0o2002, 0o664);
let CameraBuf = new ArrayBuffer(4096);
fileio.readSync(CameraFd,CameraBuf);
let CameraReport = String.fromCharCode.apply(null,new Uint8Array(CameraBuf));
let CameraHead = CameraReport.indexOf(':');
let CameraTime = CameraReport.substring(CameraHead+1);
this.cameraNum = parseFloat(CameraTime);
if( this.cameraNum < 1000 ) {
this.num++
}
/*
mms
*/
let ContactsFd = fileio.openSync(ContactsColdPath, 0o100 | 0o2002, 0o664);
let ContactsBuf = new ArrayBuffer(4096);
fileio.readSync(ContactsFd,ContactsBuf);
let ContactsReport = String.fromCharCode.apply(null,new Uint8Array(ContactsBuf));
let ContactsHead = ContactsReport.indexOf(':');
let ContactsTime = ContactsReport.substring(ContactsHead+1);
this.contactsNum = parseFloat(ContactsTime);
if( this.contactsNum < 1000 ) {
this.num++
}
if( this.num === 5 ) {
this.Vue = true;
}
})
}
}
Row(){
Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '设置热启动时延' + this.setNum + 'ms'
+ '\n' + '图库热启动时延' + this.photosNum + 'ms' + '\n'+ '信息热启动时延' + this.mmsNum + 'ms' + '\n'
+ '相机热启动时延' + this.cameraNum + 'ms' + '\n'+ '联系人热启动时延' + this.contactsNum + 'ms' + '\n'
+ '通过热启动测试项' + this.num + '个' )
.fontColor(Color.White).fontSize('24fp')
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
.justifyContent(FlexAlign.SpaceEvenly)
}
build() {
Column() {
CustomContainer({
title: this.name,
Url:'pages/Experience/Experience_index',
StepTips:this.StepTips,
content: this.specificNoParam,
name:$name,
Vue: $Vue,
StartEnable: $StartEnable,
num: $num,
setNum: $setNum,
photosNum: $photosNum,
mmsNum: $mmsNum,
cameraNum: $cameraNum,
contactsNum: $contactsNum,
})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
浏览文件 @
d67e0639
...
...
@@ -86,11 +86,26 @@ struct CustomContainerUser {
let buf = new ArrayBuffer(4096);
fileio.readSync(fd,buf);
let report = String.fromCharCode.apply(null,new Uint8Array(buf));
let head = report.indexOf(':');
let headList = new Array();
let endList = new Array();
let head = report.indexOf(":");
let end = report.indexOf('|');
this.Fps = report.substring(head+1,end);
let num = Number(this.Fps)
if(num >= 54) {
let Fps = new Array();
while(head > -1){
headList.push(head);
head = report.indexOf(":",head + 1);
}
while(end > -1){
endList.push(end);
end = report.indexOf("|",end + 1);
}
for(let i = 0; i < headList.length; i++) {
Fps[i] = Number(report.substring(headList[i]+1,endList[i]));
}
let maxFps = Math.max(...Fps);
this.Fps = maxFps.toString();
if(maxFps >= 54) {
this.Vue = true;
}
})
...
...
validator/acts_validator/src/main/ets/pages/Experience/ScrollListTest.ets
已删除
100644 → 0
浏览文件 @
380526a1
/*
* 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 {CustomContainer} from '../common/CustomContainer';
import FirstDialog from '../model/FirstDialog';
@Entry
@Component
struct CustomContainerUser {
private listArr: number[] = Array.from(new Array(50).keys());
@State name: string = 'ScrollingList';
@State StepTips: string = '操作步骤:滑动列表观察是否能正常滑动'+'\n'+'预期结果:列表滑动正常';
@State Vue: boolean = false;
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = true;
}
@Builder specificNoParam() {
Column() {
List() {
ForEach(this.listArr,(item:any,index:number) => {
ListItem() {
Text('Item #' + (index + 1)).width('100%').height(50).fontSize(16).fontColor(Color.White).margin({left:'10vp'})
}
},index => index)
}.height('100%').width('100%').divider({strokeWidth:1,color:Color.Grey})
}.height('83%').width('100%')
}
build() {
Column() {
CustomContainer({
title: this.name,
Url: 'pages/Experience/Experience_index',
StepTips: this.StepTips,
content: this.specificNoParam.bind(this),
name: $name,
Vue: $Vue,
})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
}
validator/acts_validator/src/main/ets/pages/Player/Player_index.ets
浏览文件 @
d67e0639
...
...
@@ -270,30 +270,29 @@ struct IndexPage {
}
let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration();
serializer.startElement("testsuite");
serializer.setAttributes("name","ActsPlayerTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsPlayerTest");
for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
validator/acts_validator/src/main/ets/pages/common/CameraOrientation.ets
浏览文件 @
d67e0639
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022
-2023
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
...
...
validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets
浏览文件 @
d67e0639
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022
-2023
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
...
...
validator/acts_validator/src/main/ets/pages/common/StartExperienceCustomContainer.ets
0 → 100644
浏览文件 @
d67e0639
/*
* Copyright (c) 2022-2023 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 prompt from '@ohos.prompt';
import fileio from '@ohos.fileio';
import router from '@ohos.router';
import screenshot from '@ohos.screenshot';
import image from '@ohos.multimedia.image';
import Logger from '../model/Logger';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
let path = globalThis.dir;
const TAG = '[Screenshot]';
@Component
export struct CustomContainer {
@Link name : string;
title : string = '';
StepTips: string = '';
Url : string = '';
@Link StartEnable : boolean
@Link Vue : boolean;
@Link num : number;
@Link setNum : number;
@Link photosNum : number;
@Link mmsNum : number;
@Link cameraNum : number;
@Link contactsNum : number;
@BuilderParam content: () => void;
@Builder
PassBtn(text: Resource, isFullScreen: boolean) {
if(this.Vue == false){
Button({stateEffect:this.Vue}) {
Image($r('app.media.ic_public_pass')).width('20vp').height('20vp')
}.width('30%').height('30vp').backgroundColor(Color.Grey).opacity(0.4)
.onClick(()=>{
})
}
else{
Button({stateEffect:this.Vue}) {
Image($r('app.media.ic_public_pass')).width('20vp').height('20vp')
}.width('30%').height('30vp').backgroundColor(Color.Grey)
.onClick(()=>{
router.back({
url:this.Url,
params: {result : 'Pass', title : this.name,
}
})
this.getScreen(isFullScreen);
prompt.showToast({
message: '通过', duration: 1000
});
})
}
}
@Builder
FailBtn(text: Resource, isFullScreen: boolean) {
Button(){
Image($r('app.media.ic_public_fail')).width('20vp').height('20vp')
}.width('30%').height('30vp').backgroundColor(Color.Grey)
.onClick(()=>{
router.back({
url:this.Url,
params: {result : 'Fail',title : this.name,
}
})
this.getScreen(isFullScreen);
prompt.showToast({
message: '失败', duration: 1000
});
})
}
build() {
Column() {
Row() {
Button(){
Image($r('app.media.ic_public_back')).width('20vp').height('18vp').margin({left:'20vp'})
}.backgroundColor(Color.Black)
.onClick(()=>{
router.back({
url:this.Url,
params: {result : 'None',}
})
})
Text(this.title).fontColor(Color.White).fontSize('18fp').margin({left:'-20vp'})
Text('hello').fontColor(Color.White).visibility(Visibility.Hidden)
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
this.content();
Blank()
Row() {
this.PassBtn($r('app.string.btn_fullscreen'), true);
Button(){
Image($r('app.media.ic_public_help')).width('20vp').height('20vp')
}.width('30%').height('30vp').backgroundColor(Color.Grey)
.onClick(() =>{
AlertDialog.show({
title:'操作提示',
message: this.StepTips,
confirm:{
value:'OK',
action:()=>{
}
}
})
})
this.FailBtn($r('app.string.btn_fullscreen'), true);
}.width('100%').justifyContent(FlexAlign.SpaceEvenly).backgroundColor(Color.Black)
}.height('98%').width('100%')
}
async savePicture(data: image.PixelMap, context: any) {
Logger.info(TAG, `savePicture`);
let packOpts: image.PackingOption = {
format: "image/jpeg", quality: 100
};
let info = {
prefix: 'IMG_', suffix: '.jpg', directory: mediaLibrary.DirectoryType.DIR_IMAGE
};
let name = this.name;
let displayName = `${info.prefix}${name}${info.suffix}`;
let dirPath = path + '/screenshot' + '/' + displayName;
let imagePackerApi = image.createImagePacker();
let arrayBuffer = await imagePackerApi.packing(data, packOpts);
let fd = fileio.openSync(dirPath,0o102,0o666);
imagePackerApi.release();
try {
await fileio.write(fd, arrayBuffer);
} catch (err) {
Logger.error(`write failed, code is ${err.code}, message is ${err.message}`);
}
await fileio.close(fd);
Logger.info(TAG, `write done`);
}
getScreen = (isFullScreen: boolean) => {
let screenshotOptions: screenshot.ScreenshotOptions = {
screenRect: { left: 0, top: 0, width: 400, height: 400 },
imageSize: { width: 400, height: 400 },
rotation: 0,
displayId: 0
};
if (isFullScreen) {
screenshotOptions = {
rotation: 0
}
}
try {
screenshot.save(screenshotOptions, (err, data: image.PixelMap) => {
if (err) {
Logger.info(TAG, `Failed to save the screenshot. Error:${JSON.stringify(err)}`);
}
Logger.info(TAG, 'save callback');
this.savePicture(data, getContext(this) as any);
})
} catch (err) {
Logger.error(`save failed, code is ${err.code}, message is ${err.message}`);
}
}
}
validator/acts_validator/src/main/ets/pages/index.ets
浏览文件 @
d67e0639
...
...
@@ -323,7 +323,6 @@ struct IndexPage {
}
let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString();
let ignoreNum = (54-TestNum).toString();
/*
* ArkUI
*/
...
...
@@ -343,8 +342,7 @@ struct IndexPage {
ArkUIPassIndex = ArkUIReport.indexOf('Pass',ArkUIPassIndex + 1);
}
let ArkUITestNum = ArkUIFailNum + ArkUIPassNum;
let ArkuiTestNum = (ArkUIPassNum).toString();
let ArkUIIgnoreNum = (23-ArkUITestNum).toString();
let ArkuiTestNum = (ArkUITestNum).toString();
/*
* Audio
*/
...
...
@@ -364,8 +362,7 @@ struct IndexPage {
AudioPassIndex = AudioReport.indexOf('Pass',AudioPassIndex + 1);
}
let AudioTestNum = AudioFailNum + AudioPassNum;
let audioTestNum = (AudioPassNum).toString();
let AudioIgnoreNum = (28-AudioTestNum).toString();
let audioTestNum = (AudioTestNum).toString();
/*
* Camera
*/
...
...
@@ -385,8 +382,7 @@ struct IndexPage {
CameraPassIndex = CameraReport.indexOf('Pass',CameraPassIndex + 1);
}
let CameraTestNum = CameraFailNum + CameraPassNum;
let cameraTestNum = (CameraPassNum).toString();
let CameraIgnoreNum = (28-CameraTestNum).toString();
let cameraTestNum = (CameraTestNum).toString();
/*
* Player
*/
...
...
@@ -406,8 +402,7 @@ struct IndexPage {
PlayerPassIndex = PlayerReport.indexOf('Pass',PlayerPassIndex + 1);
}
let PlayerTestNum = PlayerFailNum + PlayerPassNum;
let playerTestNum = (PlayerPassNum).toString();
let PlayerIgnoreNum = (28-PlayerTestNum).toString();
let playerTestNum = (PlayerTestNum).toString();
/*
* Experience
*/
...
...
@@ -427,8 +422,7 @@ struct IndexPage {
ExperiencePassIndex = ExperienceReport.indexOf('Pass',ExperiencePassIndex + 1);
}
let ExperienceTestNum = ExperienceFailNum + ExperiencePassNum;
let experienceTestNum = (ExperiencePassNum).toString();
let ExperienceIgnoreNum = (28-ExperienceTestNum).toString();
let experienceTestNum = (ExperienceTestNum).toString();
let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer);
...
...
@@ -445,30 +439,30 @@ struct IndexPage {
serializer.setAttributes("ignored", "0");
serializer.setAttributes("unavailable", "0");
serializer.setAttributes("productinfo", "{ }");
serializer.setAttributes("modules", "");
serializer.setAttributes("runmodules", "");
serializer.setAttributes("modules", "
*
");
serializer.setAttributes("runmodules", "
*
");
/*
* ArkUI
*/
serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsArkUITest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", ArkuiFailNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", ArkuiTestNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsArkUITest");
for (let i = 0; i < title1.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title1[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result1[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
@@ -477,23 +471,23 @@ struct IndexPage {
*/
serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsAudioTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", audioFailNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", audioTestNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsAudioTest");
for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title2[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result2[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
@@ -502,23 +496,23 @@ struct IndexPage {
*/
serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsCameraTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", cameraFailNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", cameraTestNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsCameraTest");
for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title3[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result3[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
@@ -527,23 +521,23 @@ struct IndexPage {
*/
serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsPlayerTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", playerFailNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", playerTestNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsPlayerTest");
for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title4[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result4[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
@@ -552,23 +546,23 @@ struct IndexPage {
*/
serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsExperienceTest");
serializer.setAttributes("time", "");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", experienceFailNum);
serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", experienceTestNum);
serializer.setAttributes("message", "");
serializer.setAttributes("message", "
*
");
serializer.setAttributes("modulename", "ActsExperienceTest");
for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase");
serializer.setAttributes("name", String(title5[i]));
serializer.setAttributes("status", "");
serializer.setAttributes("time", "");
serializer.setAttributes("classname", "");
serializer.setAttributes("status", "
*
");
serializer.setAttributes("time", "
*
");
serializer.setAttributes("classname", "
*
");
serializer.setAttributes("result", String(result5[i]));
serializer.setAttributes("level", "");
serializer.setAttributes("message", "");
serializer.setAttributes("level", "
*
");
serializer.setAttributes("message", "
*
");
serializer.endElement();
}
serializer.endElement();
...
...
validator/acts_validator/src/main/resources/base/profile/main_pages.json
浏览文件 @
d67e0639
...
...
@@ -27,10 +27,6 @@
"pages/ArkUI/CanvasLineDashOffset"
,
"pages/ArkUI/CanvasShadowOffsetY"
,
"pages/Camera/Camera_index"
,
"pages/Camera/CameraOrientation0"
,
"pages/Camera/CameraOrientation90"
,
"pages/Camera/CameraOrientation180"
,
"pages/Camera/CameraOrientation270"
,
"pages/Camera/CameraFormat"
,
"pages/Camera/CameraVideo"
,
"pages/Audio/Audio_index"
,
...
...
@@ -39,6 +35,8 @@
"pages/Player/ScrollListTest"
,
"pages/Experience/Experience_index"
,
"pages/Experience/PhotoFps"
,
"pages/Experience/DeskFps"
"pages/Experience/DeskFps"
,
"pages/Experience/ColdStartTest"
,
"pages/Experience/HotStartTest"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录