diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets index 80abc99161879e737f481087c1783603904076f1..a3652c4bab8af578c6b9e828a97b71b08e3c7a5a 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets @@ -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(); diff --git a/validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets b/validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets index 02728690de4f18aa4fb7e6ef7e91ba6a5a8d31ae..51bb57324f531a401b8a5600368ea81f2717b799 100644 --- a/validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets +++ b/validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets @@ -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(); diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation0.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation0.ets deleted file mode 100644 index e82fbd028e546e2e5fe2d1c2514b6e4fd3ee109c..0000000000000000000000000000000000000000 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation0.ets +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation180.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation180.ets deleted file mode 100644 index a94a383d0d14071b3d91a3480bd55485a3c0a0f9..0000000000000000000000000000000000000000 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation180.ets +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation270.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation270.ets deleted file mode 100644 index b751b107eb89aeb6f8a39e060e2cf070ac6eb00d..0000000000000000000000000000000000000000 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation270.ets +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation90.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation90.ets deleted file mode 100644 index 9fdef81064c5a4a9c9f6b9a67125cd249e50baaa..0000000000000000000000000000000000000000 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation90.ets +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 diff --git a/validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets b/validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets index d496a102d98eef1498cf270b9d1317793f037613..e011a2aefd03d2f8b3dd88e69e223bd2efdf1ac5 100644 --- a/validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets +++ b/validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets @@ -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(); diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ColdStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/ColdStartTest.ets new file mode 100644 index 0000000000000000000000000000000000000000..3337e65e409e36d84084ef4f3bbb770c07fc6a9d --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/ColdStartTest.ets @@ -0,0 +1,193 @@ +/* + * 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) + } +} diff --git a/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets b/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets index 756c21e5e634851700c46e9ce35f3cf2d63abee1..941b36cd7a2e1373b7cb9ec80c2404bc3fbdea42 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets @@ -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; } }) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets b/validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets index 82244242817ec4f537eeb496c3717ec5d47e39d4..80cf922b2c70ba4dd90381336c1d114aec818e86 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets @@ -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(); diff --git a/validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3c7052a037e27e55b98eccb0c994e2faa8dc7f8 --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets @@ -0,0 +1,194 @@ +/* + * 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) + } +} diff --git a/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets b/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets index f8ac4805d29251ee35ea039f6db0958ca3256b1a..f49ed7e1ad765afd5d2e7b13aec8b37559748310 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets @@ -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; } }) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ScrollListTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/ScrollListTest.ets deleted file mode 100644 index 63dcb6fe1788636dbd7a9e5570a1fc16d1e089c7..0000000000000000000000000000000000000000 --- a/validator/acts_validator/src/main/ets/pages/Experience/ScrollListTest.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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) - } -} diff --git a/validator/acts_validator/src/main/ets/pages/Player/Player_index.ets b/validator/acts_validator/src/main/ets/pages/Player/Player_index.ets index 16fbfcd652f200acd0fd96738a15a92636eced03..3763ad6686687ec78c337f04a9a88b9b20722602 100644 --- a/validator/acts_validator/src/main/ets/pages/Player/Player_index.ets +++ b/validator/acts_validator/src/main/ets/pages/Player/Player_index.ets @@ -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(); diff --git a/validator/acts_validator/src/main/ets/pages/common/CameraOrientation.ets b/validator/acts_validator/src/main/ets/pages/common/CameraOrientation.ets index 5139d40a5ae719fdc411c97a50f3ed476e3190b7..ebef726e687419b0c1874639b97fb57721bf1b10 100644 --- a/validator/acts_validator/src/main/ets/pages/common/CameraOrientation.ets +++ b/validator/acts_validator/src/main/ets/pages/common/CameraOrientation.ets @@ -1,5 +1,5 @@ /* - * 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 diff --git a/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets b/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets index 53650d231fddf5be156fcec1e056c460ebfefee5..b9eca1d48e01ec66b348543cc24b2def8f87c16c 100644 --- a/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets +++ b/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets @@ -1,5 +1,5 @@ /* - * 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 diff --git a/validator/acts_validator/src/main/ets/pages/common/StartExperienceCustomContainer.ets b/validator/acts_validator/src/main/ets/pages/common/StartExperienceCustomContainer.ets new file mode 100644 index 0000000000000000000000000000000000000000..46a89a3eeb9b1d44ec00a49a6f40bf969880ab8c --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/common/StartExperienceCustomContainer.ets @@ -0,0 +1,170 @@ +/* + * 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}`); + } + } +} diff --git a/validator/acts_validator/src/main/ets/pages/index.ets b/validator/acts_validator/src/main/ets/pages/index.ets index 2faa930076f14c0c43f9130838b8034217df7ad8..34a6af180ce36cdbc84cece12b2524f949b5b3b8 100644 --- a/validator/acts_validator/src/main/ets/pages/index.ets +++ b/validator/acts_validator/src/main/ets/pages/index.ets @@ -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(); diff --git a/validator/acts_validator/src/main/resources/base/profile/main_pages.json b/validator/acts_validator/src/main/resources/base/profile/main_pages.json index 75715250c0a1d97d65e4e7b229638d0ae2936f88..f1aa13c4351eaa549ba00d3ae0c1561e4cbf6c2f 100644 --- a/validator/acts_validator/src/main/resources/base/profile/main_pages.json +++ b/validator/acts_validator/src/main/resources/base/profile/main_pages.json @@ -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" ] }