未验证 提交 96199a39 编写于 作者: O openharmony_ci 提交者: Gitee

!8036 validator新增性能测试项和可视化报告修改提交3.2release分支

Merge pull request !8036 from 田文哲/OpenHarmony-3.2-Release
...@@ -51,9 +51,9 @@ struct IndexPage { ...@@ -51,9 +51,9 @@ struct IndexPage {
{title:'CanvasStrokeStyle',uri:'pages/ArkUI/CanvasStrokeStyle'}, {title:'CanvasStrokeStyle',uri:'pages/ArkUI/CanvasStrokeStyle'},
{title:'CanvasLineCap',uri:'pages/ArkUI/CanvasLineCap'}, {title:'CanvasLineCap',uri:'pages/ArkUI/CanvasLineCap'},
{title:'CanvasLineJoin',uri:'pages/ArkUI/CanvasLineJoin'}, {title:'CanvasLineJoin',uri:'pages/ArkUI/CanvasLineJoin'},
{title:'CanvasMiterLimit',uri:'pages/ArkUI/CanvasMiterLimit'},
{title:'CanvasFont',uri:'pages/ArkUI/CanvasFont'}, {title:'CanvasFont',uri:'pages/ArkUI/CanvasFont'},
{title:'CanvasTextAlign',uri:'pages/ArkUI/CanvasTextAlign'}, {title:'CanvasTextAlign',uri:'pages/ArkUI/CanvasTextAlign'},
{title:'CanvasTextBaseline',uri:'pages/ArkUI/CanvasTextBaseline'},
{title:'CanvasGlobalAlpha',uri:'pages/ArkUI/CanvasGlobalAlpha'}, {title:'CanvasGlobalAlpha',uri:'pages/ArkUI/CanvasGlobalAlpha'},
{title:'CanvasLineDashOffset',uri:'pages/ArkUI/CanvasLineDashOffset'}, {title:'CanvasLineDashOffset',uri:'pages/ArkUI/CanvasLineDashOffset'},
{title:'CanvasGlobalCompositeOperation',uri:'pages/ArkUI/CanvasGlobalCompositeOperation'}, {title:'CanvasGlobalCompositeOperation',uri:'pages/ArkUI/CanvasGlobalCompositeOperation'},
...@@ -291,30 +291,29 @@ struct IndexPage { ...@@ -291,30 +291,29 @@ struct IndexPage {
} }
let TestNum = FailNum + PassNum; let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString(); let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960); let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer); let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView); let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration(); serializer.setDeclaration();
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name","ActsArkUITest"); serializer.setAttributes("name","ActsArkUITest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum); serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum); serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsArkUITest"); serializer.setAttributes("modulename", "ActsArkUITest");
for (let i = 0; i < title.length; i++) { for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i])); serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result[i])); serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
......
...@@ -23,6 +23,9 @@ struct SetCircle { ...@@ -23,6 +23,9 @@ struct SetCircle {
@State name: string = 'CanvasFillStyle'; @State name: string = 'CanvasFillStyle';
@State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认黑色的填色区域会随点击变化'; @State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认黑色的填色区域会随点击变化';
@State Vue: boolean = false; @State Vue: boolean = false;
@State num1: number = 0;
@State num2: number = 0;
@State num3: number = 0;
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -36,7 +39,10 @@ struct SetCircle { ...@@ -36,7 +39,10 @@ struct SetCircle {
this.FillColor = '#FFFF0000'; this.FillColor = '#FFFF0000';
this.context.fillStyle = this.FillColor; this.context.fillStyle = this.FillColor;
this.context.fillRect(100, 160, 150, 100); 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%'}) Text('Yellow').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -44,7 +50,10 @@ struct SetCircle { ...@@ -44,7 +50,10 @@ struct SetCircle {
this.FillColor = '#fffffc3c'; this.FillColor = '#fffffc3c';
this.context.fillStyle = this.FillColor; this.context.fillStyle = this.FillColor;
this.context.fillRect(100, 160, 150, 100); 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%'}) Text('Green').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -52,7 +61,10 @@ struct SetCircle { ...@@ -52,7 +61,10 @@ struct SetCircle {
this.FillColor = '#ff19fa00'; this.FillColor = '#ff19fa00';
this.context.fillStyle = this.FillColor; this.context.fillStyle = this.FillColor;
this.context.fillRect(100, 160, 150, 100); 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%') }.width('70%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -47,8 +47,11 @@ struct SetCircle { ...@@ -47,8 +47,11 @@ struct SetCircle {
console.info('Pan end'); console.info('Pan end');
}) })
) )
}.width('70%').height('25%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }){
Text('透明度: ' + (this.X)*0.005 ) Text('透明度: ' + (this.X)*0.005 )
}.width('70%').height('30%') }.width('100%').height('20%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
...@@ -61,7 +64,7 @@ struct SetCircle { ...@@ -61,7 +64,7 @@ struct SetCircle {
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(200, 200, 50, 50); this.context.fillRect(200, 200, 50, 50);
}) })
}.width('100%').height('70%') }.width('100%').height('55%')
}.width('100%').height('80%').backgroundColor(Color.White) }.width('100%').height('80%').backgroundColor(Color.White)
} }
build() { build() {
......
...@@ -23,6 +23,17 @@ struct SetCircle { ...@@ -23,6 +23,17 @@ struct SetCircle {
@State name: string = 'CanvasGlobalCompositeOperation'; @State name: string = 'CanvasGlobalCompositeOperation';
@State StepTips: string = '操作步骤:点击不同的合成操作的方式'+'\n'+'预期结果:原本默认合成方式会随点击变化'; @State StepTips: string = '操作步骤:点击不同的合成操作的方式'+'\n'+'预期结果:原本默认合成方式会随点击变化';
@State Vue: boolean = false; @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(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -41,7 +52,12 @@ struct SetCircle { ...@@ -41,7 +52,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'source-over'; this.context.globalCompositeOperation = 'source-over';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('s-atop').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -51,7 +67,12 @@ struct SetCircle { ...@@ -51,7 +67,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'source-atop'; this.context.globalCompositeOperation = 'source-atop';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('s-in').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -61,7 +82,12 @@ struct SetCircle { ...@@ -61,7 +82,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'source-in'; this.context.globalCompositeOperation = 'source-in';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('s-out').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -71,7 +97,12 @@ struct SetCircle { ...@@ -71,7 +97,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'source-out'; this.context.globalCompositeOperation = 'source-out';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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}){ Row({space:10}){
...@@ -83,7 +114,12 @@ struct SetCircle { ...@@ -83,7 +114,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'destination-over'; this.context.globalCompositeOperation = 'destination-over';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('d-atop').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
...@@ -93,7 +129,12 @@ struct SetCircle { ...@@ -93,7 +129,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'destination-atop'; this.context.globalCompositeOperation = 'destination-atop';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('d-in').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
...@@ -103,7 +144,12 @@ struct SetCircle { ...@@ -103,7 +144,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'destination-in'; this.context.globalCompositeOperation = 'destination-in';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('d-out').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
...@@ -113,7 +159,12 @@ struct SetCircle { ...@@ -113,7 +159,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'destination-out'; this.context.globalCompositeOperation = 'destination-out';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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}){ Row({space:10}){
...@@ -125,7 +176,12 @@ struct SetCircle { ...@@ -125,7 +176,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'lighter'; this.context.globalCompositeOperation = 'lighter';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('copy').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
...@@ -135,7 +191,12 @@ struct SetCircle { ...@@ -135,7 +191,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'copy'; this.context.globalCompositeOperation = 'copy';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('xor').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
...@@ -145,7 +206,12 @@ struct SetCircle { ...@@ -145,7 +206,12 @@ struct SetCircle {
this.context.globalCompositeOperation = 'xor'; this.context.globalCompositeOperation = 'xor';
this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillStyle = 'rgb(0,0,255)';
this.context.fillRect(180, 180, 50, 50); 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%'}) Text('').fontSize(0).border({width:0}).size({width:'18%',height:'20%'})
} }
......
...@@ -23,6 +23,9 @@ struct SetCircle { ...@@ -23,6 +23,9 @@ struct SetCircle {
@State name: string = 'CanvasLineCap'; @State name: string = 'CanvasLineCap';
@State StepTips: string = '操作步骤:点击不同的端点样式控件'+'\n'+'预期结果:原本默认端点样式会随点击变化'; @State StepTips: string = '操作步骤:点击不同的端点样式控件'+'\n'+'预期结果:原本默认端点样式会随点击变化';
@State Vue: boolean = false; @State Vue: boolean = false;
@State num1: number = 0;
@State num2: number = 0;
@State num3: number = 0;
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -38,7 +41,10 @@ struct SetCircle { ...@@ -38,7 +41,10 @@ struct SetCircle {
this.context.moveTo(100, 100); this.context.moveTo(100, 100);
this.context.lineTo(250, 100); this.context.lineTo(250, 100);
this.context.stroke(); 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%'}) Text('round').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -49,7 +55,10 @@ struct SetCircle { ...@@ -49,7 +55,10 @@ struct SetCircle {
this.context.moveTo(100, 100); this.context.moveTo(100, 100);
this.context.lineTo(250, 100); this.context.lineTo(250, 100);
this.context.stroke(); 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%'}) Text('square').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -60,7 +69,10 @@ struct SetCircle { ...@@ -60,7 +69,10 @@ struct SetCircle {
this.context.moveTo(100, 100); this.context.moveTo(100, 100);
this.context.lineTo(250, 100); this.context.lineTo(250, 100);
this.context.stroke(); this.context.stroke();
this.Vue = true; this.num3 = 1;
if ( this.num1 == 1 && this.num3 == this.num2 ){
this.Vue = true;
}
}) })
}.width('70%').height('30%') }.width('70%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -46,8 +46,10 @@ struct SetCircle { ...@@ -46,8 +46,10 @@ struct SetCircle {
console.info('Pan end'); console.info('Pan end');
}) })
) )
}.width('70%').height('25%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('虚线偏移量: ' + (this.X)*0.1 ) Text('虚线偏移量: ' + (this.X)*0.1 )
}.width('70%').height('30%') }.width('100%').height('20%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
...@@ -59,7 +61,7 @@ struct SetCircle { ...@@ -59,7 +61,7 @@ struct SetCircle {
this.context.lineDashOffset = (this.X)*0.1; this.context.lineDashOffset = (this.X)*0.1;
this.context.stroke(); this.context.stroke();
}) })
}.width('100%').height('70%') }.width('100%').height('55%')
}.width('100%').height('80%').backgroundColor(Color.White) }.width('100%').height('80%').backgroundColor(Color.White)
} }
build() { build() {
......
...@@ -23,6 +23,9 @@ struct SetCircle { ...@@ -23,6 +23,9 @@ struct SetCircle {
@State name: string = 'CanvasLineJoin'; @State name: string = 'CanvasLineJoin';
@State StepTips: string = '操作步骤:点击不同的交点样式控件'+'\n'+'预期结果:原本默认交点样式会随点击变化'; @State StepTips: string = '操作步骤:点击不同的交点样式控件'+'\n'+'预期结果:原本默认交点样式会随点击变化';
@State Vue: boolean = false; @State Vue: boolean = false;
@State num1: number = 0;
@State num2: number = 0;
@State num3: number = 0;
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -39,7 +42,10 @@ struct SetCircle { ...@@ -39,7 +42,10 @@ struct SetCircle {
this.context.lineTo(210, 130); this.context.lineTo(210, 130);
this.context.lineTo(120, 180); this.context.lineTo(120, 180);
this.context.stroke(); 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%'}) Text('bevel').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -51,7 +57,10 @@ struct SetCircle { ...@@ -51,7 +57,10 @@ struct SetCircle {
this.context.lineTo(210, 130); this.context.lineTo(210, 130);
this.context.lineTo(120, 180); this.context.lineTo(120, 180);
this.context.stroke(); 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%'}) Text('miter').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -63,7 +72,10 @@ struct SetCircle { ...@@ -63,7 +72,10 @@ struct SetCircle {
this.context.lineTo(210, 130); this.context.lineTo(210, 130);
this.context.lineTo(120, 180); this.context.lineTo(120, 180);
this.context.stroke(); this.context.stroke();
this.Vue = true; this.num3 = 1;
if ( this.num1 == 1 && this.num3 == this.num2 ){
this.Vue = true;
}
}) })
}.width('70%').height('30%') }.width('70%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -46,8 +46,11 @@ struct SetCircle { ...@@ -46,8 +46,11 @@ struct SetCircle {
console.info('Pan end'); console.info('Pan end');
}) })
) )
Text('边框粗细: ' + (this.X)*0.05 )
}.width('70%').height('30%') }.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 }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
...@@ -57,7 +60,7 @@ struct SetCircle { ...@@ -57,7 +60,7 @@ struct SetCircle {
this.context.lineWidth = (this.X)*0.05; this.context.lineWidth = (this.X)*0.05;
this.context.strokeRect(120, 120, 120, 120); this.context.strokeRect(120, 120, 120, 120);
}) })
}.width('100%').height('70%') }.width('100%').height('50%')
}.width('100%').height('80%').backgroundColor(Color.White) }.width('100%').height('80%').backgroundColor(Color.White)
} }
build() { build() {
......
/*
* 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
...@@ -35,7 +35,7 @@ struct SetCircle { ...@@ -35,7 +35,7 @@ struct SetCircle {
.gesture( .gesture(
PanGesture({}) PanGesture({})
.onActionStart((event: GestureEvent) => { .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.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); this.context.fillRect(150, 150, 100, 100);
console.info('Pan start'); console.info('Pan start');
...@@ -48,8 +48,10 @@ struct SetCircle { ...@@ -48,8 +48,10 @@ struct SetCircle {
console.info('Pan end'); console.info('Pan end');
}) })
) )
}.width('70%').height('25%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('阴影模糊: ' + this.X ) Text('阴影模糊: ' + this.X )
}.width('70%').height('30%') }.width('100%').height('20%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
...@@ -61,7 +63,7 @@ struct SetCircle { ...@@ -61,7 +63,7 @@ struct SetCircle {
this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); this.context.fillRect(150, 150, 100, 100);
}) })
}.width('100%').height('70%') }.width('100%').height('55%')
}.width('100%').height('80%').backgroundColor(Color.White) }.width('100%').height('80%').backgroundColor(Color.White)
} }
build() { build() {
......
...@@ -24,6 +24,9 @@ struct SetCircle { ...@@ -24,6 +24,9 @@ struct SetCircle {
@State name: string = 'CanvasShadowColor'; @State name: string = 'CanvasShadowColor';
@State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认蓝色的阴影会随点击变化'; @State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认蓝色的阴影会随点击变化';
@State Vue: boolean = false; @State Vue: boolean = false;
@State num1: number = 0;
@State num2: number = 0;
@State num3: number = 0;
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -37,7 +40,10 @@ struct SetCircle { ...@@ -37,7 +40,10 @@ struct SetCircle {
this.context.shadowColor = 'rgb(0,0,255)'; this.context.shadowColor = 'rgb(0,0,255)';
this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); 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%'}) Text('Yellow').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -46,7 +52,10 @@ struct SetCircle { ...@@ -46,7 +52,10 @@ struct SetCircle {
this.context.shadowColor = '#fffffc3c'; this.context.shadowColor = '#fffffc3c';
this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); 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%'}) Text('Green').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -55,7 +64,10 @@ struct SetCircle { ...@@ -55,7 +64,10 @@ struct SetCircle {
this.context.shadowColor = '#ff19fa00'; this.context.shadowColor = '#ff19fa00';
this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); 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%') }.width('70%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -49,8 +49,11 @@ struct SetCircle { ...@@ -49,8 +49,11 @@ struct SetCircle {
console.info('Pan end'); console.info('Pan end');
}) })
) )
}.width('70%').height('25%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }){
Text('阴影偏移: ' + (this.X)*0.05 ) Text('阴影偏移: ' + (this.X)*0.05 )
}.width('70%').height('30%') }.width('100%').height('20%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
...@@ -63,7 +66,7 @@ struct SetCircle { ...@@ -63,7 +66,7 @@ struct SetCircle {
this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); this.context.fillRect(150, 150, 100, 100);
}) })
}.width('100%').height('70%') }.width('100%').height('55%')
}.width('100%').height('80%').backgroundColor(Color.White) }.width('100%').height('80%').backgroundColor(Color.White)
} }
build() { build() {
......
...@@ -49,8 +49,10 @@ struct SetCircle { ...@@ -49,8 +49,10 @@ struct SetCircle {
console.info('Pan end'); console.info('Pan end');
}) })
) )
}.width('70%').height('25%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }){
Text('阴影偏移: ' + (this.X)*0.05 ) Text('阴影偏移: ' + (this.X)*0.05 )
}.width('70%').height('30%') }.width('100%').height('20%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
...@@ -63,7 +65,7 @@ struct SetCircle { ...@@ -63,7 +65,7 @@ struct SetCircle {
this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillStyle = 'rgb(255,0,0)';
this.context.fillRect(150, 150, 100, 100); this.context.fillRect(150, 150, 100, 100);
}) })
}.width('100%').height('70%') }.width('100%').height('55%')
}.width('100%').height('80%').backgroundColor(Color.White) }.width('100%').height('80%').backgroundColor(Color.White)
} }
build() { build() {
......
...@@ -23,6 +23,9 @@ struct SetCircle { ...@@ -23,6 +23,9 @@ struct SetCircle {
@State name: string = 'CanvasStrokeStyle'; @State name: string = 'CanvasStrokeStyle';
@State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认黑色的边框会随点击变化'; @State StepTips: string = '操作步骤:点击不同的颜色控件'+'\n'+'预期结果:原本默认黑色的边框会随点击变化';
@State Vue: boolean = false; @State Vue: boolean = false;
@State num1: number = 0;
@State num2: number = 0;
@State num3: number = 0;
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -36,7 +39,10 @@ struct SetCircle { ...@@ -36,7 +39,10 @@ struct SetCircle {
this.context.lineWidth = 10; this.context.lineWidth = 10;
this.context.strokeStyle = '#FFFF0000'; this.context.strokeStyle = '#FFFF0000';
this.context.strokeRect(100, 160, 150, 100); 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%'}) Text('Yellow').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -45,7 +51,10 @@ struct SetCircle { ...@@ -45,7 +51,10 @@ struct SetCircle {
this.context.lineWidth = 10; this.context.lineWidth = 10;
this.context.strokeStyle = '#fffffc3c'; this.context.strokeStyle = '#fffffc3c';
this.context.strokeRect(100, 160, 150, 100); 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%'}) Text('Green').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
...@@ -54,7 +63,10 @@ struct SetCircle { ...@@ -54,7 +63,10 @@ struct SetCircle {
this.context.lineWidth = 10; this.context.lineWidth = 10;
this.context.strokeStyle = '#ff19fa00'; this.context.strokeStyle = '#ff19fa00';
this.context.strokeRect(100, 160, 150, 100); 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%') }.width('70%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -23,6 +23,11 @@ struct SetCircle { ...@@ -23,6 +23,11 @@ struct SetCircle {
@State name: string = 'CanvasTextAlign'; @State name: string = 'CanvasTextAlign';
@State StepTips: string = '操作步骤:点击不同的文本对齐方式控件'+'\n'+'预期结果:原本默认的对齐方式会随点击变化'; @State StepTips: string = '操作步骤:点击不同的文本对齐方式控件'+'\n'+'预期结果:原本默认的对齐方式会随点击变化';
@State Vue: boolean = false; @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(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -31,58 +36,73 @@ struct SetCircle { ...@@ -31,58 +36,73 @@ struct SetCircle {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){ Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('start').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) Text('start').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(180, 10); this.context.moveTo(180, 10);
this.context.lineTo(180, 310); this.context.lineTo(180, 310);
this.context.stroke(); this.context.stroke();
this.context.textAlign = 'start'; this.context.textAlign = 'start';
this.context.fillText('textAlign=start', 180, 160); 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%'}) Text('end').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(180, 10); this.context.moveTo(180, 10);
this.context.lineTo(180, 310); this.context.lineTo(180, 310);
this.context.stroke(); this.context.stroke();
this.context.textAlign = 'end'; this.context.textAlign = 'end';
this.context.fillText('textAlign=end', 180, 160); 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%'}) Text('left').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(180, 10); this.context.moveTo(180, 10);
this.context.lineTo(180, 310); this.context.lineTo(180, 310);
this.context.stroke(); this.context.stroke();
this.context.textAlign = 'left'; this.context.textAlign = 'left';
this.context.fillText('textAlign=left', 180, 160); 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%'}) Text('center').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(180, 10); this.context.moveTo(180, 10);
this.context.lineTo(180, 310); this.context.lineTo(180, 310);
this.context.stroke(); this.context.stroke();
this.context.textAlign = 'center'; this.context.textAlign = 'center';
this.context.fillText('textAlign=center', 180, 160); 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%'}) Text('right').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(180, 10); this.context.moveTo(180, 10);
this.context.lineTo(180, 310); this.context.lineTo(180, 310);
this.context.stroke(); this.context.stroke();
this.context.textAlign = 'right'; this.context.textAlign = 'right';
this.context.fillText('textAlign=right', 180, 160); 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%') }.width('90%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -23,6 +23,11 @@ struct SetCircle { ...@@ -23,6 +23,11 @@ struct SetCircle {
@State name: string = 'CanvasTextBaseline'; @State name: string = 'CanvasTextBaseline';
@State StepTips: string = '操作步骤:点击不同的水平对齐方式'+'\n'+'预期结果:原本默认水平对齐方式会随点击变化'; @State StepTips: string = '操作步骤:点击不同的水平对齐方式'+'\n'+'预期结果:原本默认水平对齐方式会随点击变化';
@State Vue: boolean = false; @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(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
} }
...@@ -31,7 +36,7 @@ struct SetCircle { ...@@ -31,7 +36,7 @@ struct SetCircle {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){ Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('Top').fontSize(13).border({width:2}).size({width:'18%',height:'20%'}) Text('Top').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.strokeStyle = '#0000ff'; this.context.strokeStyle = '#0000ff';
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(0, 120); this.context.moveTo(0, 120);
...@@ -39,11 +44,14 @@ struct SetCircle { ...@@ -39,11 +44,14 @@ struct SetCircle {
this.context.stroke(); this.context.stroke();
this.context.textBaseline = 'top'; this.context.textBaseline = 'top';
this.context.fillText('Top', 160, 120); 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%'}) Text('Bottom').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.strokeStyle = '#0000ff'; this.context.strokeStyle = '#0000ff';
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(0, 120); this.context.moveTo(0, 120);
...@@ -51,11 +59,14 @@ struct SetCircle { ...@@ -51,11 +59,14 @@ struct SetCircle {
this.context.stroke(); this.context.stroke();
this.context.textBaseline = 'bottom'; this.context.textBaseline = 'bottom';
this.context.fillText('Bottom', 160, 120); 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%'}) Text('Middle').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.strokeStyle = '#0000ff'; this.context.strokeStyle = '#0000ff';
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(0, 120); this.context.moveTo(0, 120);
...@@ -63,11 +74,14 @@ struct SetCircle { ...@@ -63,11 +74,14 @@ struct SetCircle {
this.context.stroke(); this.context.stroke();
this.context.textBaseline = 'middle'; this.context.textBaseline = 'middle';
this.context.fillText('Middle', 160, 120); 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%'}) Text('Alphabetic').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=>{ .onClick(()=>{
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.strokeStyle = '#0000ff'; this.context.strokeStyle = '#0000ff';
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(0, 120); this.context.moveTo(0, 120);
...@@ -75,11 +89,14 @@ struct SetCircle { ...@@ -75,11 +89,14 @@ struct SetCircle {
this.context.stroke(); this.context.stroke();
this.context.textBaseline = 'alphabetic'; this.context.textBaseline = 'alphabetic';
this.context.fillText('Alphabetic', 160, 120); 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%'}) Text('Hanging').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
.onClick(()=> { .onClick(()=> {
this.context.clearRect(0, 10, 350, 300); this.context.clearRect(0, 10, 500, 500);
this.context.strokeStyle = '#0000ff'; this.context.strokeStyle = '#0000ff';
this.context.lineWidth = 2; this.context.lineWidth = 2;
this.context.moveTo(0, 120); this.context.moveTo(0, 120);
...@@ -87,7 +104,10 @@ struct SetCircle { ...@@ -87,7 +104,10 @@ struct SetCircle {
this.context.stroke(); this.context.stroke();
this.context.textBaseline = 'hanging'; this.context.textBaseline = 'hanging';
this.context.fillText('Hanging', 160, 120); 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%') }.width('90%').height('30%')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
...@@ -270,30 +270,29 @@ struct IndexPage { ...@@ -270,30 +270,29 @@ struct IndexPage {
} }
let TestNum = FailNum + PassNum; let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString(); let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960); let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer); let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView); let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration(); serializer.setDeclaration();
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name","ActsAudioTest"); serializer.setAttributes("name","ActsAudioTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum); serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum); serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsAudioTest"); serializer.setAttributes("modulename", "ActsAudioTest");
for (let i = 0; i < title.length; i++) { for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i])); serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result[i])); serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
......
/*
* 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
/*
* 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
/*
* 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
/*
* 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
...@@ -39,12 +39,9 @@ struct IndexPage { ...@@ -39,12 +39,9 @@ struct IndexPage {
@State result : string = ''; @State result : string = '';
@State TEST : number = 0; @State TEST : number = 0;
private TestCaseList = [ private TestCaseList = [
{title:'CameraOrientation0',uri:'pages/Camera/CameraOrientation0'}, {title:'Camera Orientation',uri:'pages/Camera/CameraOrientation'},
{title:'CameraOrientation90',uri:'pages/Camera/CameraOrientation90'}, {title:'Camera Format',uri:'pages/Camera/CameraFormat'},
{title:'CameraOrientation180',uri:'pages/Camera/CameraOrientation180'}, {title:'Camera Video',uri:'pages/Camera/CameraVideo'},
{title:'CameraOrientation270',uri:'pages/Camera/CameraOrientation270'},
{title:'CameraFormat',uri:'pages/Camera/CameraFormat'},
{title:'CameraVideo',uri:'pages/Camera/CameraVideo'},
] ]
@State ColorObject : string[] = VarColor; @State ColorObject : string[] = VarColor;
async onPageShow(){ async onPageShow(){
...@@ -275,30 +272,29 @@ struct IndexPage { ...@@ -275,30 +272,29 @@ struct IndexPage {
} }
let TestNum = FailNum + PassNum; let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString(); let testNum = (TestNum).toString();
let ignoreNum = (4-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960); let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer); let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView); let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration(); serializer.setDeclaration();
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsCameraTest"); serializer.setAttributes("name", "ActsCameraTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum); serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum); serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsCameraTest"); serializer.setAttributes("modulename", "ActsCameraTest");
for (let i = 0; i < title.length; i++) { for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i])); serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result[i])); serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
......
/*
* 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)
}
}
...@@ -44,7 +44,7 @@ struct CustomContainerUser { ...@@ -44,7 +44,7 @@ struct CustomContainerUser {
} }
Row(){ Row(){
Text(`测试步骤:`+ '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' 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帧则通过测试` + '4.回到DeskFps测试项点击停止键' + '\n' + '\n' + `5.若测试最高帧率大于54帧则通过测试`
+ '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp') .fontColor(Color.White).fontSize('20fp')
...@@ -83,11 +83,26 @@ struct CustomContainerUser { ...@@ -83,11 +83,26 @@ struct CustomContainerUser {
let buf = new ArrayBuffer(4096); let buf = new ArrayBuffer(4096);
fileio.readSync(fd,buf); fileio.readSync(fd,buf);
let report = String.fromCharCode.apply(null,new Uint8Array(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('|'); let end = report.indexOf('|');
this.Fps = report.substring(head+1,end); let Fps = new Array();
let num = Number(this.Fps)
if(num >= 54 ) { 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; this.Vue = true;
} }
}) })
......
...@@ -41,6 +41,15 @@ struct IndexPage { ...@@ -41,6 +41,15 @@ struct IndexPage {
private TestCaseList = [ private TestCaseList = [
{title:'DeskFps',uri:'pages/Experience/DeskFps'}, {title:'DeskFps',uri:'pages/Experience/DeskFps'},
{title:'PhotoFps',uri:'pages/Experience/PhotoFps'}, {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; @State ColorObject : string[] = VarColor;
async onPageShow(){ async onPageShow(){
...@@ -271,30 +280,29 @@ struct IndexPage { ...@@ -271,30 +280,29 @@ struct IndexPage {
} }
let TestNum = FailNum + PassNum; let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString(); let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960); let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer); let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView); let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration(); serializer.setDeclaration();
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name","ActsExperienceTest"); serializer.setAttributes("name","ActsExperienceTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum); serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum); serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsExperienceTest"); serializer.setAttributes("modulename", "ActsExperienceTest");
for (let i = 0; i < title.length; i++) { for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i])); serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result[i])); serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
......
/*
* 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)
}
}
/*
* 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
/*
* 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
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import fileio from '@ohos.fileio'; import fileio from '@ohos.fileio';
import {CustomContainer} from '../common/ExperienceCustomContainer'; import {CustomContainer} from '../common/ExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog'; import FirstDialog from '../model/FirstDialog';
...@@ -43,7 +42,7 @@ struct CustomContainerUser { ...@@ -43,7 +42,7 @@ struct CustomContainerUser {
} }
Row(){ Row(){
Text(`测试步骤:`+ '\n' + '\n' +`1.在图库中预置500张图片`+ '\n' + '\n' +`2.点击开始键进入图库`+ '\n' + '\n' 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帧则通过测试` + '5.回到PhotoFps测试项点击停止键' + '\n' + '\n' + `6.若测试最高帧率大于或等于54帧则通过测试`
+ '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp') .fontColor(Color.White).fontSize('20fp')
...@@ -63,7 +62,6 @@ struct CustomContainerUser { ...@@ -63,7 +62,6 @@ struct CustomContainerUser {
let str = { let str = {
"bundleName": bundleName, "bundleName": bundleName,
"abilityName": abilityName, "abilityName": abilityName,
"parameters": ""
} }
globalThis.abilityContext.startAbility(str, (err, data) => { globalThis.abilityContext.startAbility(str, (err, data) => {
...@@ -86,11 +84,26 @@ struct CustomContainerUser { ...@@ -86,11 +84,26 @@ struct CustomContainerUser {
let buf = new ArrayBuffer(4096); let buf = new ArrayBuffer(4096);
fileio.readSync(fd,buf); fileio.readSync(fd,buf);
let report = String.fromCharCode.apply(null,new Uint8Array(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('|'); let end = report.indexOf('|');
this.Fps = report.substring(head+1,end); let Fps = new Array();
let num = Number(this.Fps)
if(num >= 54) { 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; this.Vue = true;
} }
}) })
......
/*
* 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)
}
}
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
...@@ -270,30 +270,29 @@ struct IndexPage { ...@@ -270,30 +270,29 @@ struct IndexPage {
} }
let TestNum = FailNum + PassNum; let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString(); let testNum = (TestNum).toString();
let ignoreNum = (24-TestNum).toString();
let arrayBuffer = new ArrayBuffer(40960); let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer); let bufView = new DataView(arrayBuffer);
let serializer = new xml.XmlSerializer(bufView); let serializer = new xml.XmlSerializer(bufView);
serializer.setDeclaration(); serializer.setDeclaration();
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name","ActsPlayerTest"); serializer.setAttributes("name","ActsPlayerTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", failNum); serializer.setAttributes("failures", failNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", testNum); serializer.setAttributes("tests", testNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsPlayerTest"); serializer.setAttributes("modulename", "ActsPlayerTest");
for (let i = 0; i < title.length; i++) { for (let i = 0; i < title.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title[i])); serializer.setAttributes("name", String(title[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result[i])); serializer.setAttributes("result", String(result[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* 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}`);
}
}
}
/*
* 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}`);
}
}
}
...@@ -323,7 +323,6 @@ struct IndexPage { ...@@ -323,7 +323,6 @@ struct IndexPage {
} }
let TestNum = FailNum + PassNum; let TestNum = FailNum + PassNum;
let testNum = (TestNum).toString(); let testNum = (TestNum).toString();
let ignoreNum = (54-TestNum).toString();
/* /*
* ArkUI * ArkUI
*/ */
...@@ -343,8 +342,7 @@ struct IndexPage { ...@@ -343,8 +342,7 @@ struct IndexPage {
ArkUIPassIndex = ArkUIReport.indexOf('Pass',ArkUIPassIndex + 1); ArkUIPassIndex = ArkUIReport.indexOf('Pass',ArkUIPassIndex + 1);
} }
let ArkUITestNum = ArkUIFailNum + ArkUIPassNum; let ArkUITestNum = ArkUIFailNum + ArkUIPassNum;
let ArkuiTestNum = (ArkUIPassNum).toString(); let ArkuiTestNum = (ArkUITestNum).toString();
let ArkUIIgnoreNum = (23-ArkUITestNum).toString();
/* /*
* Audio * Audio
*/ */
...@@ -364,8 +362,7 @@ struct IndexPage { ...@@ -364,8 +362,7 @@ struct IndexPage {
AudioPassIndex = AudioReport.indexOf('Pass',AudioPassIndex + 1); AudioPassIndex = AudioReport.indexOf('Pass',AudioPassIndex + 1);
} }
let AudioTestNum = AudioFailNum + AudioPassNum; let AudioTestNum = AudioFailNum + AudioPassNum;
let audioTestNum = (AudioPassNum).toString(); let audioTestNum = (AudioTestNum).toString();
let AudioIgnoreNum = (28-AudioTestNum).toString();
/* /*
* Camera * Camera
*/ */
...@@ -385,8 +382,7 @@ struct IndexPage { ...@@ -385,8 +382,7 @@ struct IndexPage {
CameraPassIndex = CameraReport.indexOf('Pass',CameraPassIndex + 1); CameraPassIndex = CameraReport.indexOf('Pass',CameraPassIndex + 1);
} }
let CameraTestNum = CameraFailNum + CameraPassNum; let CameraTestNum = CameraFailNum + CameraPassNum;
let cameraTestNum = (CameraPassNum).toString(); let cameraTestNum = (CameraTestNum).toString();
let CameraIgnoreNum = (28-CameraTestNum).toString();
/* /*
* Player * Player
*/ */
...@@ -406,8 +402,7 @@ struct IndexPage { ...@@ -406,8 +402,7 @@ struct IndexPage {
PlayerPassIndex = PlayerReport.indexOf('Pass',PlayerPassIndex + 1); PlayerPassIndex = PlayerReport.indexOf('Pass',PlayerPassIndex + 1);
} }
let PlayerTestNum = PlayerFailNum + PlayerPassNum; let PlayerTestNum = PlayerFailNum + PlayerPassNum;
let playerTestNum = (PlayerPassNum).toString(); let playerTestNum = (PlayerTestNum).toString();
let PlayerIgnoreNum = (28-PlayerTestNum).toString();
/* /*
* Experience * Experience
*/ */
...@@ -427,8 +422,7 @@ struct IndexPage { ...@@ -427,8 +422,7 @@ struct IndexPage {
ExperiencePassIndex = ExperienceReport.indexOf('Pass',ExperiencePassIndex + 1); ExperiencePassIndex = ExperienceReport.indexOf('Pass',ExperiencePassIndex + 1);
} }
let ExperienceTestNum = ExperienceFailNum + ExperiencePassNum; let ExperienceTestNum = ExperienceFailNum + ExperiencePassNum;
let experienceTestNum = (ExperiencePassNum).toString(); let experienceTestNum = (ExperienceTestNum).toString();
let ExperienceIgnoreNum = (28-ExperienceTestNum).toString();
let arrayBuffer = new ArrayBuffer(40960); let arrayBuffer = new ArrayBuffer(40960);
let bufView = new DataView(arrayBuffer); let bufView = new DataView(arrayBuffer);
...@@ -445,30 +439,30 @@ struct IndexPage { ...@@ -445,30 +439,30 @@ struct IndexPage {
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("unavailable", "0"); serializer.setAttributes("unavailable", "0");
serializer.setAttributes("productinfo", "{ }"); serializer.setAttributes("productinfo", "{ }");
serializer.setAttributes("modules", ""); serializer.setAttributes("modules", "*");
serializer.setAttributes("runmodules", ""); serializer.setAttributes("runmodules", "*");
/* /*
* ArkUI * ArkUI
*/ */
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsArkUITest"); serializer.setAttributes("name", "ActsArkUITest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", ArkuiFailNum); serializer.setAttributes("failures", ArkuiFailNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", ArkuiTestNum); serializer.setAttributes("tests", ArkuiTestNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsArkUITest"); serializer.setAttributes("modulename", "ActsArkUITest");
for (let i = 0; i < title1.length; i++) { for (let i = 0; i < title1.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title1[i])); serializer.setAttributes("name", String(title1[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result1[i])); serializer.setAttributes("result", String(result1[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
...@@ -477,23 +471,23 @@ struct IndexPage { ...@@ -477,23 +471,23 @@ struct IndexPage {
*/ */
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsAudioTest"); serializer.setAttributes("name", "ActsAudioTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", audioFailNum); serializer.setAttributes("failures", audioFailNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", audioTestNum); serializer.setAttributes("tests", audioTestNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsAudioTest"); serializer.setAttributes("modulename", "ActsAudioTest");
for (let i = 0; i < title2.length; i++) { for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title2[i])); serializer.setAttributes("name", String(title2[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result2[i])); serializer.setAttributes("result", String(result2[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
...@@ -502,23 +496,23 @@ struct IndexPage { ...@@ -502,23 +496,23 @@ struct IndexPage {
*/ */
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsCameraTest"); serializer.setAttributes("name", "ActsCameraTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", cameraFailNum); serializer.setAttributes("failures", cameraFailNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", cameraTestNum); serializer.setAttributes("tests", cameraTestNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsCameraTest"); serializer.setAttributes("modulename", "ActsCameraTest");
for (let i = 0; i < title2.length; i++) { for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title3[i])); serializer.setAttributes("name", String(title3[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result3[i])); serializer.setAttributes("result", String(result3[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
...@@ -527,23 +521,23 @@ struct IndexPage { ...@@ -527,23 +521,23 @@ struct IndexPage {
*/ */
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsPlayerTest"); serializer.setAttributes("name", "ActsPlayerTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", playerFailNum); serializer.setAttributes("failures", playerFailNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", playerTestNum); serializer.setAttributes("tests", playerTestNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsPlayerTest"); serializer.setAttributes("modulename", "ActsPlayerTest");
for (let i = 0; i < title2.length; i++) { for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title4[i])); serializer.setAttributes("name", String(title4[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result4[i])); serializer.setAttributes("result", String(result4[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
...@@ -552,23 +546,23 @@ struct IndexPage { ...@@ -552,23 +546,23 @@ struct IndexPage {
*/ */
serializer.startElement("testsuite"); serializer.startElement("testsuite");
serializer.setAttributes("name", "ActsExperienceTest"); serializer.setAttributes("name", "ActsExperienceTest");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("errors", "0"); serializer.setAttributes("errors", "0");
serializer.setAttributes("disabled", "0"); serializer.setAttributes("disabled", "0");
serializer.setAttributes("failures", experienceFailNum); serializer.setAttributes("failures", experienceFailNum);
serializer.setAttributes("ignored", "0"); serializer.setAttributes("ignored", "0");
serializer.setAttributes("tests", experienceTestNum); serializer.setAttributes("tests", experienceTestNum);
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.setAttributes("modulename", "ActsExperienceTest"); serializer.setAttributes("modulename", "ActsExperienceTest");
for (let i = 0; i < title2.length; i++) { for (let i = 0; i < title2.length; i++) {
serializer.startElement("testcase"); serializer.startElement("testcase");
serializer.setAttributes("name", String(title5[i])); serializer.setAttributes("name", String(title5[i]));
serializer.setAttributes("status", ""); serializer.setAttributes("status", "*");
serializer.setAttributes("time", ""); serializer.setAttributes("time", "*");
serializer.setAttributes("classname", ""); serializer.setAttributes("classname", "*");
serializer.setAttributes("result", String(result5[i])); serializer.setAttributes("result", String(result5[i]));
serializer.setAttributes("level", ""); serializer.setAttributes("level", "*");
serializer.setAttributes("message", ""); serializer.setAttributes("message", "*");
serializer.endElement(); serializer.endElement();
} }
serializer.endElement(); serializer.endElement();
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
"pages/ArkUI/CanvasStrokeStyle", "pages/ArkUI/CanvasStrokeStyle",
"pages/ArkUI/CanvasLineCap", "pages/ArkUI/CanvasLineCap",
"pages/ArkUI/CanvasLineJoin", "pages/ArkUI/CanvasLineJoin",
"pages/ArkUI/CanvasMiterLimit",
"pages/ArkUI/CanvasFont", "pages/ArkUI/CanvasFont",
"pages/ArkUI/CanvasTextAlign", "pages/ArkUI/CanvasTextAlign",
"pages/ArkUI/CanvasTextBaseline", "pages/ArkUI/CanvasTextBaseline",
...@@ -27,10 +26,6 @@ ...@@ -27,10 +26,6 @@
"pages/ArkUI/CanvasLineDashOffset", "pages/ArkUI/CanvasLineDashOffset",
"pages/ArkUI/CanvasShadowOffsetY", "pages/ArkUI/CanvasShadowOffsetY",
"pages/Camera/Camera_index", "pages/Camera/Camera_index",
"pages/Camera/CameraOrientation0",
"pages/Camera/CameraOrientation90",
"pages/Camera/CameraOrientation180",
"pages/Camera/CameraOrientation270",
"pages/Camera/CameraFormat", "pages/Camera/CameraFormat",
"pages/Camera/CameraVideo", "pages/Camera/CameraVideo",
"pages/Audio/Audio_index", "pages/Audio/Audio_index",
...@@ -39,6 +34,15 @@ ...@@ -39,6 +34,15 @@
"pages/Player/ScrollListTest", "pages/Player/ScrollListTest",
"pages/Experience/Experience_index", "pages/Experience/Experience_index",
"pages/Experience/PhotoFps", "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"
] ]
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册