diff --git a/validator/acts_validator/src/main/ets/pages/Experience/CameraColdStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/CameraColdStartTest.ets index e6ee4150df09647def4c0bfba6c956396f99fb89..a1d9a0388551b386a444006a30ba814bfdf90600 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/CameraColdStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/CameraColdStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' - + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>相机测试,回车执行` - + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' - + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' + + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>相机测试,回车执行` + + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + 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('time:'); + let CameraTime = CameraReport.substring(CameraHead+5); + this.cameraNum = parseFloat(CameraTime); + if( 0 < this.cameraNum && this.cameraNum < 2300 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - 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('time:'); - let CameraTime = CameraReport.substring(CameraHead+5); - this.cameraNum = parseFloat(CameraTime); - if( 0 < this.cameraNum && this.cameraNum < 2300 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '相机冷启动时延' + this.cameraNum + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '相机冷启动时延' + this.cameraNum + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets index f9f7ec19763efe1412c3e72a114d41e9fd09bd88..02c7914ed433d62c223b841289e1215ff6cdd39d 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' - + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>联系人测试,回车执行` - + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' - + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' + + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>联系人测试,回车执行` + + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + Contacts + */ + 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('time:'); + let ContactsTime = ContactsReport.substring(ContactsHead+5); + this.contactsNum = parseFloat(ContactsTime); + if( 0 < this.contactsNum && this.contactsNum < 2300 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - Contacts - */ - 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('time:'); - let ContactsTime = ContactsReport.substring(ContactsHead+5); - this.contactsNum = parseFloat(ContactsTime); - if( 0 < this.contactsNum && this.contactsNum < 2300 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '联系人冷启动时延' + this.contactsNum + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '联系人冷启动时延' + this.contactsNum + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets index 0970966c7ba6180380feab3c64896d3cd7d0c3d8..6047316c4bb617fcdf5b94d534246051ed398b6e 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' - + `3.开启联系人应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>联系人测试`+ '\n' + '\n' + - `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' - + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' + + `3.开启联系人应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>联系人测试`+ '\n' + '\n' + + `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' + + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + Contacts + */ + 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( 0 < this.contactsNum && this.contactsNum < 600 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - Contacts - */ - 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( 0 < this.contactsNum && this.contactsNum < 600 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n' + '联系人热启动时延' + this.contactsNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n' + '联系人热启动时延' + this.contactsNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) 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 1b501368a1a4f4ea0748d4cdd679c279d00d42fe..ab1e18054ec9187ad1819c0c867e58a73cf656e7 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets @@ -31,6 +31,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State Fps: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -39,83 +40,84 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' - + `3.工作台运行’点击启动测试.bat‘选择帧率>桌面`+ '\n' + '\n' +`4.左右滑动系统桌面连续10s以上` + '\n' + '\n' - + '5.回到DeskFps测试项点击结束键' + '\n' + '\n' + `6.若测试最高帧率大于55帧则通过测试` - + '\n' + '\n' + '\n' + '\n' + '\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.StartEnable = !this.StartEnable; - let str = { - bundleName:"com.ohos.launcher", - abilityName: "com.ohos.launcher.MainAbility", - } - abilityContext.startAbility(str).then((data) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' + + `3.工作台运行’点击启动测试.bat‘选择帧率>桌面`+ '\n' + '\n' +`4.左右滑动系统桌面连续10s以上` + '\n' + '\n' + + '5.回到DeskFps测试项点击结束键' + '\n' + '\n' + `6.若测试最高帧率大于55帧则通过测试` + + '\n' + '\n' + '\n' + '\n' + '\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.StartEnable = !this.StartEnable; + let str = { + bundleName:"com.ohos.launcher", + abilityName: "com.ohos.launcher.MainAbility", + } + abilityContext.startAbility(str).then((data) => { - }).catch((error) => { + }).catch((error) => { + }) }) - }) - } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let headList = new Array(); - let endList = new Array(); - let head = report.indexOf(":"); - let end = report.indexOf('|'); - let Fps = new Array(); + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let headList = new Array(); + let endList = new Array(); + let head = report.indexOf(":"); + let end = report.indexOf('|'); + 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 >= 55) { - this.Vue = true; - } - }) + 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 >= 55) { + this.Vue = true; + } + }) + } + } + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `测试结果:` + this.Fps + '帧' ) + .fontColor(Color.White).fontSize('24fp') } - } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `测试结果:` + this.Fps + '帧' ) - .fontColor(Color.White).fontSize('24fp') } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets index 392d37aba35e3f26733164292eb34a084230ffeb..0f9f72da296b6b2f25f4df8275137095077fdb6e 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets @@ -29,6 +29,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -37,70 +38,71 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入信息` + '\n' + '\n' + - '3.新建一条信息显示输入框'+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择完成时延>键盘按键弹出`+ '\n' + '\n' + - `5.点击输入框等待键盘弹出` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' - + `7.若弹出键盘时延小于或等于1000ms则通过测试` + '\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.StartEnable = !this.StartEnable; - let bundleName=new String("com.ohos.mms").toString(); - let abilityName=new String("com.ohos.mms.MainAbility").toString(); - let str = { - "bundleName": bundleName, - "abilityName": abilityName, - } + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入信息` + '\n' + '\n' + + '3.新建一条信息显示输入框'+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择完成时延>键盘按键弹出`+ '\n' + '\n' + + `5.点击输入框等待键盘弹出` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + + `7.若弹出键盘时延小于或等于1000ms则通过测试` + '\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.StartEnable = !this.StartEnable; + let bundleName=new String("com.ohos.mms").toString(); + let abilityName=new String("com.ohos.mms.MainAbility").toString(); + let str = { + "bundleName": bundleName, + "abilityName": abilityName, + } - globalThis.abilityContext.startAbility(str, (err, data) => { - if(err) { - return; + globalThis.abilityContext.startAbility(str, (err, data) => { + if(err) { + return; + } + }) + }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 1000 ) { + this.Vue = true; } }) - }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 1000 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `输入键盘弹出时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `输入键盘弹出时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets index b1f6222ba2a85d795801056853f64894d1fca14a..a5fcebe723ef7f9be730f6dd79afd92b4aa77297 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets @@ -29,6 +29,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -37,70 +38,71 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入信息` + '\n' + '\n' + - '3.新建一条信息点击输入框打开键盘'+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>键盘按键输入`+ '\n' + '\n' - +`5.随意点击按键等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + - `7.若按键响应时延小于或等于150ms则通过测试` + '\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.StartEnable = !this.StartEnable; - let bundleName=new String("com.ohos.mms").toString(); - let abilityName=new String("com.ohos.mms.MainAbility").toString(); - let str = { - "bundleName": bundleName, - "abilityName": abilityName, - } + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入信息` + '\n' + '\n' + + '3.新建一条信息点击输入框打开键盘'+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>键盘按键输入`+ '\n' + '\n' + +`5.随意点击按键等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + + `7.若按键响应时延小于或等于150ms则通过测试` + '\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.StartEnable = !this.StartEnable; + let bundleName=new String("com.ohos.mms").toString(); + let abilityName=new String("com.ohos.mms.MainAbility").toString(); + let str = { + "bundleName": bundleName, + "abilityName": abilityName, + } - globalThis.abilityContext.startAbility(str, (err, data) => { - if(err) { - return; + globalThis.abilityContext.startAbility(str, (err, data) => { + if(err) { + return; + } + }) + }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 150 ) { + this.Vue = true; } }) - }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 150 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `按键响应时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `按键响应时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets index 80b01630b4ed59de8492571d1c01e8a549ac6e02..90f904ab5ab36596a992a671893a0b6d57030724 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' - + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>信息测试,回车执行` - + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' - + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' + + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>信息测试,回车执行` + + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + 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('time:'); + let MmsTime = MmsReport.substring(MmsHead+5); + this.mmsNum = parseFloat(MmsTime); + if( 0 < this.mmsNum && this.mmsNum < 2300 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - 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('time:'); - let MmsTime = MmsReport.substring(MmsHead+5); - this.mmsNum = parseFloat(MmsTime); - if( 0 < this.mmsNum && this.mmsNum < 2300 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '信息冷启动时延' + this.mmsNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '信息冷启动时延' + this.mmsNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets index 7bd418e1722ea985bcf58bc67f7c19712e9fd55f..2a048015e9187acbd912cc4215281fa924e2ada4 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' - + `3.开启信息应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>信息测试`+ '\n' + '\n' + - `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' - + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' + + `3.开启信息应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>信息测试`+ '\n' + '\n' + + `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' + + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + 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( 0 < this.mmsNum && this.mmsNum < 600 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - 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( 0 < this.mmsNum && this.mmsNum < 600 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n'+ '信息热启动时延' + this.mmsNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n'+ '信息热启动时延' + this.mmsNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) 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 7153321f4c151755b093409df2f2263ab06acce7..eca7979c2c7c38401d950b828dcce93f60ef78fd 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets @@ -29,6 +29,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State Fps: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -37,86 +38,87 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n' - + `3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择帧率>图库`+ '\n' + '\n' + - `5.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '6.回到PhotoFps测试项点击结束键' + '\n' + '\n' + - `7.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\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.StartEnable = !this.StartEnable; - let bundleName=new String("com.ohos.photos").toString(); - let abilityName=new String("com.ohos.photos.MainAbility").toString(); - let str = { - "bundleName": bundleName, - "abilityName": abilityName, - } + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n' + + `3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择帧率>图库`+ '\n' + '\n' + + `5.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '6.回到PhotoFps测试项点击结束键' + '\n' + '\n' + + `7.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\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.StartEnable = !this.StartEnable; + let bundleName=new String("com.ohos.photos").toString(); + let abilityName=new String("com.ohos.photos.MainAbility").toString(); + let str = { + "bundleName": bundleName, + "abilityName": abilityName, + } + + globalThis.abilityContext.startAbility(str, (err, data) => { + if(err) { + return; + } + }) + }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let headList = new Array(); + let endList = new Array(); + let head = report.indexOf(":"); + let end = report.indexOf('|'); + let Fps = new Array(); - globalThis.abilityContext.startAbility(str, (err, data) => { - if(err) { - return; + 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 >= 55) { + this.Vue = true; } }) - }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let headList = new Array(); - let endList = new Array(); - let head = report.indexOf(":"); - let end = report.indexOf('|'); - 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 >= 55) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `测试结果:` + this.Fps + '帧' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `测试结果:` + this.Fps + '帧' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/PhotosColdStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/PhotosColdStartTest.ets index 170a9aa0ce7e5a47f1a918afe03c0c9d0a22d0c8..83f4448447dc8d1404f4146ce9e23a4a9523d206 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/PhotosColdStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/PhotosColdStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' - + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>图库测试,回车执行` - + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' - + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' + + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>图库测试,回车执行` + + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + 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('time:'); + let photosTime = photosReport.substring(photosHead+5); + this.photosNum = parseFloat(photosTime); + if( 0 < this.photosNum && this.photosNum < 2300 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - 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('time:'); - let photosTime = photosReport.substring(photosHead+5); - this.photosNum = parseFloat(photosTime); - if( 0 < this.photosNum && this.photosNum < 2300 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '图库冷启动时延' + this.photosNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '图库冷启动时延' + this.photosNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets index 2d6a5cfdc35c6a1e7f56a341ccfc95f9ef14c02f..a9a0fa21598083fee4067682271645639d58035b 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' - + `3.开启图库应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>图库测试`+ '\n' + '\n' + - `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' - + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' + + `3.开启图库应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>图库测试`+ '\n' + '\n' + + `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' + + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + /* + 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( 0 < this.photosNum && this.photosNum < 600 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - /* - 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( 0 < this.photosNum && this.photosNum < 600 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n' + '图库热启动时延' + this.photosNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n' + '图库热启动时延' + this.photosNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets b/validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets index 8894fdb6f5185ddf04e7d2fb024ded16d5c7578f..fadedd0f6695d27e346f7c88b1dc8545fcb981bd 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets @@ -29,6 +29,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -37,70 +38,71 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n' - +`3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>图库缩略列表滑动`+ '\n' + '\n' + - `5.滑动图库缩略列表等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + - `7.若滑动响应时延小于或等于150ms则通过测试` + '\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.StartEnable = !this.StartEnable; - let bundleName=new String("com.ohos.photos").toString(); - let abilityName=new String("com.ohos.photos.MainAbility").toString(); - let str = { - "bundleName": bundleName, - "abilityName": abilityName, - } + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n' + +`3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>图库缩略列表滑动`+ '\n' + '\n' + + `5.滑动图库缩略列表等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + + `7.若滑动响应时延小于或等于150ms则通过测试` + '\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.StartEnable = !this.StartEnable; + let bundleName=new String("com.ohos.photos").toString(); + let abilityName=new String("com.ohos.photos.MainAbility").toString(); + let str = { + "bundleName": bundleName, + "abilityName": abilityName, + } - globalThis.abilityContext.startAbility(str, (err, data) => { - if(err) { - return; + globalThis.abilityContext.startAbility(str, (err, data) => { + if(err) { + return; + } + }) + }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 150 ) { + this.Vue = true; } }) - }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 150 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `滑动响应时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `滑动响应时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets index fa52d80df46ea3f8f4b2888463694c5b51c89087..4be1611e1ddf7dff399acba23145ce38c3255d50 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' - + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>设置测试,回车执行` - + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' - + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n' + + `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>设置测试,回车执行` + + '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + + '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\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) => { + }).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('time:'); + let setTime = setReport.substring(setHead+5); + this.setNum = parseFloat(setTime); + if( 0 < this.setNum && this.setNum < 2300 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - 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('time:'); - let setTime = setReport.substring(setHead+5); - this.setNum = parseFloat(setTime); - if( 0 < this.setNum && this.setNum < 2300 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '设置冷启动时延' + this.setNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + `测试结果:` + '\n' + '\n' + '设置冷启动时延' + this.setNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets index f77a39c328de8c751144a422ad7f9559b6a1cc90..65edd1c6d4f433aff4244fb39b83ed0a0cc0e4bd 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets @@ -35,6 +35,7 @@ struct CustomContainerUser { @State mmsNum: number = 0; @State cameraNum: number = 0; @State contactsNum: number = 0; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -43,74 +44,75 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' - + `3.开启设置应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>设置测试`+ '\n' + '\n' + - `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' - + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n' + + `3.开启设置应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>设置测试`+ '\n' + '\n' + + `5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果' + '\n' + '\n' + + `7.若所有热启动测试均在规定时延内完成则通过测试` + '\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) => { + }).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( 0 < this.setNum && this.setNum < 600 ) { + this.num++ + } + if( this.num === 1 ) { + this.Vue = true; + } + }) + } } - 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( 0 < this.setNum && this.setNum < 600 ) { - this.num++ - } - if( this.num === 1 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n' + '设置热启动时延' + this.setNum + 'ms') + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '\n' + '设置热启动时延' + this.setNum + 'ms') - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets b/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets index c903f1a58c02c5024c43b89d86f8b9a04bd0945e..c1c6914c251ce663270005bde246c614a87da6ac 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets @@ -31,6 +31,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -39,67 +40,68 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面开启任务管理器` - + '\n' + '\n' + `3.工作台运行’点击启动测试.bat‘选择完成时延>后台任务切换`+ '\n' + '\n' +`4.随意点开一个后台任务` - + '\n' + '\n' + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + - `6.若打开后台任务时延小于或等于600ms则通过测试` + '\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.StartEnable = !this.StartEnable; - let str = { - bundleName:"com.ohos.launcher", - abilityName: "com.ohos.launcher.MainAbility", - } - abilityContext.startAbility(str).then((data) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面开启任务管理器` + + '\n' + '\n' + `3.工作台运行’点击启动测试.bat‘选择完成时延>后台任务切换`+ '\n' + '\n' +`4.随意点开一个后台任务` + + '\n' + '\n' + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + + `6.若打开后台任务时延小于或等于600ms则通过测试` + '\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.StartEnable = !this.StartEnable; + let str = { + bundleName:"com.ohos.launcher", + abilityName: "com.ohos.launcher.MainAbility", + } + abilityContext.startAbility(str).then((data) => { - }).catch((error) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 600 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 600 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `打开后台任务时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `打开后台任务时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets b/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets index b426495ca8cad10b42e6d9ee5087c3b869730fbf..1d559cdb1f552a2836981773f3e361d39dab8c23 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets @@ -31,6 +31,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -39,67 +40,68 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面` + '\n' + '\n' - + `3.工作台运行’点击启动测试.bat‘选择响应时延>下拉状态栏`+ '\n' + '\n' +`4.从屏幕顶部滑动下拉通知栏` + '\n' + '\n' - + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + `6.若下拉通知栏时延小于或等于150ms则通过测试` + - '\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.StartEnable = !this.StartEnable; - let str = { - bundleName:"com.ohos.launcher", - abilityName: "com.ohos.launcher.MainAbility", - } - abilityContext.startAbility(str).then((data) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面` + '\n' + '\n' + + `3.工作台运行’点击启动测试.bat‘选择响应时延>下拉状态栏`+ '\n' + '\n' +`4.从屏幕顶部滑动下拉通知栏` + '\n' + '\n' + + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + `6.若下拉通知栏时延小于或等于150ms则通过测试` + + '\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.StartEnable = !this.StartEnable; + let str = { + bundleName:"com.ohos.launcher", + abilityName: "com.ohos.launcher.MainAbility", + } + abilityContext.startAbility(str).then((data) => { - }).catch((error) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 150 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 150 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `下拉通知栏时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `下拉通知栏时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets b/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets index 6f64d362497c311c45b8f9edbbe02da590ef664a..41f98855190c7536bd0fffb3f7186cda6bcb42c0 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets @@ -31,6 +31,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -39,67 +40,68 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面` + '\n' + '\n' - + `3.工作台运行’点击启动测试.bat‘选择完成时延>启动任务管理器`+ '\n' + '\n' +`4.点击右下角方框开启任务管理器` + '\n' + '\n' - + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + `6.若启动任务管理器时延小于或等于1000ms则通过测试` - + '\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.StartEnable = !this.StartEnable; - let str = { - bundleName:"com.ohos.launcher", - abilityName: "com.ohos.launcher.MainAbility", - } - abilityContext.startAbility(str).then((data) => { + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面` + '\n' + '\n' + + `3.工作台运行’点击启动测试.bat‘选择完成时延>启动任务管理器`+ '\n' + '\n' +`4.点击右下角方框开启任务管理器` + '\n' + '\n' + + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + `6.若启动任务管理器时延小于或等于1000ms则通过测试` + + '\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.StartEnable = !this.StartEnable; + let str = { + bundleName:"com.ohos.launcher", + abilityName: "com.ohos.launcher.MainAbility", + } + abilityContext.startAbility(str).then((data) => { - }).catch((error) => { + }).catch((error) => { + }) }) - }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 1000 ) { + this.Vue = true; + } + }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 1000 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `启动任务管理器时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `启动任务管理器时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets index 7170960abb8fb014a65a9217e651a898dadfa14f..41c9e351b7a7b88a1e75672874d3be47e1e4d753 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets @@ -29,6 +29,7 @@ struct CustomContainerUser { @State Vue: boolean = false; @State StartEnable: boolean = true; @State time: string = '0'; + scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); this.Vue = false; @@ -37,70 +38,71 @@ struct CustomContainerUser { @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.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n' - + `3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>查看图片` + '\n' + '\n' + - `5.点击一张图库缩略图等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + - `7.若图片响应时延小于或等于150ms则通过测试` + '\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.StartEnable = !this.StartEnable; - let bundleName=new String("com.ohos.photos").toString(); - let abilityName=new String("com.ohos.photos.MainAbility").toString(); - let str = { - "bundleName": bundleName, - "abilityName": abilityName, - } + Scroll(this.scroller) { + Column(){ + Row(){ + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + .fontColor(Color.White).fontSize('24fp') + } + Row(){ + Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n' + + `3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>查看图片` + '\n' + '\n' + + `5.点击一张图库缩略图等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + + `7.若图片响应时延小于或等于150ms则通过测试` + '\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.StartEnable = !this.StartEnable; + let bundleName=new String("com.ohos.photos").toString(); + let abilityName=new String("com.ohos.photos.MainAbility").toString(); + let str = { + "bundleName": bundleName, + "abilityName": abilityName, + } - globalThis.abilityContext.startAbility(str, (err, data) => { - if(err) { - return; + globalThis.abilityContext.startAbility(str, (err, data) => { + if(err) { + return; + } + }) + }) + } + Column(){ + Button(`结束`) + .borderRadius(8) + .backgroundColor(0x317aff) + .width('30%') + .enabled(!this.StartEnable) + .opacity(!this.StartEnable? 1 : 0.4) + .onClick(() => { + this.StartEnable = !this.StartEnable + let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); + let buf = new ArrayBuffer(4096); + fileio.readSync(fd,buf); + let report = String.fromCharCode.apply(null,new Uint8Array(buf)); + let head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( 0 < time && time < 150 ) { + this.Vue = true; } }) - }) + } } - Column(){ - Button(`结束`) - .borderRadius(8) - .backgroundColor(0x317aff) - .width('30%') - .enabled(!this.StartEnable) - .opacity(!this.StartEnable? 1 : 0.4) - .onClick(() => { - this.StartEnable = !this.StartEnable - let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664); - let buf = new ArrayBuffer(4096); - fileio.readSync(fd,buf); - let report = String.fromCharCode.apply(null,new Uint8Array(buf)); - let head = report.indexOf(":"); - this.time = report.substring(head+1); - let time = parseFloat(this.time) - if( 0 < time && time < 150 ) { - this.Vue = true; - } - }) + Row(){ + Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `图片响应时延:` + this.time + 'ms' ) + .fontColor(Color.White).fontSize('24fp') } } - Row(){ - Text('\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n' + `图片响应时延:` + this.time + 'ms' ) - .fontColor(Color.White).fontSize('24fp') - } } - } }.width('100%').height('80%').backgroundColor(Color.Black) .justifyContent(FlexAlign.SpaceEvenly)