Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3b14b191
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3b14b191
编写于
8月 21, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 21, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9800 增加悬浮球向SP_daemon发送命令拉起服务,同时改变了结果颜色的存储方式
Merge pull request !9800 from 田文哲/master
上级
7c978300
21e5996d
变更
66
显示空白变更内容
内联
并排
Showing
66 changed file
with
3065 addition
and
2407 deletion
+3065
-2407
validator/acts_validator/src/main/ets/MainAbility/MainAbility.ts
...or/acts_validator/src/main/ets/MainAbility/MainAbility.ts
+11
-7
validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets
...r/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets
+32
-13
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFillStyle.ets
...ts_validator/src/main/ets/pages/ArkUI/CanvasFillStyle.ets
+49
-45
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets
...or/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets
+382
-378
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets
..._validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets
+51
-47
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets
...c/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets
+276
-272
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets
...acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets
+62
-58
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets
...lidator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets
+44
-40
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets
...cts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets
+66
-62
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets
...ts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets
+43
-39
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets
...s_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets
+49
-45
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets
..._validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets
+52
-48
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets
...alidator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets
+52
-48
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets
...alidator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets
+52
-48
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets
..._validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets
+53
-49
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets
...ts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets
+89
-85
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets
...validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets
+4
-0
validator/acts_validator/src/main/ets/pages/ArkUI/LongPressGesture.ets
...s_validator/src/main/ets/pages/ArkUI/LongPressGesture.ets
+6
-2
validator/acts_validator/src/main/ets/pages/ArkUI/PanGesture.ets
...or/acts_validator/src/main/ets/pages/ArkUI/PanGesture.ets
+6
-2
validator/acts_validator/src/main/ets/pages/ArkUI/PinchGestureTest.ets
...s_validator/src/main/ets/pages/ArkUI/PinchGestureTest.ets
+6
-2
validator/acts_validator/src/main/ets/pages/ArkUI/RotationGestureTest.ets
...alidator/src/main/ets/pages/ArkUI/RotationGestureTest.ets
+6
-2
validator/acts_validator/src/main/ets/pages/ArkUI/SwipeGestureTest.ets
...s_validator/src/main/ets/pages/ArkUI/SwipeGestureTest.ets
+2
-2
validator/acts_validator/src/main/ets/pages/ArkUI/TapGesture.ets
...or/acts_validator/src/main/ets/pages/ArkUI/TapGesture.ets
+15
-11
validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets
...dator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets
+73
-71
validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets
...rc/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets
+73
-71
validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets
...lidator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets
+62
-60
validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets
...ator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets
+62
-60
validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets
...c/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets
+62
-60
validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
...r/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
+31
-13
validator/acts_validator/src/main/ets/pages/Camera/CameraFlash.ets
.../acts_validator/src/main/ets/pages/Camera/CameraFlash.ets
+15
-11
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation.ets
...validator/src/main/ets/pages/Camera/CameraOrientation.ets
+45
-40
validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets
...validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets
+122
-115
validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets
...lidator/src/main/ets/pages/Camera/CameraPreviewFormat.ets
+87
-83
validator/acts_validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets
...validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets
+62
-56
validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets
.../acts_validator/src/main/ets/pages/Camera/CameraVideo.ets
+129
-124
validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets
...acts_validator/src/main/ets/pages/Camera/Camera_index.ets
+34
-16
validator/acts_validator/src/main/ets/pages/Experience/CameraColdStartTest.ets
...tor/src/main/ets/pages/Experience/CameraColdStartTest.ets
+17
-14
validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets
...r/src/main/ets/pages/Experience/ContactsColdStartTest.ets
+13
-13
validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets
...or/src/main/ets/pages/Experience/ContactsHotStartTest.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets
.../acts_validator/src/main/ets/pages/Experience/DeskFps.ets
+30
-29
validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets
...idator/src/main/ets/pages/Experience/Experience_index.ets
+36
-14
validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets
...tor/src/main/ets/pages/Experience/KeyboardDisplayTest.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets
...dator/src/main/ets/pages/Experience/KeyboardInputTest.ets
+15
-16
validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets
...idator/src/main/ets/pages/Experience/MmsColdStartTest.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets
...lidator/src/main/ets/pages/Experience/MmsHotStartTest.ets
+13
-12
validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
...acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
+14
-32
validator/acts_validator/src/main/ets/pages/Experience/PhotosColdStartTest.ets
...tor/src/main/ets/pages/Experience/PhotosColdStartTest.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets
...ator/src/main/ets/pages/Experience/PhotosHotStartTest.ets
+15
-14
validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets
...idator/src/main/ets/pages/Experience/ScrollPhotosList.ets
+14
-15
validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets
...r/src/main/ets/pages/Experience/SettingsColdStartTest.ets
+13
-13
validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets
...or/src/main/ets/pages/Experience/SettingsHotStartTest.ets
+14
-13
validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets
...tor/src/main/ets/pages/Experience/StartBackgroundTask.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets
...dator/src/main/ets/pages/Experience/StartNotification.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets
...idator/src/main/ets/pages/Experience/StartTaskManager.ets
+14
-14
validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets
...validator/src/main/ets/pages/Experience/ViewPhotoTest.ets
+15
-16
validator/acts_validator/src/main/ets/pages/Player/Player_index.ets
...acts_validator/src/main/ets/pages/Player/Player_index.ets
+31
-15
validator/acts_validator/src/main/ets/pages/index.ets
validator/acts_validator/src/main/ets/pages/index.ets
+4
-4
validator/acts_validator/src/main/ets/pages/model/AudioRenderer.ts
.../acts_validator/src/main/ets/pages/model/AudioRenderer.ts
+16
-3
validator/acts_validator/src/main/ets/pages/model/CameraService.ts
.../acts_validator/src/main/ets/pages/model/CameraService.ts
+10
-0
validator/acts_validator/src/main/ets/pages/model/FloatBall.ets
...tor/acts_validator/src/main/ets/pages/model/FloatBall.ets
+325
-0
validator/acts_validator/src/main/ets/pages/model/FloatWindowFun.ts
...acts_validator/src/main/ets/pages/model/FloatWindowFun.ts
+76
-0
validator/acts_validator/src/main/ets/pages/model/timeTools.ts
...ator/acts_validator/src/main/ets/pages/model/timeTools.ts
+14
-0
validator/acts_validator/src/main/module.json
validator/acts_validator/src/main/module.json
+3
-0
validator/acts_validator/src/main/resources/base/element/color.json
...acts_validator/src/main/resources/base/element/color.json
+12
-0
validator/acts_validator/src/main/resources/base/media/img.png
...ator/acts_validator/src/main/resources/base/media/img.png
+0
-0
validator/acts_validator/src/main/resources/base/profile/main_pages.json
...validator/src/main/resources/base/profile/main_pages.json
+2
-1
未找到文件。
validator/acts_validator/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
3b14b191
import
Ability
from
'
@ohos.app.ability.UIAbility
'
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
;
import
{
FloatWindowFun
}
from
'
../pages/model/FloatWindowFun
'
;
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
...
...
@@ -7,6 +8,7 @@ export default class MainAbility extends Ability {
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityContext
=
this
.
context
;
globalThis
.
showFloatingWindow
=
false
;
}
onDestroy
()
{
...
...
@@ -17,15 +19,16 @@ export default class MainAbility extends Ability {
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
let
AtManager
=
abilityAccessCtrl
.
createAtManager
();
AtManager
.
requestPermissionsFromUser
(
this
.
context
,[
'
ohos.permission.READ_MEDIA
'
,
'
ohos.permission.WRITE_MEDIA
'
,
'
ohos.permission.CAPTURE_SCREEN
'
,
'
ohos.permission.INTERNET
'
,
'
ohos.permission.CAMERA
'
,
'
ohos.permission.MICROPHONE
'
,
'
ohos.permission.START_INVISIBLE_ABILITY
'
]).
then
(
()
=>
{}
);
windowStage
.
loadContent
(
'
pages/index
'
,
(
err
,
data
)
=>
{
AtManager
.
requestPermissionsFromUser
(
this
.
context
,[
"
ohos.permission.READ_MEDIA
"
,
"
ohos.permission.WRITE_MEDIA
"
,
"
ohos.permission.CAPTURE_SCREEN
"
,
"
ohos.permission.INTERNET
"
,
"
ohos.permission.CAMERA
"
,
"
ohos.permission.MICROPHONE
"
,
"
ohos.permission.START_INVISIBLE_ABILITY
"
,
"
ohos.permission.SYSTEM_FLOAT_WINDOW
"
]).
then
(()
=>
{})
windowStage
.
loadContent
(
"
pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
)
);
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
)
);
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
}
...
...
@@ -34,6 +37,7 @@ export default class MainAbility extends Ability {
}
onForeground
()
{
FloatWindowFun
.
initAllFun
();
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/ArkUI_index.ets
浏览文件 @
3b14b191
...
...
@@ -62,7 +62,9 @@ struct IndexPage {
{title:'CanvasShadowOffsetX',uri:'pages/ArkUI/CanvasShadowOffsetX'},
{title:'CanvasShadowOffsetY',uri:'pages/ArkUI/CanvasShadowOffsetY'},
]
@State ColorObject : string[] = VarColor;
@State ColorObject : Object[] = VarColor;
@State ColorTrue : Object[] = [];
@State ColorTrue2 : Object[] = [];
async onPageShow(){
let Test = null;
let context =null;
...
...
@@ -82,7 +84,7 @@ struct IndexPage {
if(Test != 1) {
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
fileio.closeSync(fd);
...
...
@@ -113,12 +115,12 @@ struct IndexPage {
let name1 = '刚刚点进了哪个用例:'+ titles;
let results = this.result;
let WriteTitle = (titles).toString();
let number = WriteTitle.length +
11
;
let number = WriteTitle.length +
7
;
let Index = ColorBack.indexOf(WriteTitle);
if (this.result === 'true '){
this.ColorObject[this.current] = '
#ff008000
';
let Log = (titles+';'+'
#ff008000
'+';');
this.ColorObject[this.current] = '
true
';
let Log = (titles+';'+'
true
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -131,8 +133,8 @@ struct IndexPage {
filewrite(name1,results,titles);
}
else if (this.result === 'false'){
this.ColorObject[this.current] = '
#ffff0000
';
let Log = (titles+';'+'
#ffff0000
'+';');
this.ColorObject[this.current] = '
false
';
let Log = (titles+';'+'
false
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -148,6 +150,22 @@ struct IndexPage {
this.ColorObject[this.current] = this.ColorObject[this.current];
}
}
for (let i = 0; i < TestList.length; i++){
if (this.ColorObject[i] === 'true '){
this.ColorTrue[i] = 0x263526
this.ColorTrue2[i] = 0x0CB60C
}
else if (this.ColorObject[i] === 'false'){
this.ColorTrue[i] = 0x380303
this.ColorTrue2[i] = 0xd60a0a
}
else {
this.ColorTrue[i] = 0x000000
this.ColorTrue2[i] = 0x000000
}
}
}
build(){
Column(){
...
...
@@ -178,7 +196,7 @@ struct IndexPage {
action: () => {
this.ClearAll = true;
this.ColorObject.forEach((value, index) => {
this.ColorObject[index] = '
#ff808080
';
this.ColorObject[index] = '
none
';
});
this.ClearText();
prompt.showToast({
...
...
@@ -225,12 +243,13 @@ struct IndexPage {
})
}
}.width('100%').justifyContent(FlexAlign.SpaceAround).margin({top:'15vp'}).height('6%').backgroundColor(Color.Black)
List({
space:5
}){
List({}){
ForEach(this.TestCaseList,(item,index) => {
ListItem(){
Row(){
Text(item.title).fontSize(16).fontColor(Color.Black)
}.width('100%').height(50).alignItems(VerticalAlign.Center).backgroundColor(this.count===0&&this.TEST===0?'#ff808080':this.ColorObject[index])
Text(item.title).fontSize(20).fontColor(Color.White)
}.width('100%').height(50).alignItems(VerticalAlign.Center)
.linearGradient(this.count===0&&this.TEST===0?{angle: 90,colors: [[0x000000, 0.0],[0x000000, 1.0]]}:{ angle: 90,colors: [[this.ColorTrue[index], 0.0], [this.ColorTrue2[index], 0.618]]})
.onClick(( )=>{
this.count = 1;
this.ClearAll=false;
...
...
@@ -241,7 +260,7 @@ struct IndexPage {
})
}
},item => item.title)
}.width('100%').height('92%')
}.width('100%').height('92%')
.divider({strokeWidth:1,color:Color.Grey})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
ClearText(){
...
...
@@ -249,7 +268,7 @@ struct IndexPage {
fileio.mkdirSync(path1);
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
}
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFillStyle.ets
浏览文件 @
3b14b191
...
...
@@ -32,6 +32,8 @@ struct SetCircle {
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('Red').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
...
...
@@ -78,6 +80,8 @@ struct SetCircle {
this.context.fillRect(100, 160, 150, 100);
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasFont.ets
浏览文件 @
3b14b191
...
...
@@ -50,6 +50,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Row(){
...
...
@@ -452,6 +454,8 @@ struct SetCircle {
.onReady(() =>{
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets
浏览文件 @
3b14b191
...
...
@@ -30,6 +30,8 @@ struct SetCircle {
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('→').fontSize(16).border({width:2}).size({width:'20%',height:'20%'})
...
...
@@ -79,6 +81,8 @@ struct SetCircle {
this.context.fillRect(200, 200, 50, 50);
})
}.width('100%').height('55%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalCompositeOperation.ets
浏览文件 @
3b14b191
...
...
@@ -39,6 +39,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Row(){
...
...
@@ -324,6 +326,8 @@ struct SetCircle {
.onReady(() =>{
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineCap.ets
浏览文件 @
3b14b191
...
...
@@ -31,6 +31,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('butt').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
...
...
@@ -90,6 +92,8 @@ struct SetCircle {
this.context.stroke();
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets
浏览文件 @
3b14b191
...
...
@@ -29,6 +29,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('→').fontSize(16).border({width:2}).size({width:'20%',height:'20%'})
...
...
@@ -70,6 +72,8 @@ struct SetCircle {
.onReady(() =>{
})
}.width('100%').height('55%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineJoin.ets
浏览文件 @
3b14b191
...
...
@@ -31,6 +31,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('round').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
...
...
@@ -94,6 +96,8 @@ struct SetCircle {
this.context.stroke();
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets
浏览文件 @
3b14b191
...
...
@@ -29,6 +29,8 @@ struct SetCircle {
}
@State X: number = 20;
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('→').fontSize(16).border({width:2}).size({width:'20%',height:'20%'})
...
...
@@ -70,6 +72,8 @@ struct SetCircle {
this.context.strokeRect(120, 120, 120, 120);
})
}.width('100%').height('50%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets
浏览文件 @
3b14b191
...
...
@@ -29,6 +29,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('→').fontSize(16).border({width:2}).size({width:'20%',height:'20%'})
...
...
@@ -75,6 +77,8 @@ struct SetCircle {
this.context.fillRect(150, 150, 100, 100);
})
}.width('100%').height('55%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowColor.ets
浏览文件 @
3b14b191
...
...
@@ -32,6 +32,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('Blue').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
...
...
@@ -81,6 +83,8 @@ struct SetCircle {
this.context.fillRect(150, 150, 100, 100);
})
}.width('100%').height('60%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets
浏览文件 @
3b14b191
...
...
@@ -29,6 +29,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('→').fontSize(16).border({width:2}).size({width:'20%',height:'20%'})
...
...
@@ -79,6 +81,8 @@ struct SetCircle {
this.context.fillRect(150, 150, 100, 100);
})
}.width('100%').height('55%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets
浏览文件 @
3b14b191
...
...
@@ -29,6 +29,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('→').fontSize(16).border({width:2}).size({width:'20%',height:'20%'})
...
...
@@ -78,6 +80,8 @@ struct SetCircle {
this.context.fillRect(150, 150, 100, 100);
})
}.width('100%').height('55%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasStrokeStyle.ets
浏览文件 @
3b14b191
...
...
@@ -31,6 +31,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('Red').fontSize(16).border({width:2}).size({width:'25%',height:'20%'})
...
...
@@ -81,6 +83,8 @@ struct SetCircle {
this.context.strokeRect(100, 160, 150, 100);
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextAlign.ets
浏览文件 @
3b14b191
...
...
@@ -33,6 +33,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('start').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
...
...
@@ -119,6 +121,8 @@ struct SetCircle {
this.context.stroke();
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/CanvasTextBaseline.ets
浏览文件 @
3b14b191
...
...
@@ -33,6 +33,8 @@ struct SetCircle {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }){
Text('Top').fontSize(13).border({width:2}).size({width:'18%',height:'20%'})
...
...
@@ -125,6 +127,8 @@ struct SetCircle {
this.context.stroke();
})
}.width('100%').height('70%')
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/LongPressGesture.ets
浏览文件 @
3b14b191
...
...
@@ -26,11 +26,13 @@ struct LongPressGestureExample {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.
flower")).height('60%').width('7
0%')
Image($r("app.media.
img")).height('60%').width('6
0%')
}
.height('
2
50vp').width('350vp').padding(20)
.height('
3
50vp').width('350vp').padding(20)
.gesture(
LongPressGesture({ repeat: true })
.onAction((event: GestureEvent) => {
...
...
@@ -46,6 +48,8 @@ struct LongPressGestureExample {
})
)
Text('长按动作连续触发:' + this.X).fontColor(Color.Black)
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
.justifyContent(FlexAlign.SpaceEvenly)
}
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/PanGesture.ets
浏览文件 @
3b14b191
...
...
@@ -28,10 +28,12 @@ struct PanGestureExample {
}
@Builder specificNoParam() {
Column() {
Scroll(){
Column(){
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.
flower")).height('60%').width('7
0%')
Image($r("app.media.
img")).height('60%').width('6
0%')
}
.height('
2
50vp').width('350vp').padding(20)
.height('
3
50vp').width('350vp').padding(20)
.margin(80).translate({ x: this.X, y: this.Y, z: 5 })
.gesture(
PanGesture({})
...
...
@@ -48,6 +50,8 @@ struct PanGestureExample {
})
)
Text('偏移坐标x: ' + this.X + '\n' + '偏移坐标y: ' + this.Y)
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
.justifyContent(FlexAlign.SpaceEvenly)
}
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/PinchGestureTest.ets
浏览文件 @
3b14b191
...
...
@@ -27,10 +27,12 @@ struct PinchGuestureTest {
}
@Builder specificNoParam() {
Column(){
Scroll() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.
flower")).height('60%').width('7
0%')
Image($r("app.media.
img")).height('60%').width('6
0%')
}
.height('
2
50vp').width('350vp').padding(20)
.height('
3
50vp').width('350vp').padding(20)
.scale({ x: this.X, y: this.X, z: this.X })
.gesture(
PinchGesture()
...
...
@@ -40,6 +42,8 @@ struct PinchGuestureTest {
})
)
Text('捏合放缩比例:'+this.X).fontColor(Color.Black)
}
}
} .width('100%').height('80%').backgroundColor(Color.White)
.justifyContent(FlexAlign.SpaceEvenly)
}
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/RotationGestureTest.ets
浏览文件 @
3b14b191
...
...
@@ -27,10 +27,12 @@ struct RotationGuestureTest {
}
@Builder specificNoParam() {
Column(){
Scroll() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.
flower")).height('60%').width('7
0%')
Image($r("app.media.
img")).height('60%').width('6
0%')
}
.height('
2
50vp').width('350vp').padding(20)
.height('
3
50vp').width('350vp').padding(20)
.rotate({ x:1, y:1, z:1, angle: this.X })
.margin(80)
.gesture(
...
...
@@ -41,6 +43,8 @@ struct RotationGuestureTest {
})
)
Text('旋转角度:' + this.X)
}
}
}.height('80%').width('100%').backgroundColor(Color.White)
}
build() {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/SwipeGestureTest.ets
浏览文件 @
3b14b191
...
...
@@ -29,9 +29,9 @@ struct SwipeGestureTest {
@Builder specificNoParam() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.
flower")).height('60%').width('7
0%')
Image($r("app.media.
img")).height('60%').width('6
0%')
}
.height('
2
50vp').width('350vp').padding(20)
.height('
3
50vp').width('350vp').padding(20)
.rotate({x: 0, y: 0, z: 1, angle: this.X})
.gesture(
SwipeGesture({fingers: 1, direction: SwipeDirection.Vertical})
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/TapGesture.ets
浏览文件 @
3b14b191
...
...
@@ -26,11 +26,13 @@ struct TapGestureExample {
await FirstDialog.ChooseDialog(this.StepTips,this.name);
}
@Builder specificNoParam() {
Column() {
Scroll() {
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Image($r("app.media.flower")).height('60%').width('7
0%')
Image($r("app.media.img")).height('60%').width('6
0%')
}
.height('2
50vp').width('350vp').padding(20)
.height('3
50vp').width('350vp').padding(20)
.gesture(
TapGesture({ count: 2 })
.onAction(() => {
...
...
@@ -39,6 +41,8 @@ struct TapGestureExample {
})
)
Text(this.value)
}
}
}.width('100%').height('80%').backgroundColor(Color.White)
.justifyContent(FlexAlign.SpaceEvenly)
}
...
...
validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets
浏览文件 @
3b14b191
...
...
@@ -98,6 +98,7 @@ struct audioInputRouting {
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) {
Scroll() {
Column(){
Row(){
Text(`是否设备支持TypeC耳机?`).fontColor(Color.White).fontSize('18fp')
...
...
@@ -176,6 +177,7 @@ struct audioInputRouting {
}
}
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
...
...
validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets
浏览文件 @
3b14b191
...
...
@@ -98,6 +98,7 @@ struct audioInputRouting {
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) {
Scroll() {
Column(){
Row(){
Text(`是否设备支持3.5mm耳机?`).fontColor(Color.White).fontSize('18fp')
...
...
@@ -176,6 +177,7 @@ struct audioInputRouting {
}
}
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
...
...
validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets
浏览文件 @
3b14b191
...
...
@@ -88,6 +88,7 @@ struct audioOutputRouting {
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Scroll() {
Column(){
Row(){
Text(`是否设备支持蓝牙耳机?`).fontColor(Color.White).fontSize('18fp')
...
...
@@ -156,6 +157,7 @@ struct audioOutputRouting {
}
}
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
...
...
validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets
浏览文件 @
3b14b191
...
...
@@ -88,6 +88,7 @@ struct audioOutputRouting {
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Scroll() {
Column(){
Row(){
Text(`是否设备支持TypeC耳机?`).fontColor(Color.White).fontSize('18fp')
...
...
@@ -156,6 +157,7 @@ struct audioOutputRouting {
}
}
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
...
...
validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets
浏览文件 @
3b14b191
...
...
@@ -88,6 +88,7 @@ struct audioOutputRouting {
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Column() {
Flex({direction:FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Scroll() {
Column(){
Row(){
Text(`是否设备支持3.5mm有线耳机?`).fontColor(Color.White).fontSize('18fp')
...
...
@@ -157,6 +158,7 @@ struct audioOutputRouting {
}
}
}
}
}.width('100%').height('80%').backgroundColor(Color.Black)
.justifyContent(FlexAlign.SpaceEvenly)
CustomContainer({
...
...
validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
浏览文件 @
3b14b191
...
...
@@ -45,7 +45,9 @@ struct IndexPage {
{title:'AudioOutputRoutingTest(TypeC)',uri:'pages/Audio/AudioOutputRoutingTypeC'},
{title:'AudioOutputRoutingTest(BT)',uri:'pages/Audio/AudioOutputRoutingBT'},
]
@State ColorObject : string[] = VarColor;
@State ColorObject : Object[] = VarColor;
@State ColorTrue : Object[] = [];
@State ColorTrue2 : Object[] = [];
async onPageShow(){
let Test = null;
let context =null;
...
...
@@ -65,7 +67,7 @@ struct IndexPage {
if(Test != 1) {
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
fileio.closeSync(fd);
...
...
@@ -96,12 +98,12 @@ struct IndexPage {
let name1 = '刚刚点进了哪个用例:'+ titles;
let results = this.result;
let WriteTitle = (titles).toString();
let number = WriteTitle.length +
11
;
let number = WriteTitle.length +
7
;
let Index = ColorBack.indexOf(WriteTitle);
if (this.result === 'true '){
this.ColorObject[this.current] = '
#ff008000
';
let Log = (titles+';'+'
#ff008000
'+';');
this.ColorObject[this.current] = '
true
';
let Log = (titles+';'+'
true
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -114,8 +116,8 @@ struct IndexPage {
filewrite(name1,results,titles)
}
else if (this.result === 'false'){
this.ColorObject[this.current] = '
#ffff0000
';
let Log = (titles+';'+'
#ffff0000
'+';');
this.ColorObject[this.current] = '
false
';
let Log = (titles+';'+'
false
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -127,10 +129,25 @@ struct IndexPage {
fileio.writeSync(Fd,Report);
filewrite(name1,results,titles);
}
else
if (this.result === 'None')
{
else {
this.ColorObject[this.current] = this.ColorObject[this.current];
}
}
for (let i = 0; i < TestList.length; i++){
if (this.ColorObject[i] === 'true '){
this.ColorTrue[i] = 0x263526
this.ColorTrue2[i] = 0x0CB60C
}
else if (this.ColorObject[i] === 'false'){
this.ColorTrue[i] = 0x380303
this.ColorTrue2[i] = 0xd60a0a
}
else {
this.ColorTrue[i] = 0x000000
this.ColorTrue2[i] = 0x000000
}
}
}
build(){
Column(){
...
...
@@ -161,7 +178,7 @@ struct IndexPage {
action: () => {
this.ClearAll = true;
this.ColorObject.forEach((value, index) => {
this.ColorObject[index] = '
#ff808080
';
this.ColorObject[index] = '
none
';
});
this.ClearText();
prompt.showToast({
...
...
@@ -208,12 +225,13 @@ struct IndexPage {
})
}
}.width('100%').justifyContent(FlexAlign.SpaceAround).margin({top:'15vp'}).height('6%').backgroundColor(Color.Black)
List({
space:5
}){
List({}){
ForEach(this.TestCaseList,(item,index) => {
ListItem(){
Row(){
Text(item.title).fontSize(16).fontColor(Color.Black)
}.width('100%').height(50).alignItems(VerticalAlign.Center).backgroundColor(this.count===0&&this.TEST===0?'#ff808080':this.ColorObject[index])
Text(item.title).fontSize(20).fontColor(Color.White)
}.width('100%').height(50).alignItems(VerticalAlign.Center)
.linearGradient(this.count===0&&this.TEST===0?{angle: 90,colors: [[0x000000, 0.0],[0x000000, 1.0]]}:{ angle: 90,colors: [[this.ColorTrue[index], 0.0], [this.ColorTrue2[index], 0.618]]})
.onClick(( )=>{
this.count = 1;
this.ClearAll=false;
...
...
@@ -224,7 +242,7 @@ struct IndexPage {
})
}
},item => item.title)
}.width('100%').height('92%')
}.width('100%').height('92%')
.divider({strokeWidth:1,color:Color.Grey})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
ClearText(){
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraFlash.ets
浏览文件 @
3b14b191
...
...
@@ -104,6 +104,8 @@ struct cameraOrientation {
}.size({ width: '10%', height: '30%' })
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start, direction: FlexDirection.Column }) {
Scroll() {
Column() {
// Text(`提示:` + this.isFlash).fontSize('16fp').fontColor(Color.White)
Text(`提示:如果设备存在闪光灯,选择开启,否则选择无闪光灯`)
.fontSize('16fp').fontColor(Color.White).margin('20fp')
...
...
@@ -115,6 +117,8 @@ struct cameraOrientation {
this.Vue = true
})
}.justifyContent(FlexAlign.SpaceEvenly).width('100%').margin('20fp')
}
}
}.width('80%').height('50%')
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation.ets
浏览文件 @
3b14b191
...
...
@@ -118,6 +118,8 @@ struct cameraOrientation {
Text('hello').fontColor(Color.White).visibility(Visibility.Hidden)
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Scroll() {
Column() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) {
Column() {
XComponent({
...
...
@@ -136,13 +138,13 @@ struct cameraOrientation {
})
.size({ width: '100%', height: '100%' })
Text('预览').fontSize('20fp').fontColor(Color.White)
}.size({ width: '40%', height: '60
%' })
}.size({ width: '40%', height: '65
%' })
Column() {
Image(this.assetUri || '').size({ width: '100%', height: '100%' }).border({ width: 1 })
Text('带旋转角度的图片').fontSize('20fp').fontColor(Color.White)
}.size({ width: '40%', height: '60
%' })
}.width('100%').height('5
0%')
}.size({ width: '40%', height: '65
%' })
}.width('100%').height('6
0%')
Flex({ direction: FlexDirection.Column }) {
Text(`Camera: ${this.cameraDeviceIndex}`).fontSize('16fp').fontColor(Color.White)
...
...
@@ -162,6 +164,9 @@ struct cameraOrientation {
.onClick(async () => {
this.onChangeTake()
})
}
}.height('80%')
CustomContainer({
title: this.name,
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets
浏览文件 @
3b14b191
...
...
@@ -125,6 +125,8 @@ struct cameraOrientation {
Text('hello').fontColor(Color.White).visibility(Visibility.Hidden)
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Scroll() {
Column() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) {
Column() {
XComponent({
...
...
@@ -141,13 +143,14 @@ struct cameraOrientation {
})
.size({ width: '100%', height: '100%' })
Text('预览').fontSize('20fp').fontColor(Color.White)
}.size({ width: '40%', height: '60
%' })
}.size({ width: '40%', height: '65
%' })
Column() {
Image(this.assetUri || '').size({ width: '100%', height: '100%' }).border({ width: 1 })
Text('图片').fontSize('20fp').fontColor(Color.White)
}.size({ width: '40%', height: '60%' })
}.width('100%').height('50%')
}.size({ width: '40%', height: '65%' })
}.width('100%').height('60%')
Flex({ direction: FlexDirection.Column }) {
Row() {
...
...
@@ -195,7 +198,7 @@ struct cameraOrientation {
Text(`提示:不同拍照分辨率下进行拍摄,图片拍摄成功且与预览画面一致则选择pass,否则选择fail`)
.fontSize('16fp').fontColor(Color.White).margin({ top: 20 })
}.size({ width: '80%', height: '20
%' })
}.size({ width: '80%', height: '25
%' })
Row() {
Button('拍照')
...
...
@@ -249,6 +252,10 @@ struct cameraOrientation {
})
}.width('100%').justifyContent(FlexAlign.SpaceEvenly)
.height('10%')
}
}.height('80%')
CustomContainer({
title: this.name,
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets
浏览文件 @
3b14b191
...
...
@@ -131,6 +131,8 @@ struct cameraFormat {
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround, direction: FlexDirection.Column }) {
Scroll() {
Column() {
Column() {
XComponent({
id: 'componentId',
...
...
@@ -144,10 +146,9 @@ struct cameraFormat {
Logger.info(this.tag, `onLoad surfaceId: ${this.surfaceId}`)
this.cameraInit()
})
.size({ width: '100%', height: '10
0%' })
.size({ width: '100%', height: '7
0%' })
Text('预览').fontSize('20fp').fontColor(Color.White)
}.size({ width: '80%', height: '70%' })
}.size({ width: '80%' })
Column() {
Row() {
Select(this.resolution)
...
...
@@ -215,6 +216,9 @@ struct cameraFormat {
})
}.size({ width: '100%', height: '50%' }).justifyContent(FlexAlign.SpaceEvenly)
}.size({ width: '100%', height: '20%' })
}
}
}.height('80%').width('100%')
CustomContainer({
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets
浏览文件 @
3b14b191
...
...
@@ -116,6 +116,8 @@ struct cameraOrientation {
Text('hello').fontColor(Color.White).visibility(Visibility.Hidden)
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Scroll() {
Column() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) {
Column() {
XComponent({
...
...
@@ -134,13 +136,13 @@ struct cameraOrientation {
})
.size({ width: '100%', height: '100%' })
Text('预览').fontSize('20fp').fontColor(Color.White)
}.size({ width: '40%', height: '60
%' })
}.size({ width: '40%', height: '65
%' })
Column() {
Image(this.assetUri || '').size({ width: '100%', height: '100%' }).border({ width: 1 })
Text('图片').fontSize('20fp').fontColor(Color.White)
}.size({ width: '40%', height: '60
%' })
}.width('100%').height('5
0%')
}.size({ width: '40%', height: '65
%' })
}.width('100%').height('6
0%')
Flex({ direction: FlexDirection.Column }) {
Select(this.cameraList)
...
...
@@ -176,6 +178,10 @@ struct cameraOrientation {
this.clickSerialPhotoVal++
}, 1000)
})
}
}.height('80%')
CustomContainer({
title: this.name,
...
...
validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets
浏览文件 @
3b14b191
...
...
@@ -141,6 +141,8 @@ struct cameraOrientation {
Text('hello').fontColor(Color.White).visibility(Visibility.Hidden)
}.backgroundColor(Color.Black).height('10%').width('100%').justifyContent(FlexAlign.SpaceBetween)
Scroll() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceEvenly }) {
Column() {
...
...
@@ -174,7 +176,7 @@ struct cameraOrientation {
}
}.size({ width: '45%', height: '100%' })
}.size({ width: '100%', height: '5
0%' })
}.size({ width: '100%', height: '6
0%' })
Column() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceEvenly }) {
...
...
@@ -270,6 +272,9 @@ struct cameraOrientation {
})
}.size({ width: '100%', height: '50%' }).justifyContent(FlexAlign.SpaceEvenly)
}.size({ width: '100%', height: '30%' })
}
}.height('80%')
CustomContainer({
title: this.name,
...
...
validator/acts_validator/src/main/ets/pages/Camera/Camera_index.ets
浏览文件 @
3b14b191
...
...
@@ -46,7 +46,9 @@ struct IndexPage {
{ title: 'CameraVideo', uri: 'pages/Camera/CameraVideo' },
{ title: 'CameraFlash', uri: 'pages/Camera/CameraFlash' },
]
@State ColorObject : string[] = VarColor;
@State ColorObject : Object[] = VarColor;
@State ColorTrue : Object[] = [];
@State ColorTrue2 : Object[] = [];
async onPageShow(){
let Test = null;
let context =null;
...
...
@@ -66,7 +68,7 @@ struct IndexPage {
if(Test != 1) {
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
fileio.closeSync(fd);
...
...
@@ -97,12 +99,12 @@ struct IndexPage {
let name1 = '刚刚点进了哪个用例:'+ titles;
let results = this.result;
let WriteTitle = (titles).toString();
let number = WriteTitle.length +
11
;
let number = WriteTitle.length +
7
;
let Index = ColorBack.indexOf(WriteTitle);
if (this.result === 'true '){
this.ColorObject[this.current] = '
#ff008000
';
let Log = (titles+';'+'
#ff008000
'+';');
this.ColorObject[this.current] = '
true
';
let Log = (titles+';'+'
true
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -115,8 +117,8 @@ struct IndexPage {
filewrite(name1,results,titles)
}
else if (this.result === 'false'){
this.ColorObject[this.current] = '
#ffff0000
';
let Log = (titles+';'+'
#ffff0000
'+';');
this.ColorObject[this.current] = '
false
';
let Log = (titles+';'+'
false
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -128,10 +130,25 @@ struct IndexPage {
fileio.writeSync(Fd,Report);
filewrite(name1,results,titles);
}
else
if (this.result === 'None')
{
else {
this.ColorObject[this.current] = this.ColorObject[this.current];
}
}
for (let i = 0; i < TestList.length; i++){
if (this.ColorObject[i] === 'true '){
this.ColorTrue[i] = 0x263526
this.ColorTrue2[i] = 0x0CB60C
}
else if (this.ColorObject[i] === 'false'){
this.ColorTrue[i] = 0x380303
this.ColorTrue2[i] = 0xd60a0a
}
else {
this.ColorTrue[i] = 0x000000
this.ColorTrue2[i] = 0x000000
}
}
}
build(){
Column(){
...
...
@@ -143,9 +160,9 @@ struct IndexPage {
router.back();
})
Row(){
Text('Camera')
Text('Camera
SubSystem
')
.fontColor(Color.White)
.fontSize('2
0
fp')
.fontSize('2
2
fp')
}.justifyContent(FlexAlign.SpaceAround).backgroundColor(Color.Black)
Row() {
Button(){
...
...
@@ -162,7 +179,7 @@ struct IndexPage {
action: () => {
this.ClearAll = true;
this.ColorObject.forEach((value, index) => {
this.ColorObject[index] = '
#ff808080
';
this.ColorObject[index] = '
none
';
});
this.ClearText();
prompt.showToast({
...
...
@@ -209,12 +226,13 @@ struct IndexPage {
})
}
}.width('100%').justifyContent(FlexAlign.SpaceAround).margin({top:'15vp'}).height('6%').backgroundColor(Color.Black)
List({
space:5
}){
List({}){
ForEach(this.TestCaseList,(item,index) => {
ListItem(){
Row(){
Text(item.title).fontSize(16).fontColor(Color.Black)
}.width('100%').height(50).alignItems(VerticalAlign.Center).backgroundColor(this.count===0&&this.TEST===0?'#ff808080':this.ColorObject[index])
Text(item.title).fontSize(20).fontColor(Color.White)
}.width('100%').height(50).alignItems(VerticalAlign.Center)
.linearGradient(this.count===0&&this.TEST===0?{angle: 90,colors: [[0x000000, 0.0],[0x000000, 1.0]]}:{ angle: 90,colors: [[this.ColorTrue[index], 0.0], [this.ColorTrue2[index], 0.618]]})
.onClick(( )=>{
this.count = 1;
this.ClearAll=false;
...
...
@@ -225,7 +243,7 @@ struct IndexPage {
})
}
},item => item.title)
}.width('100%').height('92%')
}.width('100%').height('92%')
.divider({strokeWidth:1,color:Color.Grey})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
ClearText(){
...
...
@@ -233,7 +251,7 @@ struct IndexPage {
fileio.mkdirSync(path1);
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/CameraColdStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,18 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let CameraColdPath = path1 + '/ColdStartCamera.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'CameraColdStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用冷启动时延小于2300ms则测试通过';
@State toSP_daemon: string = 'SP_daemon -editor coldStartHM com.ohos.camera 相机 ohtest';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -39,6 +37,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,10 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '
1.测试设备通过USB连接工作台' + '\n' + '\n' + `2
.点击开始键进入系统桌面` + '\n' + '\n'
+ `
3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>相机测试,回车执行
`
+ '\n' + '\n' +
`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果'
+ '\n' + '\n' +
`7.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n'
)
Text(`测试步骤:`+ '\n' + '\n' + '
\n' + '\n' + `1
.点击开始键进入系统桌面` + '\n' + '\n'
+ `
2.清空后台应用` + '\n' + '\n' + `3.快速点击桌面相机应用` + '\n' + '\n' +`4.测试应用拉起后手动返回validator界面
`
+ '\n' + '\n' +
'5.点击结束键观察测试结果' + '\n' + '\n' + `6.若冷启动测试在规定时延内完成则通过测试`
+ '\n' + '\n' +
'PS:双击悬浮球中断测试,长按悬浮球快速结束测试'
)
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +66,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -87,23 +88,25 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
this.StartEnable = !this.StartEnable;
/*
camera
*/
let CameraFd = fileio.openSync(CameraColdPath, 0o100 | 0o2002, 0o664);
let CameraBuf = new ArrayBuffer(4096);
fileio.readSync(CameraFd,CameraBuf);
let CameraReport = String.fromCharCode.apply(null,new Uint8Array(CameraBuf));
console.log('result num: ' + globalThis.resultNum);
let CameraReport = globalThis.resultNum;
let CameraHead = CameraReport.indexOf('time:');
let CameraTime = CameraReport.substring(CameraHead+5);
this.cameraNum = parseFloat(CameraTime);
if( 0 < this.cameraNum && this.cameraNum < 2300 ) {
this.num++
} else if ( isNaN(this.cameraNum )){
this.cameraNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,15 +13,12 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let ContactsColdPath = path1 + '/ColdStartContacts.log';
@Entry
@Component
struct CustomContainerUser {
...
...
@@ -35,10 +32,13 @@ struct CustomContainerUser {
@State mmsNum: number = 0;
@State cameraNum: number = 0;
@State contactsNum: number = 0;
@State toSP_daemon: string = 'SP_daemon -editor coldStartHM com.ohos.contacts 联系人 ohtest'
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n'
+ `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>联系人测试,回车执行`
+ '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果'
+ '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面` + '\n' + '\n'
+ `2.清空后台应用` + '\n' + '\n' + `3.快速点击桌面联系人应用` + '\n' + '\n' +`4.测试应用拉起后手动返回validator界面`
+ '\n' + '\n' + '5.点击结束键观察测试结果' + '\n' + '\n' + `6.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +65,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -87,23 +87,23 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
this.StartEnable = !this.StartEnable
;
/*
Contacts
*/
let ContactsFd = fileio.openSync(ContactsColdPath, 0o100 | 0o2002, 0o664);
let ContactsBuf = new ArrayBuffer(4096);
fileio.readSync(ContactsFd,ContactsBuf);
let ContactsReport = String.fromCharCode.apply(null,new Uint8Array(ContactsBuf));
let ContactsReport = globalThis.resultNum;
let ContactsHead = ContactsReport.indexOf('time:');
let ContactsTime = ContactsReport.substring(ContactsHead+5);
this.contactsNum = parseFloat(ContactsTime);
if( 0 < this.contactsNum && this.contactsNum < 2300 ) {
this.num++
} else if ( isNaN(this.contactsNum )){
this.contactsNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,17 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let ContactsColdPath = path1 + '/HotStartContacts.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'ContactsHotStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用热启动时延小于600ms则测试通过';
@State toSP_daemon: string = 'SP_daemon -editor hotStart com.ohos.contacts 联系人 ohtest';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:应用热启动时延小于600ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -39,6 +36,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +50,10 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '
1.测试设备通过USB连接工作台' + '\n' + '\n' + `2
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
3.开启联系人应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>联系人测试
`+ '\n' + '\n' +
`
5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6
.点击结束键观察测试结果' + '\n' + '\n'
+ `
7.若所有热启动测试均
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '
\n' + '\n' + `1
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
2.开启联系人应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `3.再次启动桌面联系人应用
`+ '\n' + '\n' +
`
4.测试应用拉起后返回validator界面` + '\n' + '\n' + '5
.点击结束键观察测试结果' + '\n' + '\n'
+ `
6.若联系人热启动测试
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +65,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -87,23 +87,23 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
this.StartEnable = !this.StartEnable
;
/*
Contacts
*/
let ContactsFd = fileio.openSync(ContactsColdPath, 0o100 | 0o2002, 0o664);
let ContactsBuf = new ArrayBuffer(4096);
fileio.readSync(ContactsFd,ContactsBuf);
let ContactsReport = String.fromCharCode.apply(null,new Uint8Array(ContactsBuf));
let ContactsReport = globalThis.resultNum;
let ContactsHead = ContactsReport.indexOf(':');
let ContactsTime = ContactsReport.substring(ContactsHead+1);
this.contactsNum = parseFloat(ContactsTime);
if( 0 < this.contactsNum && this.contactsNum < 600 ) {
this.num++
} else if ( isNaN(this.contactsNum )){
this.contactsNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,18 @@
* limitations under the License.
*/
import fileio from '@ohos.fileio';
import {CustomContainer} from '../common/ExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog';
import context from '@ohos.app.ability.common';
import router from '@ohos.router';
let abilityContext = getContext(this) as context.UIAbilityContext;
let path = globalThis.dir;
let path1 = path + '/ExperienceData';
let Xpath = path1 + '/DeskFps.log'
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'DeskFps';
@State toSP_daemon: string = 'SP_daemon -editor fpsohtest com.ohos.launcher 桌面';
@State StepTips: string = '操作步骤:根据操作提示滑动系统桌面测试帧率'+'\n'+'预期结果:帧率大于55帧测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
...
...
@@ -35,6 +33,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -47,9 +47,8 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面`+ '\n' + '\n'
+ `3.工作台运行’点击启动测试.bat‘选择帧率>桌面`+ '\n' + '\n' +`4.左右滑动系统桌面连续10s以上` + '\n' + '\n'
+ '5.回到DeskFps测试项点击结束键' + '\n' + '\n' + `6.若测试最高帧率大于55帧则通过测试`
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' + `2.左右滑动系统桌面连续10s以上`
+ '\n' + '\n' + '3.回到DeskFps测试项点击结束键' + '\n' + '\n' + `4.若测试最高帧率大于55帧则通过测试`
+ '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
...
...
@@ -62,6 +61,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
...
...
@@ -83,32 +83,33 @@ struct CustomContainerUser {
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
let
fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664)
;
let buf = new ArrayBuffer(4096
);
fileio.readSync(fd,buf
);
let report = String.fromCharCode.apply(null,new Uint8Array(buf)
);
let headList = new Array(
);
let endList
= new Array();
let head = report.indexOf(":");
let end = report.indexOf('|');
let Fps = new Array(
);
while(head > -1){
headList.push(head);
head = report.indexOf(":",head + 1
);
}
while(end > -1){
endList.push(end);
end = report.indexOf("|",end + 1
);
}
for(let i = 0; i < headList.length; i++) {
Fps[i] = Number(report.substring(headList[i]+1,endList[i])
);
}
let maxFps = Math.max(...
Fp
s);
let
report = globalThis.resultNum
;
// let headList = new Array(
);
// let endList = new Array(
);
// let head = report.indexOf(":"
);
// let end = report.indexOf('|'
);
// let Fps
= new Array();
//
// while(head > -1){
// headList.push(head
);
// head = report.indexOf(":",head + 1);
// }
// while(end > -1){
// endList.push(end
);
// end = report.indexOf("|",end + 1);
// }
// for(let i = 0; i < headList.length; i++) {
// Fps[i] = Number(report.substring(headList[i]+1,endList[i])
);
//
}
let reg = /fps:(\d+)/g;
let matches = report.match(reg
);
let fpsValues = matches.map(match => parseInt(match.substring(4)));
let maxFps = Math.max(...
fpsValue
s);
this.Fps = maxFps.toString();
if(maxFps >= 55) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/Experience_index.ets
浏览文件 @
3b14b191
...
...
@@ -59,7 +59,13 @@ struct IndexPage {
{title:'ScrollPhotosList',uri:'pages/Experience/ScrollPhotosList'},
{title:'KeyboardInput',uri:'pages/Experience/KeyboardInputTest'},
]
@State ColorObject : string[] = VarColor;
@State ColorObject : Object[] = VarColor;
@State ColorTrue : Object[] = [];
@State ColorTrue2 : Object[] = [];
aboutToAppear() {
globalThis.CreateFloatingWindow();
// globalThis.HideFloatingWindow();
}
async onPageShow(){
let Test = null;
let context =null;
...
...
@@ -79,7 +85,7 @@ struct IndexPage {
if(Test != 1) {
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
fileio.closeSync(fd);
...
...
@@ -110,12 +116,12 @@ struct IndexPage {
let name1 = '刚刚点进了哪个用例:'+ titles;
let results = this.result;
let WriteTitle = (titles).toString();
let number = WriteTitle.length +
11
;
let number = WriteTitle.length +
7
;
let Index = ColorBack.indexOf(WriteTitle);
if (this.result === 'true '){
this.ColorObject[this.current] = '
#ff008000
';
let Log = (titles+';'+'
#ff008000
'+';');
this.ColorObject[this.current] = '
true
';
let Log = (titles+';'+'
true
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -128,8 +134,8 @@ struct IndexPage {
filewrite(name1,results,titles)
}
else if (this.result === 'false'){
this.ColorObject[this.current] = '
#ffff0000
';
let Log = (titles+';'+'
#ffff0000
'+';');
this.ColorObject[this.current] = '
false
';
let Log = (titles+';'+'
false
'+';');
let key = ColorBack.substring(Index,Index+number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key,Log);
...
...
@@ -141,10 +147,25 @@ struct IndexPage {
fileio.writeSync(Fd,Report);
filewrite(name1,results,titles);
}
else
if (this.result === 'None')
{
else {
this.ColorObject[this.current] = this.ColorObject[this.current];
}
}
for (let i = 0; i < TestList.length; i++){
if (this.ColorObject[i] === 'true '){
this.ColorTrue[i] = 0x263526
this.ColorTrue2[i] = 0x0CB60C
}
else if (this.ColorObject[i] === 'false'){
this.ColorTrue[i] = 0x380303
this.ColorTrue2[i] = 0xd60a0a
}
else {
this.ColorTrue[i] = 0x000000
this.ColorTrue2[i] = 0x000000
}
}
}
build(){
Column(){
...
...
@@ -175,7 +196,7 @@ struct IndexPage {
action: () => {
this.ClearAll = true;
this.ColorObject.forEach((value, index) => {
this.ColorObject[index] = '
#ff808080
';
this.ColorObject[index] = '
none
';
});
this.ClearText();
prompt.showToast({
...
...
@@ -222,12 +243,13 @@ struct IndexPage {
})
}
}.width('100%').justifyContent(FlexAlign.SpaceAround).margin({top:'15vp'}).height('6%').backgroundColor(Color.Black)
List({
space:5
}){
List({}){
ForEach(this.TestCaseList,(item,index) => {
ListItem(){
Row(){
Text(item.title).fontSize(16).fontColor(Color.Black)
}.width('100%').height(50).alignItems(VerticalAlign.Center).backgroundColor(this.count===0&&this.TEST===0?'#ff808080':this.ColorObject[index])
Text(item.title).fontSize(20).fontColor(Color.White)
}.width('100%').height(50)
.linearGradient(this.count===0&&this.TEST===0?{angle: 90,colors: [[0x000000, 0.0],[0x000000, 1.0]]}:{ angle: 90,colors: [[this.ColorTrue[index], 0.0], [this.ColorTrue2[index], 0.618]]})
.onClick(( )=>{
this.count = 1;
this.ClearAll=false;
...
...
@@ -238,7 +260,7 @@ struct IndexPage {
})
}
},item => item.title)
}.width('100%').height('92%')
}.width('100%').height('92%')
.divider({strokeWidth:1,color:Color.Grey})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
ClearText(){
...
...
@@ -248,7 +270,7 @@ struct IndexPage {
fileio.mkdirSync(ExperienceDataPath);
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for(let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title+';'+'
#ff808080
'+';').toString();
let log = (this.TestCaseList[i].title+';'+'
none
'+';').toString();
fileio.writeSync(fd,log);
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/KeyboardDisplayTest.ets
浏览文件 @
3b14b191
...
...
@@ -12,27 +12,26 @@
* 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 router from '@ohos.router';
let path = globalThis.dir;
let path1 = path + '/ExperienceData';
let Xpath = path1 + '/CompleteTimeKeyboard.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'KeyboardDisplay';
@State toSP_daemon: string = 'SP_daemon -editor completeTime com.example.kikakeyboard ohtest';
@State StepTips: string = '操作步骤:根据操作提示点击输入框等待键盘加载'+'\n'+'预期结果:输入键盘弹出时延小于1000ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -45,10 +44,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入信息` + '\n' + '\n' +
'3.新建一条信息显示输入框'+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择完成时延>键盘按键弹出`+ '\n' + '\n' +
`5.点击输入框等待键盘弹出` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n'
+ `7.若弹出键盘时延小于或等于1000ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + `1.点击开始键进入信息` + '\n' + '\n' + '2.新建一条信息显示输入框'+ '\n' + '\n'
+ `3.点击输入框等待键盘弹出` + '\n' + '\n' + '4.测试结束回到Validator点击结束键' + '\n' + '\n'
+ `5.若弹出键盘时延小于或等于1000ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -60,6 +58,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let bundleName=new String("com.ohos.mms").toString();
let abilityName=new String("com.ohos.mms.MainAbility").toString();
...
...
@@ -84,16 +83,17 @@ struct CustomContainerUser {
.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 report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 1000 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets
浏览文件 @
3b14b191
...
...
@@ -12,27 +12,25 @@
* 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 router from '@ohos.router';
let path = globalThis.dir;
let path1 = path + '/ExperienceData';
let Xpath = path1 + '/ResponseTimeKeyboard.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'KeyboardInput';
@State toSP_daemon: string = 'SP_daemon -editor responseTime com.example.kikakeyboard ohtest';
@State StepTips: string = '操作步骤:根据操作提示点击键盘按键'+'\n'+'预期结果:键盘输入响应时延小于150ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -45,10 +43,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入信息` + '\n' + '\n' +
'3.新建一条信息点击输入框打开键盘'+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>键盘按键输入`+ '\n' + '\n'
+`5.随意点击按键等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' +
`7.若按键响应时延小于或等于150ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + `1.点击开始键进入信息` + '\n' + '\n' + '2.新建一条信息点击输入框打开键盘'+ '\n' +
'\n' + `3.随意点击按键等待响应` + '\n' + '\n' + '4.待测试结束回到Validator点击结束键' + '\n' + '\n' +
`5.若按键响应时延小于或等于150ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -60,6 +57,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let bundleName=new String("com.ohos.mms").toString();
let abilityName=new String("com.ohos.mms.MainAbility").toString();
...
...
@@ -83,17 +81,18 @@ struct CustomContainerUser {
.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));
this.StartEnable = !this.StartEnable;
let report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 150 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,17 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let MmsColdPath = path1 + '/ColdStartMms.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'MmsColdStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:
所有
应用冷启动时延小于2300ms则测试通过';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:应用冷启动时延小于2300ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -35,10 +32,13 @@ struct CustomContainerUser {
@State mmsNum: number = 0;
@State cameraNum: number = 0;
@State contactsNum: number = 0;
@State toSP_daemon: string = 'SP_daemon -editor coldStartHM com.ohos.mms 信息 ohtest'
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n'
+ `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>信息测试,回车执行`
+ '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果'
+ '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面` + '\n' + '\n'
+ `2.清空后台应用` + '\n' + '\n' + `3.快速点击桌面信息应用` + '\n' + '\n' +`4.测试应用拉起后手动返回validator界面`
+ '\n' + '\n' + '5.点击结束键观察测试结果' + '\n' + '\n' + `6.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +65,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -87,23 +87,23 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
this.StartEnable = !this.StartEnable
;
/*
mms
*/
let MmsFd = fileio.openSync(MmsColdPath, 0o100 | 0o2002, 0o664);
let MmsBuf = new ArrayBuffer(4096);
fileio.readSync(MmsFd,MmsBuf);
let MmsReport = String.fromCharCode.apply(null,new Uint8Array(MmsBuf));
let MmsReport = globalThis.resultNum;
let MmsHead = MmsReport.indexOf('time:');
let MmsTime = MmsReport.substring(MmsHead+5);
this.mmsNum = parseFloat(MmsTime);
if( 0 < this.mmsNum && this.mmsNum < 2300 ) {
this.num++
} else if ( isNaN(this.mmsNum )){
this.mmsNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,19 +13,17 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let MmsColdPath = path1 + '/HotStartMms.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'MmsHotStart';
@State toSP_daemon: string = 'SP_daemon -editor hotStart com.ohos.mms 信息 ohtest';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用热启动时延小于600ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
...
...
@@ -39,6 +37,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,10 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '
1.测试设备通过USB连接工作台' + '\n' + '\n' + `2
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
3.开启信息应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>信息测试
`+ '\n' + '\n' +
`
5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6
.点击结束键观察测试结果' + '\n' + '\n'
+ `
7.若所有热启动测试均
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '
\n' + '\n' + `1
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
2.开启信息应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `3.再次启动桌面信息应用
`+ '\n' + '\n' +
`
4.测试应用拉起后返回validator界面` + '\n' + '\n' + '5
.点击结束键观察测试结果' + '\n' + '\n'
+ `
6.若信息热启动测试
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -67,6 +67,7 @@ struct CustomContainerUser {
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
this.num = 0;
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
...
...
@@ -91,19 +92,19 @@ struct CustomContainerUser {
/*
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 MmsReport = globalThis.resultNum;
let MmsHead = MmsReport.indexOf(':');
let MmsTime = MmsReport.substring(MmsHead+1);
this.mmsNum = parseFloat(MmsTime);
if( 0 < this.mmsNum && this.mmsNum < 600 ) {
this.num++
} else if ( isNaN(this.mmsNum )){
this.mmsNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
浏览文件 @
3b14b191
...
...
@@ -13,18 +13,14 @@
* limitations under the License.
*/
import router from '@ohos.router';
import fileio from '@ohos.fileio';
import {CustomContainer} from '../common/ExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog';
let path = globalThis.dir;
let path1 = path + '/ExperienceData';
let Xpath = path1 + '/PhotoFps.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'PhotoFps';
@State toSP_daemon: string = 'SP_daemon -editor fpsohtest com.ohos.photos 图库';
@State StepTips: string = '操作步骤:根据操作提示滑动图库测试帧率'+'\n'+'预期结果:帧率大于或等于55帧测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
...
...
@@ -33,6 +29,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -45,10 +43,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n'
+ `3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择帧率>图库`+ '\n' + '\n' +
`5.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '6.回到PhotoFps测试项点击结束键' + '\n' + '\n' +
`7.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片`+ '\n' + '\n' + `2.点击开始键进入图库`
+ '\n' + '\n' + `3.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '4.回到PhotoFps测试项点击结束键' + '\n' + '\n' +
`5.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -60,6 +57,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let bundleName=new String("com.ohos.photos").toString();
let abilityName=new String("com.ohos.photos.MainAbility").toString();
...
...
@@ -83,33 +81,17 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
let fd = fileio.openSync(Xpath, 0o100 | 0o2002, 0o664);
let buf = new ArrayBuffer(4096);
fileio.readSync(fd,buf);
let report = String.fromCharCode.apply(null,new Uint8Array(buf));
let headList = new Array();
let endList = new Array();
let head = report.indexOf(":");
let end = report.indexOf('|');
let Fps = new Array();
while(head > -1){
headList.push(head);
head = report.indexOf(":",head + 1);
}
while(end > -1){
endList.push(end);
end = report.indexOf("|",end + 1);
}
for(let i = 0; i < headList.length; i++) {
Fps[i] = Number(report.substring(headList[i]+1,endList[i]));
}
let maxFps = Math.max(...Fps);
this.StartEnable = !this.StartEnable;
let report = globalThis.resultNum;
let reg = /fps:(\d+)/g;
let matches = report.match(reg);
let fpsValues = matches.map(match => parseInt(match.substring(4)));
let maxFps = Math.max(...fpsValues);
this.Fps = maxFps.toString();
if(maxFps >= 55) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/PhotosColdStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,17 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let PhotosColdPath = path1 + '/ColdStartPhotos.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'PhotosColdStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:
所有
应用冷启动时延小于2300ms则测试通过';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:应用冷启动时延小于2300ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -35,10 +32,13 @@ struct CustomContainerUser {
@State mmsNum: number = 0;
@State cameraNum: number = 0;
@State contactsNum: number = 0;
@State toSP_daemon: string = 'SP_daemon -editor coldStartHM com.ohos.photos 图库 ohtest';
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n'
+ `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>图库测试,回车执行`
+ '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果'
+ '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面` + '\n' + '\n'
+ `2.清空后台应用` + '\n' + '\n' + `3.快速点击桌面图库应用` + '\n' + '\n' +`4.测试应用拉起后手动返回validator界面`
+ '\n' + '\n' + '5.点击结束键观察测试结果' + '\n' + '\n' + `6.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +65,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -87,23 +87,23 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
this.StartEnable = !this.StartEnable
;
/*
photos
*/
let photosFd = fileio.openSync(PhotosColdPath, 0o100 | 0o2002, 0o664);
let photosBuf = new ArrayBuffer(4096);
fileio.readSync(photosFd,photosBuf);
let photosReport = String.fromCharCode.apply(null,new Uint8Array(photosBuf));
let photosReport = globalThis.resultNum;
let photosHead = photosReport.indexOf('time:');
let photosTime = photosReport.substring(photosHead+5);
this.photosNum = parseFloat(photosTime);
if( 0 < this.photosNum && this.photosNum < 2300 ) {
this.num++
} else if ( isNaN(this.photosNum )){
this.photosNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,18 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let PhotosColdPath = path1 + '/HotStartPhotos.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'PhotosHotStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用热启动时延小于600ms则测试通过';
@State toSP_daemon: string = 'SP_daemon -editor hotStart com.ohos.photos 图库 ohtest';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:应用热启动时延小于600ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -39,6 +37,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,10 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '
1.测试设备通过USB连接工作台' + '\n' + '\n' + `2
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
3.开启图库应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>图库测试
`+ '\n' + '\n' +
`
5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6
.点击结束键观察测试结果' + '\n' + '\n'
+ `
7.若所有热启动测试均
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '
\n' + '\n' + `1
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
2.开启图库应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `3.再次启动桌面图库应用
`+ '\n' + '\n' +
`
4.测试应用拉起后返回validator界面` + '\n' + '\n' + '5
.点击结束键观察测试结果' + '\n' + '\n'
+ `
6.若图库热启动测试
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +66,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -87,23 +88,23 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
this.StartEnable = !this.StartEnable
;
/*
photos
*/
let photosFd = fileio.openSync(PhotosColdPath, 0o100 | 0o2002, 0o664);
let photosBuf = new ArrayBuffer(4096);
fileio.readSync(photosFd,photosBuf);
let photosReport = String.fromCharCode.apply(null,new Uint8Array(photosBuf));
let photosReport = globalThis.resultNum;
let photosHead = photosReport.indexOf(':');
let photosTime = photosReport.substring(photosHead+1);
this.photosNum = parseFloat(photosTime);
if( 0 < this.photosNum && this.photosNum < 600 ) {
this.num++
} else if ( isNaN(this.photosNum )){
this.photosNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets
浏览文件 @
3b14b191
...
...
@@ -13,26 +13,24 @@
* limitations under the License.
*/
import router from '@ohos.router';
import fileio from '@ohos.fileio';
import {CustomContainer} from '../common/TimeExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog';
let path = globalThis.dir;
let path1 = path + '/ExperienceData';
let Xpath = path1 + '/ResponseTimePhotos.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'ScrollPhotosList';
@State toSP_daemon: string = 'SP_daemon -editor responseTime com.ohos.photos ohtest';
@State StepTips: string = '操作步骤:根据操作提示滑动图库缩略表'+'\n'+'预期结果:滑动响应时延小于150ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -45,10 +43,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n'
+`3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>图库缩略列表滑动`+ '\n' + '\n' +
`5.滑动图库缩略列表等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' +
`7.若滑动响应时延小于或等于150ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片`+ '\n' + '\n' +`2.点击开始键进入图库`
+ '\n' + '\n' + `3.滑动图库缩略列表等待响应` + '\n' + '\n' + '4.待测试结束回到Validator点击结束键' + '\n' + '\n' +
`5.若滑动响应时延小于或等于150ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -60,6 +57,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let bundleName=new String("com.ohos.photos").toString();
let abilityName=new String("com.ohos.photos.MainAbility").toString();
...
...
@@ -84,16 +82,17 @@ struct CustomContainerUser {
.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 report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 150 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,17 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let SettingsColdPath = path1 + '/ColdStartSetting.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'SettingsColdStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:
所有
应用冷启动时延小于2300ms则测试通过';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:应用冷启动时延小于2300ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -35,10 +32,13 @@ struct CustomContainerUser {
@State mmsNum: number = 0;
@State cameraNum: number = 0;
@State contactsNum: number = 0;
@State toSP_daemon: string = 'SP_daemon -editor coldStartHM com.ohos.settings 设置 ohtest';
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入系统桌面` + '\n' + '\n'
+ `3.清空后台应用,将底层任务栏中应用拖至桌面` + '\n' + '\n' + `4.工作台运行‘点击启动测试.bat’选择冷启动>设置测试,回车执行`
+ '\n' + '\n' +`5.测试应用自动执行冷启动后手动返回validator界面` + '\n' + '\n' + '6.点击结束键观察测试结果'
+ '\n' + '\n' + `7.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面` + '\n' + '\n'
+ `2.清空后台应用` + '\n' + '\n' + `3.快速点击桌面设置应用` + '\n' + '\n' +`4.测试应用拉起后手动返回validator界面`
+ '\n' + '\n' + '5.点击结束键观察测试结果' + '\n' + '\n' + `6.若冷启动测试在规定时延内完成则通过测试` + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +65,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -91,19 +91,19 @@ struct CustomContainerUser {
/*
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 setReport = globalThis.resultNum;
let setHead = setReport.indexOf('time:');
let setTime = setReport.substring(setHead+5);
this.setNum = parseFloat(setTime);
if( 0 < this.setNum && this.setNum < 2300 ) {
this.num++
} else if ( isNaN(this.setNum )){
this.setNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,20 +13,18 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let SettingsColdPath = path1 + '/HotStartSetting.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'SettingsHotStart';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:所有应用热启动时延小于600ms则测试通过';
@State toSP_daemon: string = 'SP_daemon -editor hotStart com.ohos.settings 设置 ohtest';
@State StepTips: string = '操作步骤:根据操作提示运行脚本文件,启动应用'+'\n'+'预期结果:应用热启动时延小于600ms则测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State num: number = 0;
...
...
@@ -39,6 +37,8 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +51,10 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '
1.测试设备通过USB连接工作台' + '\n' + '\n' + `2
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
3.开启设置应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择热启动>设置测试
`+ '\n' + '\n' +
`
5.测试应用手动执行热启动返回validator界面` + '\n' + '\n' + '6
.点击结束键观察测试结果' + '\n' + '\n'
+ `
7.若所有热启动测试均
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '
\n' + '\n' + `1
.点击开始键进入系统桌面`+ '\n' + '\n'
+ `
2.开启设置应用回退到桌面,保证此时后台应用存在` + '\n' + '\n' + `3.再次启动桌面设置应用
`+ '\n' + '\n' +
`
4.测试应用拉起后返回validator界面` + '\n' + '\n' + '5
.点击结束键观察测试结果' + '\n' + '\n'
+ `
6.若设置热启动测试
在规定时延内完成则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -66,6 +66,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.num = 0;
this.StartEnable = !this.StartEnable;
let str = {
...
...
@@ -91,19 +92,19 @@ struct CustomContainerUser {
/*
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 setReport = globalThis.resultNum;
let setHead = setReport.indexOf(':');
let setTime = setReport.substring(setHead+1);
this.setNum = parseFloat(setTime);
if( 0 < this.setNum && this.setNum < 600 ) {
this.num++
} else if ( isNaN(this.setNum )){
this.setNum = -1000;
}
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets
浏览文件 @
3b14b191
...
...
@@ -13,28 +13,27 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let Xpath = path1 + '/CompleteTimeLauncher.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'StartBackgroundTask';
@State toSP_daemon: string = 'SP_daemon -editor completeTime com.ohos.launcher ohtest';
@State StepTips: string = '操作步骤:根据操作提示打开后台任务'+'\n'+'预期结果:打开后台任务时延小于600ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -47,10 +46,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面开启任务管理器`
+ '\n' + '\n' + `3.工作台运行’点击启动测试.bat‘选择完成时延>后台任务切换`+ '\n' + '\n' +`4.随意点开一个后台任务`
+ '\n' + '\n' + '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' +
`6.若打开后台任务时延小于或等于600ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入桌面开启任务管理器`
+ '\n' + '\n' + `2.随意点开一个后台任务` + '\n' + '\n' + '3.待测试执行结束回到Validator点击结束键' + '\n' + '\n' +
`4.若打开后台任务时延小于或等于600ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -62,6 +60,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
...
...
@@ -83,16 +82,17 @@ struct CustomContainerUser {
.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 report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 600 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets
浏览文件 @
3b14b191
...
...
@@ -13,28 +13,27 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let Xpath = path1 + '/ResponseTimeLauncher.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'StartNotification';
@State toSP_daemon: string = 'SP_daemon -editor responseTime com.ohos.launcher ohtest';
@State StepTips: string = '操作步骤:根据操作提示下拉通知栏'+'\n'+'预期结果:下拉通知栏时延小于150ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -47,10 +46,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面` + '\n' + '\n'
+ `3.工作台运行’点击启动测试.bat‘选择响应时延>下拉状态栏`+ '\n' + '\n' +`4.从屏幕顶部滑动下拉通知栏` + '\n' + '\n'
+ '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + `6.若下拉通知栏时延小于或等于150ms则通过测试` +
'\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入桌面` + '\n' + '\n' + `2.从屏幕顶部滑动下拉通知栏`
+ '\n' + '\n' + '3.待测试执行结束回到Validator点击结束键' + '\n' + '\n' + `4.若下拉通知栏时延小于或等于150ms则通过测试`
+ '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -62,6 +60,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
...
...
@@ -83,16 +82,17 @@ struct CustomContainerUser {
.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 report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 150 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets
浏览文件 @
3b14b191
...
...
@@ -13,28 +13,27 @@
* limitations under the License.
*/
import router from '@ohos.router';
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 path1 = path + '/ExperienceData';
let Xpath = path1 + '/CompleteTimeLauncher.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'StartTaskManager';
@State toSP_daemon: string = 'SP_daemon -editor completeTime com.ohos.launcher ohtest';
@State StepTips: string = '操作步骤:根据操作提示打开任务管理器'+'\n'+'预期结果:打开任务管理器时延小于1000ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -47,10 +46,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.点击开始键进入桌面` + '\n' + '\n'
+ `3.工作台运行’点击启动测试.bat‘选择完成时延>启动任务管理器`+ '\n' + '\n' +`4.点击右下角方框开启任务管理器` + '\n' + '\n'
+ '5.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' + `6.若启动任务管理器时延小于或等于1000ms则通过测试`
+ '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入桌面` + '\n' + '\n' + '\n' + '\n' +
`2.点击右下角方框开启任务管理器` + '\n' + '\n' + '3.待测试执行结束回到Validator点击结束键' + '\n' + '\n'
+ `4.若启动任务管理器时延小于或等于1000ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -62,6 +60,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let str = {
bundleName:"com.ohos.launcher",
...
...
@@ -83,16 +82,17 @@ struct CustomContainerUser {
.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 report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 1000 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets
浏览文件 @
3b14b191
...
...
@@ -13,26 +13,24 @@
* limitations under the License.
*/
import router from '@ohos.router';
import fileio from '@ohos.fileio';
import {CustomContainer} from '../common/TimeExperienceCustomContainer';
import FirstDialog from '../model/FirstDialog';
let path = globalThis.dir;
let path1 = path + '/ExperienceData';
let Xpath = path1 + '/ResponseTimePhotos.log';
@Entry
@Component
struct CustomContainerUser {
@State name: string = 'ViewPhoto';
@State toSP_daemon: string = 'SP_daemon -editor responseTime com.ohos.photos ohtest';
@State StepTips: string = '操作步骤:根据操作提示点击图片等待加载'+'\n'+'预期结果:图片响应时延小于150ms测试通过';
@State Vue: boolean = false;
@State StartEnable: boolean = true;
@State time:
string = '0'
;
@State time:
number = 0
;
scroller: Scroller = new Scroller();
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -45,10 +43,9 @@ struct CustomContainerUser {
.fontColor(Color.White).fontSize('24fp')
}
Row(){
Text(`测试步骤:`+ '\n' + '\n' + '1.测试设备通过USB连接工作台' + '\n' + '\n' + `2.在图库中预置500张图片`+ '\n' + '\n'
+ `3.点击开始键进入图库`+ '\n' + '\n' + `4.工作台运行’点击启动测试.bat‘选择响应时延>查看图片` + '\n' + '\n' +
`5.点击一张图库缩略图等待响应` + '\n' + '\n' + '6.待脚本执行结束回到Validator点击结束键' + '\n' + '\n' +
`7.若图片响应时延小于或等于150ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片`+ '\n' + '\n' + `2.点击开始键进入图库`
+ '\n' + '\n' + `3.点击一张图库缩略图等待响应` + '\n' + '\n' + '4.待测试执行结束回到Validator点击结束键'
+ '\n' + '\n' + `5.若图片响应时延小于或等于150ms则通过测试` + '\n' + '\n' + '\n' + '\n' )
.fontColor(Color.White).fontSize('20fp')
}
Row(){
...
...
@@ -60,6 +57,7 @@ struct CustomContainerUser {
.enabled(this.StartEnable)
.opacity(this.StartEnable? 1 : 0.4)
.onClick(async () => {
globalThis.ShowFloatingWindow();
this.StartEnable = !this.StartEnable;
let bundleName=new String("com.ohos.photos").toString();
let abilityName=new String("com.ohos.photos.MainAbility").toString();
...
...
@@ -83,17 +81,18 @@ struct CustomContainerUser {
.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));
this.StartEnable = !this.StartEnable;
let report = globalThis.resultNum;
let head = report.indexOf(":");
this.time = report.substring(head+1);
let time = parseFloat(this.time)
// let time = parseFloat(this.time)
let time = this.time;
if( 0 < time && time < 150 ) {
this.Vue = true;
} else if ( isNaN(this.time) ){
this.time = -1000;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Player/Player_index.ets
浏览文件 @
3b14b191
...
...
@@ -45,8 +45,9 @@ struct IndexPage {
{ title: 'PlayerAudio', uri: 'pages/Player/PlayAudioList' },
{ title: 'PlayerVideo', uri: 'pages/Player/PlayVideoList' },
]
@State ColorObject: string[] = VarColor;
@State ColorObject: Object[] = VarColor;
@State ColorTrue : Object[] = [];
@State ColorTrue2 : Object[] = [];
async onPageShow() {
let Test = null;
let context = null;
...
...
@@ -66,7 +67,7 @@ struct IndexPage {
if (Test != 1) {
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for (let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title + ';' + '
#ff808080
' + ';').toString();
let log = (this.TestCaseList[i].title + ';' + '
none
' + ';').toString();
fileio.writeSync(fd, log);
}
fileio.closeSync(fd);
...
...
@@ -98,12 +99,12 @@ struct IndexPage {
let name1 = '刚刚点进了哪个用例:' + titles;
let results = this.result;
let WriteTitle = (titles).toString();
let number = WriteTitle.length +
11
;
let number = WriteTitle.length +
7
;
let Index = ColorBack.indexOf(WriteTitle);
if (this.result === 'true ') {
this.ColorObject[this.current] = '
#ff008000
';
let Log = (titles + ';' + '
#ff008000
' + ';');
this.ColorObject[this.current] = '
true
';
let Log = (titles + ';' + '
true
' + ';');
let key = ColorBack.substring(Index, Index + number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key, Log);
...
...
@@ -116,8 +117,8 @@ struct IndexPage {
filewrite(name1, results, titles)
}
else if (this.result === 'false') {
this.ColorObject[this.current] = '
#ffff0000
';
let Log = (titles + ';' + '
#ffff0000
' + ';');
this.ColorObject[this.current] = '
false
';
let Log = (titles + ';' + '
false
' + ';');
let key = ColorBack.substring(Index, Index + number);
let FD = fileio.openSync(ColorBackPath, 0o102, 0o666);
ColorBack = ColorBack.replace(key, Log);
...
...
@@ -129,10 +130,25 @@ struct IndexPage {
fileio.writeSync(Fd, Report);
filewrite(name1, results, titles);
}
else
if (this.result === 'None')
{
else {
this.ColorObject[this.current] = this.ColorObject[this.current];
}
}
for (let i = 0; i < TestList.length; i++){
if (this.ColorObject[i] === 'true '){
this.ColorTrue[i] = 0x263526
this.ColorTrue2[i] = 0x0CB60C
}
else if (this.ColorObject[i] === 'false'){
this.ColorTrue[i] = 0x380303
this.ColorTrue2[i] = 0xd60a0a
}
else {
this.ColorTrue[i] = 0x000000
this.ColorTrue2[i] = 0x000000
}
}
}
build() {
...
...
@@ -166,7 +182,7 @@ struct IndexPage {
action: () => {
this.ClearAll = true;
this.ColorObject.forEach((value, index) => {
this.ColorObject[index] = '
#ff808080
';
this.ColorObject[index] = '
none
';
});
this.ClearText();
prompt.showToast({
...
...
@@ -220,16 +236,16 @@ struct IndexPage {
.height('6%')
.backgroundColor(Color.Black)
List({
space: 5
}) {
List({}) {
ForEach(this.TestCaseList, (item, index) => {
ListItem() {
Row() {
Text(item.title).fontSize(
16).fontColor(Color.Black
)
Text(item.title).fontSize(
20).fontColor(Color.White
)
}
.width('100%')
.height(50)
.alignItems(VerticalAlign.Center)
.
backgroundColor(this.count === 0 && this.TEST === 0 ? '#ff808080' : this.ColorObject[index]
)
.
linearGradient(this.count===0&&this.TEST===0?{angle: 90,colors: [[0x000000, 0.0],[0x000000, 1.0]]}:{ angle: 90,colors: [[this.ColorTrue[index], 0.0], [this.ColorTrue2[index], 0.618]]}
)
.onClick(() => {
this.count = 1;
this.ClearAll = false;
...
...
@@ -240,7 +256,7 @@ struct IndexPage {
})
}
}, item => item.title)
}.width('100%').height('92%')
}.width('100%').height('92%')
.divider({strokeWidth:1,color:Color.Grey})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
...
...
@@ -251,7 +267,7 @@ struct IndexPage {
fileio.openSync(VideoTxtPath, 0o100 | 0o2002, 0o664);
let fd = fileio.openSync(ColorBackPath, 0o102, 0o666);
for (let i = 0; i < this.TestCaseList.length; i++) {
let log = (this.TestCaseList[i].title + ';' + '
#ff808080
' + ';').toString();
let log = (this.TestCaseList[i].title + ';' + '
none
' + ';').toString();
fileio.writeSync(fd, log);
}
FlushData.ResetPlayerAudio();
...
...
validator/acts_validator/src/main/ets/pages/index.ets
浏览文件 @
3b14b191
...
...
@@ -65,7 +65,7 @@ struct IndexPage {
{title:'Player',uri:'pages/Player/Player_index'},
{title:'Experience',uri:'pages/Experience/Experience_index'},
]
@State ColorObject : string[] = ['#ff
808080','#ff808080','#ff808080','#ff808080','#ff80808
0']
@State ColorObject : string[] = ['#ff
000000','#ff000000','#ff000000','#ff000000','#ff00000
0']
async onPageShow(){
let Test = null;
let context =null;
...
...
@@ -173,11 +173,11 @@ struct IndexPage {
})
}
}.width('100%').justifyContent(FlexAlign.SpaceAround).margin({top:'15vp'}).height('6%')
List({
space:5
}){
List({}){
ForEach(this.TestCaseList,(item,index) => {
ListItem(){
Row(){
Text(item.title).fontSize(
16).fontColor(Color.Black
)
Text(item.title).fontSize(
20).fontColor(Color.White
)
}.width('100%').height(50).alignItems(VerticalAlign.Center).backgroundColor(this.ColorObject[index])
.onClick(()=>{
router.push({
...
...
@@ -194,7 +194,7 @@ struct IndexPage {
})
}
},item => item.title)
}.width('100%').height('92%')
}.width('100%').height('92%')
.divider({strokeWidth:1,color:Color.Grey})
}.width('100%').height('100%').backgroundColor(Color.Black)
}
ClearText(){
...
...
validator/acts_validator/src/main/ets/pages/model/AudioRenderer.ts
浏览文件 @
3b14b191
...
...
@@ -11,12 +11,12 @@ class AudioRenderer {
private
audioRenderer
:
audio
.
AudioRenderer
=
undefined
private
fd
:
number
=
undefined
private
offset
:
number
=
undefined
private
length
:
number
=
undefined
async
createAudioRenderer
(){
let
audioStreamInfo
=
{
samplingRate
:
audio
.
AudioSamplingRate
.
SAMPLE_RATE_44100
,
channels
:
audio
.
AudioChannel
.
CHANNEL_2
,
// channels: audio.AudioChannel.CHANNEL_1,
sampleFormat
:
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_S16LE
,
encodingType
:
audio
.
AudioEncodingType
.
ENCODING_TYPE_RAW
}
...
...
@@ -35,10 +35,17 @@ class AudioRenderer {
async
startRenderer
(){
try
{
await
this
.
audioRenderer
.
start
()
// await globalThis.abilityContext.resourceManager.getRawFileDescriptor('test_44100_2.wav').then(value => {
// this.fd = value.fd
// Logger.info(this.tag, `fd : ${this.fd}`)
// let fileDescriptor = {fd: value.fd, offset: value.offset, length: value.length};
// Logger.info(this.tag, `getRawFileDescriptor success fileDescriptor:` + JSON.stringify(fileDescriptor) )
// }).catch(error => {
// console.log('case getRawFileDescriptor err: ' + error);
// });
globalThis
.
abilityContext
.
resourceManager
.
getRawFd
(
"
test_44100_2.wav
"
).
then
(
value
=>
{
this
.
fd
=
value
.
fd
this
.
offset
=
value
.
offset
this
.
length
=
value
.
length
Logger
.
info
(
this
.
tag
,
`getRawFd fd :
${
this
.
fd
}
, offset:
${
value
.
offset
}
, length:
${
value
.
length
}
`
)
}).
catch
(
err
=>
{
console
.
log
(
`getRawFd fail err:
${
err
}
, message:
${
err
.
message
}
, code:
${
err
.
code
}
`
);
...
...
@@ -46,7 +53,8 @@ class AudioRenderer {
let
bufferSize
=
await
this
.
audioRenderer
.
getBufferSize
()
Logger
.
info
(
this
.
tag
,
`audioRenderer bufferSize:`
+
JSON
.
stringify
(
bufferSize
))
let
len
=
this
.
length
%
bufferSize
==
0
?
Math
.
floor
(
this
.
length
/
bufferSize
)
:
Math
.
floor
(
this
.
length
/
bufferSize
+
1
);
let
stat
=
await
fs
.
stat
(
this
.
fd
);
let
len
=
stat
.
size
%
bufferSize
==
0
?
Math
.
floor
(
stat
.
size
/
bufferSize
)
:
Math
.
floor
(
stat
.
size
/
bufferSize
+
1
);
let
buf
=
new
ArrayBuffer
(
bufferSize
);
while
(
true
)
{
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
...
...
@@ -79,6 +87,11 @@ class AudioRenderer {
try
{
if
(
this
.
audioRenderer
){
await
this
.
audioRenderer
.
release
()
// await globalThis.abilityContext.resourceManager.closeRawFileDescriptor('test_44100_2.wav').then(()=> {
// Logger.info(this.tag, `closeRawFileDescriptor success`)
// }).catch(err => {
// Logger.info(this.tag, `closeRawFileDescriptor fail err: ${err}, message: ${err.message}, code: ${err.code}`)
// });
await
globalThis
.
abilityContext
.
resourceManager
.
closeRawFd
(
'
test_44100_2.wav
'
).
then
(()
=>
{
Logger
.
info
(
this
.
tag
,
`closeRawFileDescriptor success`
)
}).
catch
(
err
=>
{
...
...
validator/acts_validator/src/main/ets/pages/model/CameraService.ts
浏览文件 @
3b14b191
...
...
@@ -150,6 +150,7 @@ class CameraService {
Logger
.
info
(
this
.
tag
,
`previewObj format:
${
previewObj
.
format
}
`
)
}
await
this
.
createPreviewOutputFn
(
previewObj
?
previewObj
:
this
.
cameraOutputCapability
.
previewProfiles
[
0
],
surfaceId
)
// await this.createPhotoOutputFn(this.photoProfileObj)
await
this
.
createPhotoOutputFn
(
obj
?
obj
:
this
.
cameraOutputCapability
.
photoProfiles
[
photoIndex
?
photoIndex
:
0
])
await
this
.
createCameraInputFn
(
this
.
cameras
[
cameraDeviceIndex
])
await
this
.
cameraInputOpenFn
()
...
...
@@ -394,6 +395,15 @@ class CameraService {
await
this
.
captureSession
.
addOutput
(
this
.
videoOutput
)
await
this
.
captureSession
.
commitConfig
()
await
this
.
captureSession
.
start
()
// await this.videoOutput.on('frameStart', async () => {
// Logger.info(this.tag, `frameStart start`)
// try {
// await this.videoRecorder.start()
// Logger.info(this.tag, `frameStart end`)
// } catch (err) {
// Logger.info(this.tag, `videoRecorder start fail err: ${err}`)
// }
// })
await
this
.
videoOutput
.
start
()
await
this
.
videoRecorder
.
start
().
then
(()
=>
{
setTimeout
(
async
()
=>
{
...
...
validator/acts_validator/src/main/ets/pages/model/FloatBall.ets
0 → 100644
浏览文件 @
3b14b191
/*
* Copyright (c) 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 socket from '@ohos.net.socket';
let tcp = socket.constructTCPSocketInstance();
tcp.on('message', value => {
let buffer = value.message;
let dataView = new DataView(buffer);
let messageView = '';
for (var i = 0; i < dataView.byteLength; i++) {
messageView += String.fromCharCode(dataView.getUint8(i));
}
console.log('123123123' + messageView);
globalThis.resultNum = messageView;
});
@Entry
@Component
struct FloatBall {
@State timerNum: number = 0;
timerId: number = -1;
@State windShowState: boolean = false;
@State title: string = 'start';
@State sec: number = 15;
@State refreshSec: number = 3;
offsetX: number = -1;
offsetY: number = -1;
COUNTS = 2;
DURATION: number = 300;
mHit = Array(this.COUNTS);
isDoubleFlag = false;
singleClickId = 0;
private countDown() {
this.title = 'count';
var T = setInterval(() => {
if (this.sec <= 0) {
clearTimeout(T);
this.title = 'done';
this.sec = 15;
this.refreshCount();
} else if(this.title === 'start'){
clearTimeout(T);
this.sec = 15;
} else if (this.title === 'done'){
clearTimeout(T);
this.sec = 15;
this.refreshCount();
}
else {
this.sec--;
}
}, 1000)
}
private refreshCount() {
var Time = setInterval(() => {
if (this.refreshSec <= 0) {
clearTimeout(Time);
this.title = 'start';
this.refreshSec = 3;
} else {
this.refreshSec--;
}
}, 1000)
}
private TCPConnect(){
tcp.bind({address: '0.0.0.0', port: 8284, family: 1}, err => {
if (err) {
console.log('bind fail');
return;
}
console.log('bind success');
})
tcp.connect({ address: { address: '0.0.0.0', port: 8284, family: 1 } }, err => {
if (err) {
console.log('connect fail');
this.title = 'connect fail';
return;
}
console.log('connect success');
tcp.getRemoteAddress((err, data) => {
if (err) {
console.log('getRemoteAddressfail');
return;
}
console.log('getRemoteAddresssuccess:' + JSON.stringify(data));
this.title = 'start';
})
tcp.getState((err, data) => {
if (err) {
console.log('getState fail');
return;
}
console.log('getState success:' + JSON.stringify(data));
});
})
}
private TCPClose(){
tcp.close((err) => {
console.log('close socket.');
console.log('ErrorError: ' + err)
});
tcp.off('message');
tcp.off('connect');
tcp.off('close');
}
aboutToAppear() {
this.TCPConnect();
}
longEvent() {
this.destroyAllWindow();
}
destroyAllWindow() {
globalThis.DestroyFloatingWindow();
}
MoveWindow(offsetX: number, offsetY: number) {
globalThis.MoveFloatingWindow(offsetX, offsetY);
}
SetWindowPosition(offsetX: number, offsetY: number) {
globalThis.SetFloatingWindowPosition(offsetX, offsetY)
}
build(){
Stack({alignContent: Alignment.Center}) {
if(this.title === 'connecting'){
Circle()
.width('90vp').height('90vp').fill(Color.White).fillOpacity(0).opacity(0.8)
.border({radius:'90vp',width:'0.5vp',color:'#00ff00'})
.linearGradient({
angle: 135,
direction: GradientDirection.Left,
colors: [['#00ff00',1.0],['#00ff00',1.0]]
})
Text('连接中')
.fontSize(14).textAlign(TextAlign.Center).fontColor($r('app.color.color_fff')).width('100%').height('100%')
.gesture(
GestureGroup(GestureMode.Exclusive,
PanGesture({})
.onActionStart(() => {})
.onActionUpdate((event: GestureEvent) => {
this.offsetX = event.offsetX;
this.offsetY = event.offsetY;
})
.onActionEnd(() => {
this.MoveWindow(this.offsetX, this.offsetY);
this.SetWindowPosition(this.offsetX, this.offsetY)
})
)
)
}
if(this.title === 'connect fail'){
Circle()
.width('90vp').height('90vp').fill(Color.White).fillOpacity(0).opacity(0.8)
.border({radius:'90vp',width:'0.5vp',color:$r('app.color.colorPrimary')})
.linearGradient({
angle: 135,
direction: GradientDirection.Left,
colors: [[$r('app.color.colorPrimary'),1.0],[$r('app.color.colorPrimary'),1.0]]
})
Text('连接失败')
.fontSize(14).textAlign(TextAlign.Center).fontColor($r('app.color.color_fff')).width('100%').height('100%')
.onClick(() => {
this.TCPClose();
this.TCPConnect();
})
.gesture(
GestureGroup(GestureMode.Exclusive,
PanGesture({})
.onActionStart(() => {})
.onActionUpdate((event: GestureEvent) => {
this.offsetX = event.offsetX;
this.offsetY = event.offsetY;
})
.onActionEnd(() => {
this.MoveWindow(this.offsetX, this.offsetY);
this.SetWindowPosition(this.offsetX, this.offsetY)
})
)
)
}
if(this.title === 'start'){
Circle()
.width('90vp').height('90vp').fill(Color.White).fillOpacity(0).opacity(0.8)
.border({radius:'90vp',width:'0.5vp',color:$r('app.color.colorPrimary')})
.linearGradient({
angle: 135,
direction: GradientDirection.Left,
colors: [[$r('app.color.colorPrimary'),1.0],[$r('app.color.colorPrimary'),1.0]]
})
Text('start')
.fontSize(18).textAlign(TextAlign.Center).fontColor($r('app.color.color_fff')).width('100%').height('100%')
.onClick(() => {
tcp.send({
data: globalThis.SendMessage
//此处省略encoding, 默认为utf-8编码格式
}, err => {
if (err) {
console.log('send fail');
return;
}
console.log('send success:' + tcp.send);
})
if (this.sec === 15) {
this.countDown()
}
})
.gesture(
GestureGroup(GestureMode.Exclusive,
LongPressGesture({fingers: 1, repeat: false, duration: 1000 })
.onAction(() => {
this.TCPClose();
}),
PanGesture({})
.onActionStart(() => {
})
.onActionUpdate((event: GestureEvent) => {
this.offsetX = event.offsetX;
this.offsetY = event.offsetY;
})
.onActionEnd(() => {
this.MoveWindow(this.offsetX, this.offsetY);
this.SetWindowPosition(this.offsetX, this.offsetY)
})
)
)
}
if(this.title === 'count'){
Circle()
.width('90vp').height('90vp').fill(Color.White).fillOpacity(0).opacity(0.8)
.border({radius:'90vp',width:'0.5vp',color:$r('app.color.color_666')})
.linearGradient({
angle: 135,
direction: GradientDirection.Left,
colors: [[$r('app.color.color_666'),1.0],[$r('app.color.color_666'),1.0]]
})
Text(`${this.sec}`)
.fontSize(18).textAlign(TextAlign.Center).fontColor($r('app.color.color_fff')).width('100%').height('100%')
.gesture(
GestureGroup(GestureMode.Exclusive,
TapGesture({ count: 2 })
.onAction(() => {
this.title = 'start';
}),
LongPressGesture({fingers: 1, repeat: false, duration: 1000 })
.onAction(() => {
this.title = 'done';
}),
PanGesture({})
.onActionStart(() => {
})
.onActionUpdate((event: GestureEvent) => {
this.offsetX = event.offsetX;
this.offsetY = event.offsetY;
})
.onActionEnd(() => {
this.MoveWindow(this.offsetX, this.offsetY);
this.SetWindowPosition(this.offsetX, this.offsetY)
})
)
)
}
if(this.title === 'done'){
Circle()
.width('90vp').height('90vp').fill(Color.White).fillOpacity(0).opacity(0.8)
.border({radius:'90vp',width:'0.5vp',color:'#00ff00'})
.linearGradient({
angle: 135,
direction: GradientDirection.Left,
colors: [['#00ff00',1.0],['#00ff00',1.0]]
})
Text('done')
.fontSize(18).textAlign(TextAlign.Center).fontColor($r('app.color.color_fff')).width('100%').height('100%')
.onClick(async () => {
this.title = 'start';
})
.gesture(
GestureGroup(GestureMode.Exclusive,
LongPressGesture({fingers: 1, repeat: false, duration: 1000 })
.onAction(() => {
}),
PanGesture({})
.onActionStart(() => {
})
.onActionUpdate((event: GestureEvent) => {
this.offsetX = event.offsetX;
this.offsetY = event.offsetY;
})
.onActionEnd(() => {
this.MoveWindow(this.offsetX, this.offsetY);
this.SetWindowPosition(this.offsetX, this.offsetY)
})
)
)
}
}.width('100%').height('100%')
}
}
\ No newline at end of file
validator/acts_validator/src/main/ets/pages/model/FloatWindowFun.ts
0 → 100644
浏览文件 @
3b14b191
/*
* Copyright (c) 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
window
from
'
@ohos.window
'
;
export
class
FloatWindowFun
{
static
floatingWindowOffsetX
:
number
=
50
;
static
floatingWindowOffsetY
:
number
=
500
;
static
windowWidth
:
number
=
2560
;
static
windowHeight
:
number
=
1600
;
static
atWidth
:
number
=
180
;
static
title
:
String
=
'
start
'
;
static
initAllFun
()
{
globalThis
.
CreateFloatingWindow
=
(()
=>
{
window
.
createWindow
({
ctx
:
globalThis
.
abilityContext
,
name
:
'
sp_floatingWindow
'
,
windowType
:
window
.
WindowType
.
TYPE_FLOAT
}).
then
((
floatWin
)
=>
{
floatWin
.
moveWindowTo
(
this
.
floatingWindowOffsetX
,
this
.
floatingWindowOffsetY
).
then
(()
=>
{
floatWin
.
resize
(
this
.
atWidth
,
this
.
atWidth
).
then
(()
=>
{
floatWin
.
getWindowProperties
()
floatWin
.
setUIContent
(
'
pages/model/FloatBall
'
).
then
(()
=>
{
floatWin
.
setWindowBackgroundColor
(
'
#00000000
'
)
// floatWin.hide()
// floatWin.showWindow().then(() => {
// globalThis.showFloatingWindow = false;
// })
})
})
})
})
})
globalThis
.
MoveFloatingWindow
=
((
offsetX
:
number
,
offsetY
:
number
)
=>
{
let
xx
=
(
this
.
floatingWindowOffsetX
+
offsetX
*
2
)
<
0
?
0
:
((
this
.
floatingWindowOffsetX
+
offsetX
*
2
)
>
(
this
.
windowWidth
-
200
)
?
(
this
.
windowWidth
-
200
)
:
(
this
.
floatingWindowOffsetX
+
offsetX
*
2
));
let
yy
=
(
this
.
floatingWindowOffsetY
+
offsetY
*
2
)
<
0
?
0
:
((
this
.
floatingWindowOffsetY
+
offsetY
*
2
)
>
(
this
.
windowHeight
-
200
)
?
(
this
.
windowHeight
-
200
)
:
(
this
.
floatingWindowOffsetY
+
offsetY
*
2
));
window
.
findWindow
(
"
sp_floatingWindow
"
).
moveWindowTo
(
xx
,
yy
);
})
globalThis
.
DestroyFloatingWindow
=
(()
=>
{
window
.
findWindow
(
'
sp_floatingWindow
'
).
destroyWindow
().
then
(()
=>
{
globalThis
.
showFloatingWindow
=
false
;
})
})
globalThis
.
SetFloatingWindowPosition
=
((
offsetX
:
number
,
offsetY
:
number
)
=>
{
this
.
floatingWindowOffsetX
=
(
this
.
floatingWindowOffsetX
+
offsetX
*
2
)
<
0
?
0
:
((
this
.
floatingWindowOffsetX
+
offsetX
*
2
)
>
(
this
.
windowWidth
-
200
)
?
(
this
.
windowWidth
-
200
)
:
(
this
.
floatingWindowOffsetX
+
offsetX
*
2
));
this
.
floatingWindowOffsetY
=
(
this
.
floatingWindowOffsetY
+
offsetY
*
2
)
<
0
?
0
:
((
this
.
floatingWindowOffsetY
+
offsetY
*
2
)
>
(
this
.
windowHeight
-
200
)
?
(
this
.
windowHeight
-
200
):
(
this
.
floatingWindowOffsetY
+
offsetY
*
2
));
})
globalThis
.
HideFloatingWindow
=
(()
=>
{
window
.
findWindow
(
"
sp_floatingWindow
"
).
hide
().
then
(()
=>
{
globalThis
.
showFloatingWindow
=
false
;
})
})
globalThis
.
ShowFloatingWindow
=
(()
=>
{
window
.
findWindow
(
"
sp_floatingWindow
"
).
showWindow
().
then
(()
=>
{
globalThis
.
title
=
this
.
title
;
})
// .then(() => {
// globalThis.showFloatingWindow = true;
// console.log('2222222222');
// })
})
}
}
\ No newline at end of file
validator/acts_validator/src/main/ets/pages/model/timeTools.ts
浏览文件 @
3b14b191
/*
* Copyright (c) 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.
*/
export
function
fillNum
(
num
)
{
if
(
num
<
10
)
{
return
'
0
'
+
num
...
...
validator/acts_validator/src/main/module.json
浏览文件 @
3b14b191
...
...
@@ -59,6 +59,9 @@
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
},
{
"name"
:
"ohos.permission.SYSTEM_FLOAT_WINDOW"
}
]
}
...
...
validator/acts_validator/src/main/resources/base/element/color.json
浏览文件 @
3b14b191
{
"color"
:
[
{
"name"
:
"colorPrimary"
,
"value"
:
"#B3193F"
},
{
"name"
:
"color_fff"
,
"value"
:
"#FFFFFF"
},
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
},
{
"name"
:
"color_666"
,
"value"
:
"#666666"
}
]
}
\ No newline at end of file
validator/acts_validator/src/main/resources/base/media/img.png
0 → 100644
浏览文件 @
3b14b191
371.4 KB
validator/acts_validator/src/main/resources/base/profile/main_pages.json
浏览文件 @
3b14b191
...
...
@@ -61,6 +61,7 @@
"pages/Player/PlayAudio"
,
"pages/Player/PlayVideo"
,
"pages/Player/PlayAudioList"
,
"pages/Player/PlayVideoList"
"pages/Player/PlayVideoList"
,
"pages/model/FloatBall"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录