From d6fbbeb6b67300c2539842744b31bb3007ef35ca Mon Sep 17 00:00:00 2001 From: tianwenzhe Date: Thu, 16 Mar 2023 18:59:41 +0800 Subject: [PATCH] add to 3.2release Signed-off-by: tian-wenzhe411 --- .../src/main/ets/pages/ArkUI/ArkUI_index.ets | 17 +- .../main/ets/pages/ArkUI/CanvasFillStyle.ets | 18 +- .../src/main/ets/pages/ArkUI/CanvasFont.ets | 264 +++++++++++++++--- .../ets/pages/ArkUI/CanvasGlobalAlpha.ets | 7 +- .../ArkUI/CanvasGlobalCompositeOperation.ets | 88 +++++- .../main/ets/pages/ArkUI/CanvasLineCap.ets | 18 +- .../ets/pages/ArkUI/CanvasLineDashOffset.ets | 6 +- .../main/ets/pages/ArkUI/CanvasLineJoin.ets | 18 +- .../main/ets/pages/ArkUI/CanvasLineWidth.ets | 7 +- .../main/ets/pages/ArkUI/CanvasMiterLimit.ets | 82 ------ .../main/ets/pages/ArkUI/CanvasShadowBlur.ets | 8 +- .../ets/pages/ArkUI/CanvasShadowColor.ets | 18 +- .../ets/pages/ArkUI/CanvasShadowOffsetX.ets | 7 +- .../ets/pages/ArkUI/CanvasShadowOffsetY.ets | 6 +- .../ets/pages/ArkUI/CanvasStrokeStyle.ets | 18 +- .../main/ets/pages/ArkUI/CanvasTextAlign.ets | 40 ++- .../ets/pages/ArkUI/CanvasTextBaseline.ets | 40 ++- .../src/main/ets/pages/Audio/Audio_index.ets | 15 +- .../ets/pages/Camera/CameraOrientation0.ets | 97 ------- .../ets/pages/Camera/CameraOrientation180.ets | 96 ------- .../ets/pages/Camera/CameraOrientation270.ets | 96 ------- .../ets/pages/Camera/CameraOrientation90.ets | 96 ------- .../main/ets/pages/Camera/Camera_index.ets | 24 +- .../ets/pages/Experience/ColdStartTest.ets | 193 +++++++++++++ .../src/main/ets/pages/Experience/DeskFps.ets | 25 +- .../ets/pages/Experience/Experience_index.ets | 24 +- .../ets/pages/Experience/HotStartTest.ets | 179 ++++++++++++ .../pages/Experience/KeyboardDisplayTest.ets | 120 ++++++++ .../pages/Experience/KeyboardInputTest.ets | 120 ++++++++ .../main/ets/pages/Experience/PhotoFps.ets | 27 +- .../ets/pages/Experience/ScrollListTest.ets | 52 ---- .../ets/pages/Experience/ScrollPhotosList.ets | 120 ++++++++ .../pages/Experience/StartBackgroundTask.ets | 118 ++++++++ .../pages/Experience/StartNotification.ets | 118 ++++++++ .../ets/pages/Experience/StartTaskManager.ets | 118 ++++++++ .../ets/pages/Experience/ViewPhotoTest.ets | 120 ++++++++ .../main/ets/pages/Player/Player_index.ets | 15 +- .../ets/pages/common/CameraOrientation.ets | 2 +- .../common/ExperienceCustomContainer.ets | 2 +- .../common/StartExperienceCustomContainer.ets | 170 +++++++++++ .../common/TimeExperienceCustomContainer.ets | 165 +++++++++++ .../src/main/ets/pages/index.ets | 90 +++--- .../resources/base/profile/main_pages.json | 16 +- 43 files changed, 2143 insertions(+), 737 deletions(-) delete mode 100644 validator/acts_validator/src/main/ets/pages/ArkUI/CanvasMiterLimit.ets delete mode 100644 validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation0.ets delete mode 100644 validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation180.ets delete mode 100644 validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation270.ets delete mode 100644 validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation90.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/ColdStartTest.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets delete mode 100644 validator/acts_validator/src/main/ets/pages/Experience/ScrollListTest.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets create mode 100644 validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets create mode 100644 validator/acts_validator/src/main/ets/pages/common/StartExperienceCustomContainer.ets create mode 100644 validator/acts_validator/src/main/ets/pages/common/TimeExperienceCustomContainer.ets 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 80abc9916..d0f6405fe 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 @@ -51,9 +51,9 @@ struct IndexPage { {title:'CanvasStrokeStyle',uri:'pages/ArkUI/CanvasStrokeStyle'}, {title:'CanvasLineCap',uri:'pages/ArkUI/CanvasLineCap'}, {title:'CanvasLineJoin',uri:'pages/ArkUI/CanvasLineJoin'}, - {title:'CanvasMiterLimit',uri:'pages/ArkUI/CanvasMiterLimit'}, {title:'CanvasFont',uri:'pages/ArkUI/CanvasFont'}, {title:'CanvasTextAlign',uri:'pages/ArkUI/CanvasTextAlign'}, + {title:'CanvasTextBaseline',uri:'pages/ArkUI/CanvasTextBaseline'}, {title:'CanvasGlobalAlpha',uri:'pages/ArkUI/CanvasGlobalAlpha'}, {title:'CanvasLineDashOffset',uri:'pages/ArkUI/CanvasLineDashOffset'}, {title:'CanvasGlobalCompositeOperation',uri:'pages/ArkUI/CanvasGlobalCompositeOperation'}, @@ -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/ArkUI/CanvasFillStyle.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFillStyle.ets index ca007f54c..2ab01f65c 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFillStyle.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFillStyle.ets @@ -23,6 +23,9 @@ struct SetCircle { @State name: string = 'CanvasFillStyle'; @State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认黑色的填色区域会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -36,7 +39,10 @@ struct SetCircle { this.FillColor = '#FFFF0000'; this.context.fillStyle = this.FillColor; this.context.fillRect(100, 160, 150, 100); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == this.num3 && this.num2 == 1 ){ + this.Vue = true; + } }) Text('Yellow').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -44,7 +50,10 @@ struct SetCircle { this.FillColor = '#fffffc3c'; this.context.fillStyle = this.FillColor; this.context.fillRect(100, 160, 150, 100); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) Text('Green').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -52,7 +61,10 @@ struct SetCircle { this.FillColor = '#ff19fa00'; this.context.fillStyle = this.FillColor; this.context.fillRect(100, 160, 150, 100); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) }.width('70%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets index 9e27e60f9..772bf2592 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets @@ -23,6 +23,28 @@ struct SetCircle { @State name: string = 'CanvasFont'; @State StepTips: string = '操作步骤:点击不同的字体控件'+'\n'+'预期结果:原本默认字体会改变'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; + @State num4: number = 0; + @State num5: number = 0; + @State num6: number = 0; + @State num7: number = 0; + @State num8: number = 0; + @State num9: number = 0; + @State num10: number = 0; + @State num11: number = 0; + @State num12: number = 0; + @State num13: number = 0; + @State num14: number = 0; + @State num15: number = 0; + @State num16: number = 0; + @State num17: number = 0; + @State num18: number = 0; + @State num19: number = 0; + @State num20: number = 0; + @State num21: number = 0; + @State num22: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -36,168 +58,322 @@ struct SetCircle { Text('font-style').fontSize(13).border({width:0}).size({width:'24%',height:'18%'}) Text('normal').fontSize(13).border({width:2}).size({width:'24%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num1 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('italic').fontSize(13).border({width:2}).size({width:'24%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'italic normal 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num2 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) } Row({space:8}) { Text('font-weight').fontSize(13).border({ width: 0 }).size({ width: '24%', height: '18%' }) Text('normal').fontSize(13).border({ width: 2 }).size({ width: '16%', height: '18%' }) .onClick(() => { - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num3 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('bold').fontSize(13).border({width:2}).size({width:'16%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal bold 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num4 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('bolder').fontSize(13).border({width:2}).size({width:'16%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal bolder 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num5 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('lighter').fontSize(13).border({width:2}).size({width:'16%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal lighter 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num6 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) } Row({space:5}) { Text('100').fontSize(13).border({ width: 2 }).size({ width: '10%', height: '18%' }) .onClick(() => { - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 100 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num7 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('200').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 200 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num8 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('300').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 300 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num9 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('400').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 400 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num10 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('500').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 500 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num11 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('600').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 600 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num12 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('700').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 700 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num13 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('800').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 800 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num14 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('900').fontSize(13).border({width:2}).size({width:'10%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal 900 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num15 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) } Row({space:10}){ Text('font-family').fontSize(13).border({width:0}).size({width:'24%',height:'18%'}) Text('sans-serif').fontSize(13).border({width:2}).size({width:'24%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num16 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('serif').fontSize(13).border({width:2}).size({width:'24%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 120px serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num17 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('monospace').fontSize(13).border({width:2}).size({width:'24%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 120px monospace'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num18 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) } Row({space:10}) { Text('font-size').fontSize(13).border({ width: 0 }).size({ width: '18%', height: '18%' }) Text('small').fontSize(13).border({ width: 2 }).size({ width: '18%', height: '18%' }) .onClick(() => { - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 10px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num19 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('medium').fontSize(13).border({width:2}).size({width:'18%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 50px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num20 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('large').fontSize(13).border({width:2}).size({width:'18%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 80px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num21 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) Text('extra').fontSize(13).border({width:2}).size({width:'18%',height:'18%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 600, 600); this.context.font = 'normal normal 120px sans-serif'; this.context.fillText("Hello World", 80, 120); - this.Vue = true; + this.num22 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 && this.num12 == 1 && this.num13 == 1 && this.num14 == 1 && this.num15 == 1 + && this.num16 == 1 && this.num17 == 1 && this.num18 == 1 && this.num19 == 1 && this.num20 == 1 + && this.num21 == 1 && this.num22 == 1 ){ + this.Vue = true; + } }) } }.width('90%').height('30%') diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets index 3dd5606c6..eb297955f 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets @@ -47,8 +47,11 @@ struct SetCircle { console.info('Pan end'); }) ) + + }.width('70%').height('25%') + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }){ Text('透明度: ' + (this.X)*0.005 ) - }.width('70%').height('30%') + }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) .width('100%') @@ -61,7 +64,7 @@ struct SetCircle { this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(200, 200, 50, 50); }) - }.width('100%').height('70%') + }.width('100%').height('55%') }.width('100%').height('80%').backgroundColor(Color.White) } build() { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets index 54bda6405..acbba6eba 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets @@ -23,6 +23,17 @@ struct SetCircle { @State name: string = 'CanvasGlobalCompositeOperation'; @State StepTips: string = '操作步骤:点击不同的合成操作的方式'+'\n'+'预期结果:原本默认合成方式会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; + @State num4: number = 0; + @State num5: number = 0; + @State num6: number = 0; + @State num7: number = 0; + @State num8: number = 0; + @State num9: number = 0; + @State num10: number = 0; + @State num11: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -41,7 +52,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'source-over'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num1 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('s-atop').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ @@ -51,7 +67,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'source-atop'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num2 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('s-in').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ @@ -61,7 +82,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'source-in'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num3 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('s-out').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ @@ -71,7 +97,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'source-out'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num4 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) } Row({space:10}){ @@ -83,7 +114,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'destination-over'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num5 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('d-atop').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { @@ -93,7 +129,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'destination-atop'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num6 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('d-in').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { @@ -103,7 +144,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'destination-in'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num7 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('d-out').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { @@ -113,7 +159,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'destination-out'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num8 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) } Row({space:10}){ @@ -125,7 +176,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'lighter'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num9 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('copy').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { @@ -135,7 +191,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'copy'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num10 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('xor').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { @@ -145,7 +206,12 @@ struct SetCircle { this.context.globalCompositeOperation = 'xor'; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(180, 180, 50, 50); - this.Vue = true; + this.num11 = 1; + if( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 + && this.num6 == 1 && this.num7 == 1 && this.num8 == 1 && this.num9 == 1 && this.num10 == 1 + && this.num11 == 1 ){ + this.Vue = true; + } }) Text('').fontSize(0).border({width:0}).size({width:'18%',height:'20%'}) } diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets index dba750ab6..8e8aebf5e 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets @@ -23,6 +23,9 @@ struct SetCircle { @State name: string = 'CanvasLineCap'; @State StepTips: string = '操作步骤:点击不同的端点样式控件'+'\n'+'预期结果:原本默认端点样式会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -38,7 +41,10 @@ struct SetCircle { this.context.moveTo(100, 100); this.context.lineTo(250, 100); this.context.stroke(); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == this.num3 && this.num2 == 1 ){ + this.Vue = true; + } }) Text('round').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -49,7 +55,10 @@ struct SetCircle { this.context.moveTo(100, 100); this.context.lineTo(250, 100); this.context.stroke(); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) Text('square').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -60,7 +69,10 @@ struct SetCircle { this.context.moveTo(100, 100); this.context.lineTo(250, 100); this.context.stroke(); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) }.width('70%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets index 0a286640f..5cadd1f0e 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets @@ -46,8 +46,10 @@ struct SetCircle { console.info('Pan end'); }) ) + }.width('70%').height('25%') + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text('虚线偏移量: ' + (this.X)*0.1 ) - }.width('70%').height('30%') + }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) .width('100%') @@ -59,7 +61,7 @@ struct SetCircle { this.context.lineDashOffset = (this.X)*0.1; this.context.stroke(); }) - }.width('100%').height('70%') + }.width('100%').height('55%') }.width('100%').height('80%').backgroundColor(Color.White) } build() { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets index 8747420cd..2f4c2339f 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets @@ -23,6 +23,9 @@ struct SetCircle { @State name: string = 'CanvasLineJoin'; @State StepTips: string = '操作步骤:点击不同的交点样式控件'+'\n'+'预期结果:原本默认交点样式会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -39,7 +42,10 @@ struct SetCircle { this.context.lineTo(210, 130); this.context.lineTo(120, 180); this.context.stroke(); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == this.num3 && this.num2 == 1 ){ + this.Vue = true; + } }) Text('bevel').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -51,7 +57,10 @@ struct SetCircle { this.context.lineTo(210, 130); this.context.lineTo(120, 180); this.context.stroke(); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) Text('miter').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -63,7 +72,10 @@ struct SetCircle { this.context.lineTo(210, 130); this.context.lineTo(120, 180); this.context.stroke(); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) }.width('70%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets index 9f081ccbf..b0e228da7 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets @@ -46,8 +46,11 @@ struct SetCircle { console.info('Pan end'); }) ) - Text('边框粗细: ' + (this.X)*0.05 ) + }.width('70%').height('30%') + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('边框粗细: ' + (this.X)*0.05 ) + }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) .width('100%') @@ -57,7 +60,7 @@ struct SetCircle { this.context.lineWidth = (this.X)*0.05; this.context.strokeRect(120, 120, 120, 120); }) - }.width('100%').height('70%') + }.width('100%').height('50%') }.width('100%').height('80%').backgroundColor(Color.White) } build() { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasMiterLimit.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasMiterLimit.ets deleted file mode 100644 index 2b813b802..000000000 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasMiterLimit.ets +++ /dev/null @@ -1,82 +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/CanvasCustomContainer2'; -import FirstDialog from '../model/FirstDialog'; -@Entry -@Component -struct SetCircle { - private settings: RenderingContextSettings = new RenderingContextSettings(true); - private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); - @State FillColor: string = '#FF000000'; - @State X: number = 0; - @State name: string = 'CanvasMiterLimit'; - @State StepTips: string = '操作步骤:向右拖动MiterLimit按键'+'\n'+'预期结果:斜接面限制值会随拖动距离变化,并显示限制值大小'; - @State Vue: boolean = false; - async aboutToAppear(){ - await FirstDialog.ChooseDialog(this.StepTips,this.name); - } - @Builder specificNoParam() { - Column() { - Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){ - Text('MiterLimit').fontSize(18).border({width:2}).size({width:'40%',height:'30%'}) - .translate({ x: this.X, y: 20, z: 5 }) - .gesture( - PanGesture({}) - .onActionStart((event: GestureEvent) => { - this.context.clearRect(100, 100, 250, 200); - console.info('Pan start'); - this.Vue = true; - }) - .onActionUpdate((event: GestureEvent) => { - this.X = event.offsetX; - }) - .onActionEnd(() => { - console.info('Pan end'); - }) - ) - Text('边框粗细: ' + (this.X)*0.05 ) - }.width('70%').height('30%') - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Canvas(this.context) - .width('100%') - .height('100%') - .backgroundColor('#ffffffff') - .onReady(() =>{ - this.context.lineWidth = 8; - this.context.lineJoin = 'miter'; - this.context.miterLimit = (this.X)*0.05; - this.context.moveTo(160, 100); - this.context.lineTo(190, 105); - this.context.lineTo(160, 107); - this.context.stroke(); - }) - }.width('100%').height('70%') - }.width('100%').height('80%').backgroundColor(Color.White) - } - build() { - Column() { - CustomContainer({ - title: this.name, - Url: 'pages/ArkUI/ArkUI_index', - StepTips: this.StepTips, - content: this.specificNoParam, - FillColor: $FillColor, - X: $X, - name: $name, - Vue: $Vue, - }) - }.width('100%').height('100%').backgroundColor(Color.Black) - } -} \ No newline at end of file diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets index 0e705b03f..88703c8a0 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets @@ -35,7 +35,7 @@ struct SetCircle { .gesture( PanGesture({}) .onActionStart((event: GestureEvent) => { - this.context.clearRect(10, 50, 400, 300); + this.context.clearRect(0, 0, 600, 500); this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); console.info('Pan start'); @@ -48,8 +48,10 @@ struct SetCircle { console.info('Pan end'); }) ) + }.width('70%').height('25%') + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text('阴影模糊: ' + this.X ) - }.width('70%').height('30%') + }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) .width('100%') @@ -61,7 +63,7 @@ struct SetCircle { this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); }) - }.width('100%').height('70%') + }.width('100%').height('55%') }.width('100%').height('80%').backgroundColor(Color.White) } build() { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets index 56de4cc14..0fc9539bc 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets @@ -24,6 +24,9 @@ struct SetCircle { @State name: string = 'CanvasShadowColor'; @State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认蓝色的阴影会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -37,7 +40,10 @@ struct SetCircle { this.context.shadowColor = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == 1 && this.num3 == 1 && this.num2 == 1 ){ + this.Vue = true; + } }) Text('Yellow').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -46,7 +52,10 @@ struct SetCircle { this.context.shadowColor = '#fffffc3c'; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num3 == 1 && this.num2 == 1 ){ + this.Vue = true; + } }) Text('Green').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -55,7 +64,10 @@ struct SetCircle { this.context.shadowColor = '#ff19fa00'; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num3 == 1 && this.num2 == 1 ){ + this.Vue = true; + } }) }.width('70%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets index 13c9432ac..0c322407d 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets @@ -49,8 +49,11 @@ struct SetCircle { console.info('Pan end'); }) ) + + }.width('70%').height('25%') + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }){ Text('阴影偏移: ' + (this.X)*0.05 ) - }.width('70%').height('30%') + }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) .width('100%') @@ -63,7 +66,7 @@ struct SetCircle { this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); }) - }.width('100%').height('70%') + }.width('100%').height('55%') }.width('100%').height('80%').backgroundColor(Color.White) } build() { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets index 5269d427f..b9dd03218 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets @@ -49,8 +49,10 @@ struct SetCircle { console.info('Pan end'); }) ) + }.width('70%').height('25%') + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }){ Text('阴影偏移: ' + (this.X)*0.05 ) - }.width('70%').height('30%') + }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) .width('100%') @@ -63,7 +65,7 @@ struct SetCircle { this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); }) - }.width('100%').height('70%') + }.width('100%').height('55%') }.width('100%').height('80%').backgroundColor(Color.White) } build() { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets index 083c2599b..6ce712dbf 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets @@ -23,6 +23,9 @@ struct SetCircle { @State name: string = 'CanvasStrokeStyle'; @State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认黑色的边框会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -36,7 +39,10 @@ struct SetCircle { this.context.lineWidth = 10; this.context.strokeStyle = '#FFFF0000'; this.context.strokeRect(100, 160, 150, 100); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == this.num3 && this.num2 == 1 ){ + this.Vue = true; + } }) Text('Yellow').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -45,7 +51,10 @@ struct SetCircle { this.context.lineWidth = 10; this.context.strokeStyle = '#fffffc3c'; this.context.strokeRect(100, 160, 150, 100); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) Text('Green').fontSize(16).border({width:2}).size({width:'25%',height:'20%'}) .onClick(()=>{ @@ -54,7 +63,10 @@ struct SetCircle { this.context.lineWidth = 10; this.context.strokeStyle = '#ff19fa00'; this.context.strokeRect(100, 160, 150, 100); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num3 == this.num2 ){ + this.Vue = true; + } }) }.width('70%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets index bf686a91b..c9d152b41 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets @@ -23,6 +23,11 @@ struct SetCircle { @State name: string = 'CanvasTextAlign'; @State StepTips: string = '操作步骤:点击不同的文本对齐方式控件'+'\n'+'预期结果:原本默认的对齐方式会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; + @State num4: number = 0; + @State num5: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -31,58 +36,73 @@ struct SetCircle { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){ Text('start').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.lineWidth = 2; this.context.moveTo(180, 10); this.context.lineTo(180, 310); this.context.stroke(); this.context.textAlign = 'start'; this.context.fillText('textAlign=start', 180, 160); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('end').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.lineWidth = 2; this.context.moveTo(180, 10); this.context.lineTo(180, 310); this.context.stroke(); this.context.textAlign = 'end'; this.context.fillText('textAlign=end', 180, 160); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('left').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.lineWidth = 2; this.context.moveTo(180, 10); this.context.lineTo(180, 310); this.context.stroke(); this.context.textAlign = 'left'; this.context.fillText('textAlign=left', 180, 160); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('center').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.lineWidth = 2; this.context.moveTo(180, 10); this.context.lineTo(180, 310); this.context.stroke(); this.context.textAlign = 'center'; this.context.fillText('textAlign=center', 180, 160); - this.Vue = true; + this.num4 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('right').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.lineWidth = 2; this.context.moveTo(180, 10); this.context.lineTo(180, 310); this.context.stroke(); this.context.textAlign = 'right'; this.context.fillText('textAlign=right', 180, 160); - this.Vue = true; + this.num5 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) }.width('90%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets index 2473a85a0..f3af9399a 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets @@ -23,6 +23,11 @@ struct SetCircle { @State name: string = 'CanvasTextBaseline'; @State StepTips: string = '操作步骤:点击不同的水平对齐方式'+'\n'+'预期结果:原本默认水平对齐方式会随点击变化'; @State Vue: boolean = false; + @State num1: number = 0; + @State num2: number = 0; + @State num3: number = 0; + @State num4: number = 0; + @State num5: number = 0; async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); } @@ -31,7 +36,7 @@ struct SetCircle { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){ Text('Top').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.strokeStyle = '#0000ff'; this.context.lineWidth = 2; this.context.moveTo(0, 120); @@ -39,11 +44,14 @@ struct SetCircle { this.context.stroke(); this.context.textBaseline = 'top'; this.context.fillText('Top', 160, 120); - this.Vue = true; + this.num1 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('Bottom').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.strokeStyle = '#0000ff'; this.context.lineWidth = 2; this.context.moveTo(0, 120); @@ -51,11 +59,14 @@ struct SetCircle { this.context.stroke(); this.context.textBaseline = 'bottom'; this.context.fillText('Bottom', 160, 120); - this.Vue = true; + this.num2 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('Middle').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.strokeStyle = '#0000ff'; this.context.lineWidth = 2; this.context.moveTo(0, 120); @@ -63,11 +74,14 @@ struct SetCircle { this.context.stroke(); this.context.textBaseline = 'middle'; this.context.fillText('Middle', 160, 120); - this.Vue = true; + this.num3 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('Alphabetic').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=>{ - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.strokeStyle = '#0000ff'; this.context.lineWidth = 2; this.context.moveTo(0, 120); @@ -75,11 +89,14 @@ struct SetCircle { this.context.stroke(); this.context.textBaseline = 'alphabetic'; this.context.fillText('Alphabetic', 160, 120); - this.Vue = true; + this.num4 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) Text('Hanging').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) .onClick(()=> { - this.context.clearRect(0, 10, 350, 300); + this.context.clearRect(0, 10, 500, 500); this.context.strokeStyle = '#0000ff'; this.context.lineWidth = 2; this.context.moveTo(0, 120); @@ -87,7 +104,10 @@ struct SetCircle { this.context.stroke(); this.context.textBaseline = 'hanging'; this.context.fillText('Hanging', 160, 120); - this.Vue = true; + this.num5 = 1; + if ( this.num1 == 1 && this.num2 == 1 && this.num3 == 1 && this.num4 == 1 && this.num5 == 1 ){ + this.Vue = true; + } }) }.width('90%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 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 02728690d..51bb57324 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 e82fbd028..000000000 --- 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 a94a383d0..000000000 --- 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 b751b107e..000000000 --- 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 9fdef8106..000000000 --- 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 d496a102d..e011a2aef 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 000000000..bbdfda389 --- /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 + '/ColdStartSetting.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' ) + .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' ) + .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' + `测试结果:` + '\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 756c21e5e..781d4db21 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets @@ -44,7 +44,7 @@ struct CustomContainerUser { } Row(){ Text(`测试步骤:`+ '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' - + `2.双击执行DeskFps.bat`+ '\n' + '\n' +`3.左右滑动系统桌面连续10s以上` + '\n' + '\n' + + `2.双击执行.bat选择帧率>桌面`+ '\n' + '\n' +`3.左右滑动系统桌面连续10s以上` + '\n' + '\n' + '4.回到DeskFps测试项点击停止键' + '\n' + '\n' + `5.若测试最高帧率大于54帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) .fontColor(Color.White).fontSize('20fp') @@ -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 822442428..55b4c8b28 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,15 @@ 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'}, + {title:'ViewPhoto',uri:'pages/Experience/ViewPhotoTest'}, + {title:'KeyboardDisplay',uri:'pages/Experience/KeyboardDisplayTest'}, + {title:'StartTaskManager',uri:'pages/Experience/StartTaskManager'}, + {title:'StartBackgroundTask',uri:'pages/Experience/StartBackgroundTask'}, + {title:'StartNotification',uri:'pages/Experience/StartNotification'}, + {title:'ScrollPhotosList',uri:'pages/Experience/ScrollPhotosList'}, + {title:'KeyboardInput',uri:'pages/Experience/KeyboardInputTest'}, ] @State ColorObject : string[] = VarColor; async onPageShow(){ @@ -271,30 +280,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 000000000..a5d14e027 --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/HotStartTest.ets @@ -0,0 +1,179 @@ +/* + * 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 + '/HotStartSetting.log'; +let PhotosColdPath = path + '/HotStartPhotos.log'; +let MmsColdPath = path + '/HotStartMms.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++ + } + /* + 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 === 4 ) { + this.Vue = true; + } + }) + } + } + Row(){ + Text('\n' + '\n' + '\n' + '\n' + `测试结果:` + '\n' + '设置热启动时延' + this.setNum + 'ms' + + '\n' + '图库热启动时延' + this.photosNum + 'ms' + '\n'+ '信息热启动时延' + this.mmsNum + '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/KeyboardDisplayTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets new file mode 100644 index 000000000..41c3c9714 --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets @@ -0,0 +1,120 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; + +let path = globalThis.dir; +let Xpath = path + '/CompleteTimeKeyboard.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'KeyboardDisplay'; + @State StepTips: string = '操作步骤:根据操作提示点击输入框等待键盘加载'+'\n'+'预期结果:输入键盘弹出时延低于1000ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.双击执行.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 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; + } + }) + }) + } + 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( time < 1000 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file diff --git a/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets new file mode 100644 index 000000000..4bd3e376e --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets @@ -0,0 +1,120 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; + +let path = globalThis.dir; +let Xpath = path + '/ResponseTimeKeyboard.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'KeyboardInput'; + @State StepTips: string = '操作步骤:根据操作提示点击键盘按键'+'\n'+'预期结果:键盘输入响应时延低于150ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.双击执行.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 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; + } + }) + }) + } + 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( time < 150 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file 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 f8ac4805d..76c18d9db 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import fileio from '@ohos.fileio'; import {CustomContainer} from '../common/ExperienceCustomContainer'; import FirstDialog from '../model/FirstDialog'; @@ -43,7 +42,7 @@ struct CustomContainerUser { } Row(){ Text(`测试步骤:`+ '\n' + '\n' +`1.在图库中预置500张图片`+ '\n' + '\n' +`2.点击开始键进入图库`+ '\n' + '\n' - + `3.双击执行PhotoFps.bat`+ '\n' + '\n' +`4.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + + `3.双击执行.bat选择帧率>图库`+ '\n' + '\n' +`4.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '5.回到PhotoFps测试项点击停止键' + '\n' + '\n' + `6.若测试最高帧率大于或等于54帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) .fontColor(Color.White).fontSize('20fp') @@ -63,7 +62,6 @@ struct CustomContainerUser { let str = { "bundleName": bundleName, "abilityName": abilityName, - "parameters": "" } globalThis.abilityContext.startAbility(str, (err, data) => { @@ -86,11 +84,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 63dcb6fe1..000000000 --- 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/Experience/ScrollPhotosList.ets b/validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets new file mode 100644 index 000000000..ca5994863 --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets @@ -0,0 +1,120 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; + +let path = globalThis.dir; +let Xpath = path + '/ResponseTimePhotos.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'ScrollPhotosList'; + @State StepTips: string = '操作步骤:根据操作提示滑动图库缩略表'+'\n'+'预期结果:滑动响应时延低于150ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.在图库中预置500张图片`+ '\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 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 head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( time < 150 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file diff --git a/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets b/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets new file mode 100644 index 000000000..1af001ac7 --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets @@ -0,0 +1,118 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; +import context from '@ohos.app.ability.common'; + +let abilityContext = getContext(this) as context.UIAbilityContext; +let path = globalThis.dir; +let Xpath = path + '/CompleteTimeLauncher.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'StartBackgroundTask'; + @State StepTips: string = '操作步骤:根据操作提示打开后台任务'+'\n'+'预期结果:打开后台任务时延低于600ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.双击执行.bat选择完成时延>后台任务切换`+ + '\n' + '\n' +`3.随意点开一个后台任务` + '\n' + '\n' + '4.待脚本执行结束回到Validator点击停止键' + + '\n' + '\n' + `5.若打开后台任务时延小于或等于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) => { + + }) + }) + } + 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( time < 600 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file diff --git a/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets b/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets new file mode 100644 index 000000000..ae5d0a252 --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets @@ -0,0 +1,118 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; +import context from '@ohos.app.ability.common'; + +let abilityContext = getContext(this) as context.UIAbilityContext; +let path = globalThis.dir; +let Xpath = path + '/ResponseTimeLauncher.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'StartNotification'; + @State StepTips: string = '操作步骤:根据操作提示下拉通知栏'+'\n'+'预期结果:下拉通知栏时延低于150ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.双击执行.bat选择响应时延>下拉状态栏`+ + '\n' + '\n' +`3.从屏幕顶部滑动下拉通知栏` + '\n' + '\n' + '4.待脚本执行结束回到Validator点击停止键' + + '\n' + '\n' + `5.若下拉通知栏时延小于或等于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) => { + + }) + }) + } + 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( time < 150 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file diff --git a/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets b/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets new file mode 100644 index 000000000..15cf1838e --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets @@ -0,0 +1,118 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; +import context from '@ohos.app.ability.common'; + +let abilityContext = getContext(this) as context.UIAbilityContext; +let path = globalThis.dir; +let Xpath = path + '/CompleteTimeLauncher.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'StartTaskManager'; + @State StepTips: string = '操作步骤:根据操作提示打开任务管理器'+'\n'+'预期结果:打开任务管理器时延低于1000ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.双击执行.bat选择完成时延>启动任务管理器`+ + '\n' + '\n' +`3.点击右下角方框开启任务管理器` + '\n' + '\n' + '4.待脚本执行结束回到Validator点击停止键' + + '\n' + '\n' + `5.若启动任务管理器时延小于或等于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) => { + + }) + }) + } + 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( time < 1000 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file diff --git a/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets b/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets new file mode 100644 index 000000000..95ac2d5dc --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets @@ -0,0 +1,120 @@ +/* + * 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/TimeExperienceCustomContainer'; +import FirstDialog from '../model/FirstDialog'; + +let path = globalThis.dir; +let Xpath = path + '/ResponseTimePhotos.log'; + +@Entry +@Component +struct CustomContainerUser { + @State name: string = 'ViewPhoto'; + @State StepTips: string = '操作步骤:根据操作提示点击图片等待加载'+'\n'+'预期结果:图片响应时延低于150ms测试通过'; + @State Vue: boolean = false; + @State StartEnable: boolean = true; + @State time: string = '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.在图库中预置500张图片`+ '\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 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 head = report.indexOf(":"); + this.time = report.substring(head+1); + let time = parseFloat(this.time) + if( time < 150 ) { + this.Vue = true; + } + }) + } + } + 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) + } + build() { + Column() { + CustomContainer({ + title: this.name, + Url:'pages/Experience/Experience_index', + StepTips:this.StepTips, + content: this.specificNoParam, + name:$name, + Vue: $Vue, + StartEnable: $StartEnable, + time: $time + }) + }.width('100%').height('100%').backgroundColor(Color.Black) + } +} \ No newline at end of file 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 16fbfcd65..3763ad668 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 5139d40a5..ebef726e6 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 53650d231..b9eca1d48 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 000000000..46a89a3ee --- /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/common/TimeExperienceCustomContainer.ets b/validator/acts_validator/src/main/ets/pages/common/TimeExperienceCustomContainer.ets new file mode 100644 index 000000000..6d4ba891e --- /dev/null +++ b/validator/acts_validator/src/main/ets/pages/common/TimeExperienceCustomContainer.ets @@ -0,0 +1,165 @@ +/* + * 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 time : string; + @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 2faa93007..34a6af180 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 75715250c..dc2ee2fc1 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 @@ -15,7 +15,6 @@ "pages/ArkUI/CanvasStrokeStyle", "pages/ArkUI/CanvasLineCap", "pages/ArkUI/CanvasLineJoin", - "pages/ArkUI/CanvasMiterLimit", "pages/ArkUI/CanvasFont", "pages/ArkUI/CanvasTextAlign", "pages/ArkUI/CanvasTextBaseline", @@ -27,10 +26,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 +34,15 @@ "pages/Player/ScrollListTest", "pages/Experience/Experience_index", "pages/Experience/PhotoFps", - "pages/Experience/DeskFps" + "pages/Experience/DeskFps", + "pages/Experience/ColdStartTest", + "pages/Experience/HotStartTest", + "pages/Experience/ViewPhotoTest", + "pages/Experience/KeyboardDisplayTest", + "pages/Experience/StartTaskManager", + "pages/Experience/StartBackgroundTask", + "pages/Experience/StartNotification", + "pages/Experience/ScrollPhotosList", + "pages/Experience/KeyboardInputTest" ] } -- GitLab