Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2cda281e
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2cda281e
编写于
8月 20, 2023
作者:
T
tianwenzhe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change color state
Signed-off-by:
N
tian-wenzhe411
<
tianwenzhe2@huawei.com
>
上级
bbabf558
变更
39
隐藏空白更改
内联
并排
Showing
39 changed file
with
828 addition
and
372 deletion
+828
-372
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/LongPressGesture.ets
...s_validator/src/main/ets/pages/ArkUI/LongPressGesture.ets
+2
-2
validator/acts_validator/src/main/ets/pages/ArkUI/PanGesture.ets
...or/acts_validator/src/main/ets/pages/ArkUI/PanGesture.ets
+2
-2
validator/acts_validator/src/main/ets/pages/ArkUI/PinchGestureTest.ets
...s_validator/src/main/ets/pages/ArkUI/PinchGestureTest.ets
+2
-2
validator/acts_validator/src/main/ets/pages/ArkUI/RotationGestureTest.ets
...alidator/src/main/ets/pages/ArkUI/RotationGestureTest.ets
+2
-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
+2
-2
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/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
-17
validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets
...r/src/main/ets/pages/Experience/ContactsColdStartTest.ets
+11
-13
validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets
...or/src/main/ets/pages/Experience/ContactsHotStartTest.ets
+12
-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
+10
-13
validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets
...dator/src/main/ets/pages/Experience/KeyboardInputTest.ets
+10
-14
validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets
...idator/src/main/ets/pages/Experience/MmsColdStartTest.ets
+12
-14
validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets
...lidator/src/main/ets/pages/Experience/MmsHotStartTest.ets
+11
-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
+12
-14
validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets
...ator/src/main/ets/pages/Experience/PhotosHotStartTest.ets
+13
-14
validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets
...idator/src/main/ets/pages/Experience/ScrollPhotosList.ets
+9
-13
validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets
...r/src/main/ets/pages/Experience/SettingsColdStartTest.ets
+11
-13
validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets
...or/src/main/ets/pages/Experience/SettingsHotStartTest.ets
+12
-13
validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets
...tor/src/main/ets/pages/Experience/StartBackgroundTask.ets
+9
-12
validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets
...dator/src/main/ets/pages/Experience/StartNotification.ets
+9
-12
validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets
...idator/src/main/ets/pages/Experience/StartTaskManager.ets
+9
-12
validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets
...validator/src/main/ets/pages/Experience/ViewPhotoTest.ets
+9
-13
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
+311
-0
validator/acts_validator/src/main/ets/pages/model/FloatWindowFun.ts
...acts_validator/src/main/ets/pages/model/FloatWindowFun.ts
+63
-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
浏览文件 @
2cda281e
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
浏览文件 @
2cda281e
...
...
@@ -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/LongPressGesture.ets
浏览文件 @
2cda281e
...
...
@@ -28,9 +28,9 @@ struct LongPressGestureExample {
@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)
.gesture(
LongPressGesture({ repeat: true })
.onAction((event: GestureEvent) => {
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/PanGesture.ets
浏览文件 @
2cda281e
...
...
@@ -29,9 +29,9 @@ struct PanGestureExample {
@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)
.margin(80).translate({ x: this.X, y: this.Y, z: 5 })
.gesture(
PanGesture({})
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/PinchGestureTest.ets
浏览文件 @
2cda281e
...
...
@@ -28,9 +28,9 @@ struct PinchGuestureTest {
@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)
.scale({ x: this.X, y: this.X, z: this.X })
.gesture(
PinchGesture()
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/RotationGestureTest.ets
浏览文件 @
2cda281e
...
...
@@ -28,9 +28,9 @@ struct RotationGuestureTest {
@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:1, y:1, z:1, angle: this.X })
.margin(80)
.gesture(
...
...
validator/acts_validator/src/main/ets/pages/ArkUI/SwipeGestureTest.ets
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -28,9 +28,9 @@ struct TapGestureExample {
@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)
.gesture(
TapGesture({ count: 2 })
.onAction(() => {
...
...
validator/acts_validator/src/main/ets/pages/Audio/Audio_index.ets
浏览文件 @
2cda281e
...
...
@@ -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/Camera_index.ets
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -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,9 @@ struct CustomContainerUser {
async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name);
this.Vue = false;
globalThis.resultNum = 'time:-1000';
globalThis.SendMessage = this.toSP_daemon;
globalThis.HideFloatingWindow();
}
@Builder specificNoParam() {
...
...
@@ -51,10 +52,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 +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,14 +88,12 @@ struct CustomContainerUser {
.enabled(!this.StartEnable)
.opacity(!this.StartEnable? 1 : 0.4)
.onClick(() => {
this.StartEnable = !this.StartEnable
/*
camera
*/
let CameraFd = fileio.openSync(CameraColdPath, 0o100 | 0o2002, 0o664);
let CameraBuf = new ArrayBuffer(4096);
fileio.readSync(CameraFd,CameraBuf);
let CameraReport = String.fromCharCode.apply(null,new Uint8Array(CameraBuf));
this.StartEnable = !this.StartEnable;
// /*
// camera
// */
let CameraReport = globalThis.resultNum;
let CameraHead = CameraReport.indexOf('time:');
let CameraTime = CameraReport.substring(CameraHead+5);
this.cameraNum = parseFloat(CameraTime);
...
...
@@ -104,6 +103,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ContactsColdStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,14 +87,11 @@ 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);
...
...
@@ -104,6 +101,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ContactsHotStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,14 +87,11 @@ 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);
...
...
@@ -104,6 +101,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -12,19 +12,16 @@
* 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;
...
...
@@ -33,6 +30,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 +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,14 @@ 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)
;
if( 0 < time && time < 1000 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/KeyboardInputTest.ets
浏览文件 @
2cda281e
...
...
@@ -12,19 +12,15 @@
* 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;
...
...
@@ -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.点击开始键进入信息` + '\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,15 @@ 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)
if( 0 < time && time < 150 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/MmsColdStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,14 +87,11 @@ 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);
...
...
@@ -104,6 +101,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/MmsHotStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,10 +92,7 @@ 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);
...
...
@@ -104,6 +102,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -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,14 +87,11 @@ 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);
...
...
@@ -104,6 +101,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/PhotosHotStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,14 +88,11 @@ 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);
...
...
@@ -104,6 +102,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ScrollPhotosList.ets
浏览文件 @
2cda281e
...
...
@@ -13,18 +13,14 @@
* 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;
...
...
@@ -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.滑动图库缩略列表等待响应` + '\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,14 @@ 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)
if( 0 < time && time < 150 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/SettingsColdStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,10 +91,7 @@ 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);
...
...
@@ -104,6 +101,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/SettingsHotStartTest.ets
浏览文件 @
2cda281e
...
...
@@ -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,10 +92,7 @@ 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);
...
...
@@ -104,6 +102,7 @@ struct CustomContainerUser {
if( this.num === 1 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/StartBackgroundTask.ets
浏览文件 @
2cda281e
...
...
@@ -13,20 +13,17 @@
* 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;
...
...
@@ -35,6 +32,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,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,14 @@ 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)
if( 0 < time && time < 600 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/StartNotification.ets
浏览文件 @
2cda281e
...
...
@@ -13,20 +13,17 @@
* 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;
...
...
@@ -35,6 +32,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,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,14 @@ 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)
if( 0 < time && time < 150 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/StartTaskManager.ets
浏览文件 @
2cda281e
...
...
@@ -13,20 +13,17 @@
* 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;
...
...
@@ -35,6 +32,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,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,14 @@ 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)
if( 0 < time && time < 1000 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Experience/ViewPhotoTest.ets
浏览文件 @
2cda281e
...
...
@@ -13,18 +13,14 @@
* 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;
...
...
@@ -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.点击一张图库缩略图等待响应` + '\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,14 @@ 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)
if( 0 < time && time < 150 ) {
this.Vue = true;
}
globalThis.HideFloatingWindow();
})
}
}
...
...
validator/acts_validator/src/main/ets/pages/Player/Player_index.ets
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
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
浏览文件 @
2cda281e
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/module.json
浏览文件 @
2cda281e
...
...
@@ -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
浏览文件 @
2cda281e
{
"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
浏览文件 @
2cda281e
371.4 KB
validator/acts_validator/src/main/resources/base/profile/main_pages.json
浏览文件 @
2cda281e
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录