!1467 wifi测试应用将框架和sdk升级至api10;增加热点稳定性测试和网页时延测试

Merge pull request !1467 from wshikh/master
This commit is contained in:
openharmony_ci 2023-12-12 03:54:39 +00:00 committed by Gitee
commit 110e234a7d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
174 changed files with 6748 additions and 2373 deletions

View File

@ -2,7 +2,7 @@
"string": [
{
"name": "app_name",
"value": "MyApplication"
"value": "WiFiTestApp"
}
]
}

View File

@ -14,26 +14,33 @@
*/
{
"app": {
"signingConfigs": [
{
"name": "default",
"material": {
"certpath": "C:\\Users\\kaihong\\.ohos\\config\\openharmony\\auto_ohos_default_kaihong.sample.wifitest.cer",
"storePassword": "0000001BA241473C90A825CB41480027D18FA6CF3640ABD0F2220314E6F250D4FB17ED05A0C0B39781957C",
"keyAlias": "debugKey",
"keyPassword": "0000001B31D2FEB1E86B08E01A2D1E525B62283A49A604A4549114E2C35BF9EC1BDD4785E78E659E077314",
"profile": "C:\\Users\\kaihong\\.ohos\\config\\openharmony\\auto_ohos_default_kaihong.sample.wifitest.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "C:\\Users\\kaihong\\.ohos\\config\\openharmony\\auto_ohos_default_kaihong.sample.wifitest.p12"
}
}
],
"compileSdkVersion": 9,
"compatibleSdkVersion": 9,
// "signingConfigs": [
//
// ],
// "compileSdkVersion": 10,
// "compatibleSdkVersion": 10,
"products": [
{
"name": "default",
"signingConfig": "default",
"compileSdkVersion": 10,
"compatibleSdkVersion": 9,
"targetSdkVersion": 10,
"runtimeOS": "OpenHarmony"
}
],
"signingConfigs": [
{
"name": "default",
"material": {
"certpath": "C:\\Users\\kaihong\\.ohos\\config\\openharmony\\auto_ohos_default_wifitest_kaihong.sample.wifitest.cer",
"storePassword": "0000001AA825068A821704832948DE46705A5A5998C549D28D49C970D32BDB909913CBE63E1FB860C8AD",
"keyAlias": "debugKey",
"keyPassword": "0000001A93B49F7C266CDA20213B713DD79D5645AD93794E13E5689CF620245D56A7419611D9FF56881E",
"profile": "C:\\Users\\kaihong\\.ohos\\config\\openharmony\\auto_ohos_default_wifitest_kaihong.sample.wifitest.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "C:\\Users\\kaihong\\.ohos\\config\\openharmony\\auto_ohos_default_wifitest_kaihong.sample.wifitest.p12"
}
}
]
},

View File

@ -1,2 +1,2 @@
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').appTasks
export { hapTasks } from '@ohos/hvigor-ohos-plugin';

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"license": "ISC",
"devDependencies": {},
"name": "entry",
"description": "example description",
"repository": {},
"version": "1.0.0",
"dependencies": {}
}

View File

@ -1,5 +0,0 @@
{
"name": "entry",
"version": "1.0.0",
"lockfileVersion": 1
}

View File

@ -1,14 +0,0 @@
{
"license": "ISC",
"devDependencies": {},
"name": "entry",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"description": "example description",
"repository": {},
"version": "1.0.0",
"dependencies": {}
}

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -15,8 +15,8 @@
// @ts-nocheck
import { TestData , TestAuto } from '../MainAbility/model/testData'
import ConfigData from '../Utils/ConfigData';
import { TestData , TestAuto } from '../entryability/model/testData'
import ConfigData from '../utils/ConfigData';
const TAG = "[autoContentTable]"
/**
@ -30,9 +30,9 @@ export struct AutoContentTable {
@State currentAutoItem: TestAuto = {}
@State autoItems: TestAuto[] = [];
@State localName: string = 'DaYuBlue'
@Prop changeIndex: number;
@Prop changeIndex: Number;
@Builder IngredientItem( autoItem: TestAuto , index: number ) {
@Builder IngredientItem( autoItem: TestAuto , index: Number ) {
Stack() {
Flex() {
Flex( { alignItems : ItemAlign.Center } ) {
@ -77,7 +77,7 @@ export struct AutoContentTable {
.backgroundColor( $r( "app.color.white" ) )
}
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
if ( index <= this.changeIndex ) {
this.autoItemsX[ index ].result = 'pass';
} else {
@ -100,7 +100,7 @@ export struct AutoContentTable {
justifyContent : FlexAlign.SpaceBetween ,
alignItems : ItemAlign.Start
} ) {
ForEach( this.autoItems , ( item: TestAuto , index: number ) => {
ForEach( this.autoItems , ( item: TestAuto , index: Number ) => {
this.IngredientItem( item , index )
} )
}

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -15,9 +15,9 @@
// @ts-nocheck
import { TestData , TestApi } from '../MainAbility/model/testData'
import { TestData , TestApi } from '../entryability/model/testData'
import prompt from '@system.prompt';
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* AutoVerificationTable of wifi test
*/
@ -27,12 +27,12 @@ export struct AutoVerificationTable {
private testItem: TestData
@State currentApiItem: TestApi = {}
@State apiItems: TestApi[] = [];
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@State localName: string = 'DaYuBlue'
@State currentIndex: number = 1
@State currentIndex: Number = 1
@StorageLink( 'pairedMac' ) pairedMac: string = "";
@Builder IngredientItem( apiItem: TestApi , index: number ) {
@Builder IngredientItem( apiItem: TestApi , index: Number ) {
Stack() {
Flex() {
Flex( { alignItems : ItemAlign.Center } ) {
@ -86,7 +86,7 @@ export struct AutoVerificationTable {
} )
}
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
return this.apiItems[index].result
}
@ -98,7 +98,7 @@ export struct AutoVerificationTable {
justifyContent : FlexAlign.SpaceBetween ,
alignItems : ItemAlign.Start
} ) {
ForEach( this.apiItems , ( item: TestApi , index: number ) => {
ForEach( this.apiItems , ( item: TestApi , index: Number ) => {
this.IngredientItem( item , index )
} )
}

View File

@ -17,7 +17,7 @@
import prompt from '@ohos.prompt'
import { P2pPswDialog } from '../Component/p2pPswDialog'
import { P2pModel } from '../MainAbility/model/p2pModel'
import { P2pModel } from '../entryability/model/p2pModel'
import { P2pView } from '../Component/p2pView'
import wifi from '@ohos.wifi'
@ -32,8 +32,8 @@ let self = null
export struct AvailableP2p {
private p2pModel: P2pModel = new P2pModel()
@Prop p2pList: Array<any>
@Prop p2pLinkedInfo: any
private selectIndex: number = - 1
private p2pLinkedInfo: any
private selectIndex: Number = - 1
private p2pPswDialogController: CustomDialogController = new CustomDialogController({
builder : P2pPswDialog( { p2pScanInfo : this.p2pList[ this.selectIndex ] , action : this.onAccept } ) ,
autoCancel : true

View File

@ -17,7 +17,7 @@
import prompt from '@ohos.prompt'
import { PswDialog } from '../Component/pswDialog'
import { WifiModel } from '../MainAbility/model/wifiModel'
import { WifiModel } from '../entryability/model/wifiModel'
import { WifiView } from '../Component/wifiView'
import wifi from '@ohos.wifi'
@ -32,8 +32,8 @@ let self = null
export struct AvailableWifi {
private wifiModel: WifiModel = new WifiModel()
@Prop wifiList:Array<wifi.WifiScanInfo>
@Prop linkedInfo: any
@State selectIndex: number = -1
private linkedInfo: any
@State selectIndex: Number = -1
private pswDialogController: CustomDialogController = new CustomDialogController({
builder: PswDialog({ scanInfo: this.wifiList[this.selectIndex], action: this.onAccept }),
autoCancel: true

View File

@ -24,11 +24,11 @@ const TAG = "[basicDataSource]"
class BasicDataSource implements IDataSource {
private listeners: DataChangeListener[] = []
public totalCount(): number {
public totalCount(): Number {
return 0
}
public getData( index: number ): any {
public getData( index: Number ): any {
return undefined
}
@ -57,25 +57,25 @@ class BasicDataSource implements IDataSource {
} )
}
notifyDataAdd( index: number ): void {
notifyDataAdd( index: Number ): void {
this.listeners.forEach( listener => {
listener.onDataAdd( index )
} )
}
notifyDataChange( index: number ): void {
notifyDataChange( index: Number ): void {
this.listeners.forEach( listener => {
listener.onDataChange( index )
} )
}
notifyDataDelete( index: number ): void {
notifyDataDelete( index: Number ): void {
this.listeners.forEach( listener => {
listener.onDataDelete( index )
} )
}
notifyDataMove( from: number , to: number ): void {
notifyDataMove( from: Number , to: Number ): void {
this.listeners.forEach( listener => {
listener.onDataMove( from , to )
} )
@ -90,15 +90,15 @@ export default class WifiDataSource extends BasicDataSource {
this.dataArray = data
}
public totalCount(): number {
public totalCount(): Number {
return this.dataArray.length
}
public getData( index: number ): any {
public getData( index: Number ): any {
return this.dataArray[index]
}
public addData( index: number , data: wifi.WifiScanInfo ): void {
public addData( index: Number , data: wifi.WifiScanInfo ): void {
this.dataArray.splice( index , 0 , data )
this.notifyDataAdd( index )
}

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -16,9 +16,9 @@
// @ts-nocheck
import { TestData , TestApi } from '../MainAbility/model/testData'
import { TestData , TestApi } from '../entryability/model/testData'
import prompt from '@system.prompt';
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
const TAG = "[contentTable]"
/**
@ -33,12 +33,12 @@ export struct GetProfileConnSateDialog {
{ value : 'HANDS_FREE_AUDIO_GATEWAY' },
{ value : 'HID_HOST' }
]
@State currentClick: number = 1;
@State currentClick: Number = 1;
@Link textValue: string
@Link inputValue: string
@Link apiItem: TestApi
@Link currentIndex: number
@Link changeIndex: number
@Link currentIndex: Number
@Link changeIndex: Number
controller: CustomDialogController
cancel: () => void
confirm: ( string ) => void
@ -56,7 +56,7 @@ export struct GetProfileConnSateDialog {
.optionFont( { size : 17 } )
.height( 80 )
.width( ConfigData.WH_90_100 )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
console.log( "Select:" + index )
this.currentClick = index
} )
@ -104,13 +104,13 @@ export struct SetScanModeDialog {
{ value : 'CONNECTABLE_GENERAL_DISCOVERABLE' },
{ value : 'CONNECTABLE_LIMITED_DISCOVERABLE' }
]
@State currentClick: number = 4;
@State currentClick: Number = 4;
@Link textValue: string
@Link inputValue: string
@Link apiItem: TestApi
@Link currentIndex: number
@Link changeIndex: number
@State duration: number = 0
@Link currentIndex: Number
@Link changeIndex: Number
@State duration: Number = 0
controller: CustomDialogController
cancel: () => void
confirm: ( string ) => void
@ -128,7 +128,7 @@ export struct SetScanModeDialog {
.optionFont( { size : 12 } )
.height( 60 )
.width( ConfigData.WH_90_100 )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
console.log( TAG , "Select:" + index )
this.currentClick = index
} )
@ -185,8 +185,8 @@ export struct InputDialog {
@Link textValue: string
@Link inputValue: string
@Link apiItem: TestApi
@Link currentIndex: number
@Link changeIndex: number
@Link currentIndex: Number
@Link changeIndex: Number
controller: CustomDialogController
cancel: () => void
confirm: ( string ) => void
@ -240,9 +240,9 @@ export struct ContentTable {
private testItem: TestData
@State currentApiItem: TestApi = {}
@State apiItems: TestApi[] = [];
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@State localName: string = 'MyTestDevice'
@State currentIndex: number = 1
@State currentIndex: Number = 1
@StorageLink( 'pairedMac' ) pairedMac: string = "";
getProfileConnSateDialog: CustomDialogController = new CustomDialogController({
builder : GetProfileConnSateDialog( {
@ -295,15 +295,16 @@ export struct ContentTable {
console.log( TAG , 'input text:' , text )
}
@Builder IngredientItem( apiItem: TestApi , index: number ) {
@Builder IngredientItem( apiItem: TestApi , index: Number ) {
Stack() {
Flex() {
Flex( { alignItems : ItemAlign.Center } ) {
Image( $r( 'app.media.WLAN' ) )
.objectFit( ImageFit.Contain )
.autoResize( false )
.height( 30 )
.width( 30 )
.height( 50 )
.width( 40 )
.padding( { top : "15vp" } )
}
.layoutWeight( 1 )
.padding( { left : 10 } )
@ -313,12 +314,12 @@ export struct ContentTable {
.fontSize( 17.4 )
.fontWeight( FontWeight.Bold )
.layoutWeight( 1 )
.padding( { left : 10 , top : 15 } )
.padding( { left : "10vp" , top : "10vp" } )
Text( apiItem.method )
.fontSize( 17.4 )
.fontWeight( FontWeight.Bold )
.layoutWeight( 1 )
.padding( { left : 10 , top : 5 } )
.padding( { left : "10vp" , top : "5vp" } )
}
.layoutWeight( 6 )
.width( ConfigData.WH_80_100 )
@ -327,6 +328,7 @@ export struct ContentTable {
Text( this.changeIndex >= 0 ? this.getCurrentState( index ) : apiItem.result )
.fontSize( 17.4 )
.flexGrow( 1 )
.padding( { top : "15vp" } )
}
.layoutWeight( 3 )
.padding( { left : 25 } )
@ -406,7 +408,7 @@ export struct ContentTable {
} )
}
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
return this.apiItems[ index ].result
}
@ -418,7 +420,7 @@ export struct ContentTable {
justifyContent : FlexAlign.SpaceBetween ,
alignItems : ItemAlign.Start
} ) {
ForEach( this.apiItems , ( item: TestApi , index: number ) => {
ForEach( this.apiItems , ( item: TestApi , index: Number ) => {
this.IngredientItem( item , index )
} )
}

View File

@ -16,7 +16,7 @@
// @ts-nocheck
import ComponentConfig from './componentconfig';
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* entry contentTable Component Page Of Wifi test
*/

View File

@ -15,9 +15,9 @@
// @ts-nocheck
import { TestData , TestApi } from '../MainAbility/model/testData'
import { initHotspotApIData } from '../MainAbility/model/testDataModels'
import ConfigData from '../Utils/ConfigData';
import { TestData , TestApi } from '../entryability/model/testData'
import { initHotspotApIData } from '../entryability/model/testDataModels'
import ConfigData from '../utils/ConfigData';
const TAG = "[filterTable]"
/**
@ -28,18 +28,18 @@ const TAG = "[filterTable]"
export struct FilterTable {
private testItem: TestData
@State apiItems: TestApi[] = initHotspotApIData()
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// input ble scan parameters:
/*ScanFilter*/
@State cbxBleScanFilter: boolean = false;
@State h_ssid: string = "testApp1";
@State h_securityType: number = 3;
@State h_band: number = 2;
@State h_securityType: Number = 3;
@State h_band: Number = 2;
@State h_preSharedKey: string = "12345678";
@State h_maxConn: number = 3;
@State h_channel: number = 36;
@State h_maxConn: Number = 3;
@State h_channel: Number = 36;
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
return this.apiItems[ index ].result
}
@ -68,6 +68,7 @@ export struct FilterTable {
.width( ConfigData.WH_80_100 )
.borderRadius( 1 )
}
.backgroundColor( $r( "app.color.moon" ) )
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
@ -86,6 +87,7 @@ export struct FilterTable {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
Text( "maxConn" ).fontSize( 17 ).width( 80 )
@ -101,7 +103,7 @@ export struct FilterTable {
.selectedOptionFont( { size : 17 } )
.optionFont( { size : 15 } )
.width( ConfigData.WH_80_100 )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
console.log( TAG , "Select:" + index )
AppStorage.SetOrCreate( 'h_maxConn' , index );
} )
@ -111,6 +113,7 @@ export struct FilterTable {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
Text( "band" ).fontSize( 17 ).width( 60 );
@ -126,6 +129,7 @@ export struct FilterTable {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
@ -141,6 +145,7 @@ export struct FilterTable {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
Text( "channel" ).fontSize( 17 ).width( 120 )
@ -155,6 +160,7 @@ export struct FilterTable {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
}
.height( 300 )
.width( ConfigData.WH_100_100 )
@ -164,7 +170,7 @@ export struct FilterTable {
.borderWidth( 1 )
}
.height( ConfigData.WH_100_100 )
.backgroundColor( $r( "app.color.white" ) )
.backgroundColor( $r( "app.color.lead" ) )
}
.scrollBarWidth( 20 )
.padding( { bottom : 10 } )

View File

@ -15,9 +15,9 @@
// @ts-nocheck
import { TestData , TestApi } from '../MainAbility/model/testData'
import { initHotspotManagerApIData } from '../MainAbility/model/testDataModels'
import ConfigData from '../Utils/ConfigData';
import { TestData , TestApi } from '../entryability/model/testData'
import { initHotspotManagerApIData } from '../entryability/model/testDataModels'
import ConfigData from '../utils/ConfigData';
const TAG = "[filterTableManager]"
/**
@ -28,18 +28,18 @@ const TAG = "[filterTableManager]"
export struct FilterTableManager {
private testItem: TestData
@State apiItems: TestApi[] = initHotspotManagerApIData()
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// input ble scan parameters:
/*ScanFilter*/
@State cbxBleScanFilter: boolean = false;
@State h_ssid1: string = "testApp1";
@State h_securityType1: number = 3;
@State h_band1: number = 2;
@State h_securityType1: Number = 3;
@State h_band1: Number = 2;
@State h_preSharedKey1: string = "12345678";
@State h_maxConn1: number = 3;
@State h_channel1: number = 36;
@State h_maxConn1: Number = 3;
@State h_channel1: Number = 36;
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
return this.apiItems[ index ].result
}
@ -68,6 +68,7 @@ export struct FilterTableManager {
.width( ConfigData.WH_80_100 )
.borderRadius( 1 )
}
.backgroundColor( $r( "app.color.moon" ) )
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
@ -86,6 +87,7 @@ export struct FilterTableManager {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
Text( "maxConn" ).fontSize( 17 ).width( 80 )
@ -101,7 +103,7 @@ export struct FilterTableManager {
.selectedOptionFont( { size : 17 } )
.optionFont( { size : 15 } )
.width( ConfigData.WH_80_100 )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
console.log( TAG , "Select:" + index )
AppStorage.SetOrCreate( 'h_maxConn1' , index );
} )
@ -111,6 +113,7 @@ export struct FilterTableManager {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
Text( "band" ).fontSize( 17 ).width( 60 );
@ -126,6 +129,7 @@ export struct FilterTableManager {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
@ -141,6 +145,7 @@ export struct FilterTableManager {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
Row() {
Text( "channel" ).fontSize( 17 ).width( 120 )
@ -155,6 +160,7 @@ export struct FilterTableManager {
.padding( 5 )
.justifyContent( FlexAlign.Start )
.alignItems( VerticalAlign.Center )
.backgroundColor( $r( "app.color.spring" ) )
}
.height( 300 )
.width( ConfigData.WH_100_100 )
@ -164,7 +170,7 @@ export struct FilterTableManager {
.borderWidth( 1 )
}
.height( ConfigData.WH_100_100 )
.backgroundColor( $r( "app.color.white" ) )
.backgroundColor( $r( "app.color.lead" ) )
}
.scrollBarWidth( 20 )
.padding( { bottom : 10 } )

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
import Router from '@system.router';
const TAG = "[headComponent]"

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
import Router from '@system.router';
const TAG = "[headerComponent]"
/**

View File

@ -16,58 +16,58 @@
// @ts-nocheck
import ComponentConfig from './componentConfig';
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* ImageAnimator component Of WiFi test
*/
@Component
export default struct ImageAnimatorComponent {
private imageWidth: number | Resource = 0
private imageHeight: number | Resource = 0
private whtl: number | string = ComponentConfig.value_20;
private imageWidth: Number | Resource = 0
private imageHeight: Number | Resource = 0
private whtl: Number | string = ComponentConfig.value_20;
build() {
Column() {
ImageAnimator()
.images( [
{
src : '../MainAbility/res/image/hdpi/ic_loading01.png' ,
src : '../entryability/res/image/hdpi/ic_loading01.png' ,
duration : ComponentConfig.DURATION_TIME ,
width : this.whtl ,
height : this.whtl ,
top : this.whtl ,
left : this.whtl
}, {
src : '../MainAbility/res/image/hdpi/ic_loading02.png' ,
src : '../entryability/res/image/hdpi/ic_loading02.png' ,
duration : ComponentConfig.DURATION_TIME ,
width : this.whtl ,
height : this.whtl ,
top : this.whtl ,
left : this.whtl
}, {
src : '../MainAbility/res/image/hdpi/ic_loading03.png' ,
src : '../entryability/res/image/hdpi/ic_loading03.png' ,
duration : ComponentConfig.DURATION_TIME ,
width : this.whtl ,
height : this.whtl ,
top : this.whtl ,
left : this.whtl
}, {
src : '../MainAbility/res/image/hdpi/ic_loading04.png' ,
src : '../entryability/res/image/hdpi/ic_loading04.png' ,
duration : ComponentConfig.DURATION_TIME ,
width : this.whtl ,
height : this.whtl ,
top : this.whtl ,
left : this.whtl
}, {
src : '../MainAbility/res/image/hdpi/ic_loading05.png' ,
src : '../entryability/res/image/hdpi/ic_loading05.png' ,
duration : ComponentConfig.DURATION_TIME ,
width : this.whtl ,
height : this.whtl ,
top : this.whtl ,
left : this.whtl
}, {
src : '../MainAbility/res/image/hdpi/ic_loading06.png' ,
src : '../entryability/res/image/hdpi/ic_loading06.png' ,
duration : ComponentConfig.DURATION_TIME ,
width : this.whtl ,
height : this.whtl ,

View File

@ -17,24 +17,24 @@
import screenshot from '@ohos.screenshot'
import image from '@ohos.multimedia.image'
import MediaUtils from '../MainAbility/model/MediaUtils'
import MediaUtils from '../entryability/model/MediaUtils'
const TAG = "[mainPageTitle]"
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* Main-Page Title Of WiFi test
*/
@Component
export struct MainPageTitle {
@State colOpacity: number = 1
@State count: number = 0
@State myborderWidth: number = 0
@State myborderRadius: number = 0
@State offsetX: number = 0
@State offsetY: number = 0
@State myscale: number = 1
@State angle: number = 0
@State colOpacity: Number = 1
@State count: Number = 0
@State myborderWidth: Number = 0
@State myborderRadius: Number = 0
@State offsetX: Number = 0
@State offsetY: Number = 0
@State myscale: Number = 1
@State angle: Number = 0
getScreen = ( isFullScreen: boolean ) => {
let screenshotOptions: screenshot.ScreenshotOptions = {
screenRect : { left : 0 , top : 0 , width : 400 , height : 400 } ,

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -16,7 +16,7 @@
// @ts-nocheck
import wifi from '@ohos.wifi'
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* PswDialog page of WiFi test
*/

View File

@ -15,12 +15,12 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import Router from '@system.router';
import screenshot from '@ohos.screenshot'
import image from '@ohos.multimedia.image'
import MediaUtils from '../MainAbility/model/MediaUtils'
import ConfigData from '../Utils/ConfigData';
import MediaUtils from '../entryability/model/MediaUtils'
import ConfigData from '../utils/ConfigData';
const TAG = "[p2pTitleBar]"
@ -32,14 +32,14 @@ const TAG = "[p2pTitleBar]"
export struct P2pTitleBar {
private testItem: TestData = null
private detail: string
@State colOpacity: number = 1
@State count: number = 0
@State myborderWidth: number = 0
@State myborderRadius: number = 0
@State offsetX: number = 0
@State offsetY: number = 0
@State myscale: number = 1
@State angle: number = 0
@State colOpacity: Number = 1
@State count: Number = 0
@State myborderWidth: Number = 0
@State myborderRadius: Number = 0
@State offsetX: Number = 0
@State offsetY: Number = 0
@State myscale: Number = 1
@State angle: Number = 0
getScreen = ( isFullScreen: boolean ) => {
let screenshotOptions: screenshot.ScreenshotOptions = {
screenRect : { left : 0 , top : 0 , width : 400 , height : 400 } ,

View File

@ -16,8 +16,8 @@
// @ts-nocheck
const TAG = "[P2pView]"
import ConfigData from '../Utils/ConfigData';
import { testOnP2pConnectionChange , testGetCurrentGroupCallback } from '../MainAbility/model/p2pInterface'
import ConfigData from '../utils/ConfigData';
import { testOnP2pConnectionChange , testGetCurrentGroupCallback } from '../entryability/model/p2pInterface'
/**
* P2pView Component of p2p test
*/
@ -26,7 +26,7 @@ import { testOnP2pConnectionChange , testGetCurrentGroupCallback } from '../Main
export struct P2pView {
private p2p: any = null
private securityString: Resource = $r( 'app.string.useful' )
private p2pConnectState: number = 0
private p2pConnectState: Number = 0
private p2pLinkedDeviceName: string = ""
@State isLock: boolean = true

View File

@ -15,12 +15,12 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import Router from '@system.router';
import screenshot from '@ohos.screenshot'
import image from '@ohos.multimedia.image'
import MediaUtils from '../MainAbility/model/MediaUtils'
import ConfigData from '../Utils/ConfigData';
import MediaUtils from '../entryability/model/MediaUtils'
import ConfigData from '../utils/ConfigData';
const TAG = "[pageTitle]"
@ -32,14 +32,14 @@ const TAG = "[pageTitle]"
export struct PageTitle {
private testItem: TestData = null
private detail: string
@State colOpacity: number = 1
@State count: number = 0
@State myborderWidth: number = 0
@State myborderRadius: number = 0
@State offsetX: number = 0
@State offsetY: number = 0
@State myscale: number = 1
@State angle: number = 0
@State colOpacity: Number = 1
@State count: Number = 0
@State myborderWidth: Number = 0
@State myborderRadius: Number = 0
@State offsetX: Number = 0
@State offsetY: Number = 0
@State myscale: Number = 1
@State angle: Number = 0
getScreen = ( isFullScreen: boolean ) => {
let screenshotOptions: screenshot.ScreenshotOptions = {
screenRect : { left : 0 , top : 0 , width : 400 , height : 400 } ,

View File

@ -0,0 +1,194 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Browser } from '../entryability/model/bowser';
import { WebTab } from './webTitleBar';
import Logger from '../entryability/model/Logger';
const TAG: string = '[PhoneLayout]';
const BUTTON_WIDTH: number = 22;
const BUTTON_RADIUS: number = 4;
const DOWN_COLOR: string = '#e4e4e4';
const UP_COLOR: string = '#00000000';
@Component
export struct PhoneLayout {
@Link browser: Browser;
@State isPhone: boolean = true;
@State hasDown: boolean = false;
@State pageCount: string = '1';
@State arrayIndex: Number = 0;
private addr: string = '';
private toolPoneArray: Array<{
imageSrc: Resource,
id: Number
}> = [
{
imageSrc: $r('app.media.ic_public_back'),
id: 1
},
{
imageSrc: $r('app.media.ic_public_advance'),
id: 2
},
{
imageSrc: $r('app.media.ic_public_home'),
id: 5
},
{
imageSrc: $r('app.media.ic_public_refresh'),
id: 3
}
];
@Builder ToolBar() {
Column() {
if (!this.browser.hideProgress) {
Progress({ value: this.browser.progress, total: 100 })
.color('#0000ff')
}
Row() {
ForEach(this.toolPoneArray, (item: any, index: Number) => {
Column() {
Divider().color('#e9eaec')
Button({ type: ButtonType.Normal }) {
Column() {
if (item.id !== 4) {
Image(item.imageSrc)
} else {
Column() {
Text(this.pageCount)
.fontSize(16)
}
.border({ width: 2 })
.width(22)
.height(22)
.borderRadius(5)
.justifyContent(FlexAlign.Center)
}
}
.width(BUTTON_WIDTH)
.height(BUTTON_WIDTH)
.justifyContent(FlexAlign.Center)
}
.height('100%')
.width('100%')
.backgroundColor(this.arrayIndex === item.id ? DOWN_COLOR : UP_COLOR)
.borderRadius(BUTTON_RADIUS)
.flexShrink(0)
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.arrayIndex = item.id;
} else if (event.type === TouchType.Up) {
this.arrayIndex = 0;
}
})
.onClick((event: ClickEvent) => {
switch (item.id) {
case 1:
this.browser.Back();
break;
case 2:
this.browser.Forward();
break;
case 3:
this.browser.Refresh();
break;
case 5:
this.browser.webControllerArray[this.browser.tabArrayIndex].controller.loadUrl({
url: $rawfile('phone.html')
});
break;
default:
break;
}
})
}
.width('20%')
.id(`navigationButton${index}`)
})
}
.justifyContent(FlexAlign.SpaceAround)
.width('100%')
.height('100%')
.backgroundColor('#fdfdfd')
}
.height('100%')
}
@Builder TitleBar() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Column() {
TextInput({ placeholder: $r('app.string.Input_url'), text: this.browser.inputValue })
.placeholderFont({ size: 16, weight: 500 })
.fontSize(16)
.height(34)
.margin({ left: 6 })
.id('inputUrl')
.onChange((value: string) => {
console.log(TAG, `onChange`);
this.addr = value;
})
.onSubmit((enterKey: EnterKeyType) => {
console.log(TAG, `onSubmit`);
this.browser.webControllerArray[this.browser.tabArrayIndex].controller.loadUrl({
url: `https://${this.addr}`
});
this.addr = '';
})
}
Column() {
Button({ type: ButtonType.Normal }) {
Image($r('app.media.submit'))
}
.width(BUTTON_WIDTH)
.height(BUTTON_WIDTH)
.backgroundColor(this.hasDown ? DOWN_COLOR : UP_COLOR)
.margin({ top: 6 })
.id(`actionButton0`)
}
.width('10%')
.height(34)
.flexShrink(0)
.backgroundColor(this.hasDown ? DOWN_COLOR : UP_COLOR)
.borderRadius(BUTTON_RADIUS)
.margin({ left: 6, right: 6 })
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.hasDown = true;
} else if (event.type === TouchType.Up) {
this.hasDown = false;
}
})
.onClick((event: ClickEvent) => {
this.browser.loadUrl(this.addr);
this.addr = '';
})
}
.position({ x: 0, y: 3 })
}
build() {
Column() {
Navigation() {
WebTab({ browser: $browser, isPhone: $isPhone }).height("100%")
}
// .title({ builder: this.TitleBar, height: 40 })
.toolBar(this.ToolBar)
.hideBackButton(true)
}
.height("100%")
}
}

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';

View File

@ -16,14 +16,14 @@
// @ts-nocheck
import wifi from '@ohos.wifi'
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* PswDialog page of WiFi test
*/
@CustomDialog
export struct PswDialog {
@State scanInfo: any = null
private scanInfo: any = null
private psw: string = ''
private controller: CustomDialogController
private action: ( scanInfo , psw ) => void

View File

@ -14,8 +14,8 @@
*/
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import { TestScenario } from '../MainAbility/model/testData'
import ConfigData from '../utils/ConfigData';
import { TestScenario } from '../entryability/model/testData'
import prompt from '@system.prompt';
const TAG = "[scenarioContentTable]"
@ -27,10 +27,10 @@ const TAG = "[scenarioContentTable]"
export struct ScenarioContentTable {
@State scenarioItems: TestScenario[] = [];
private scenarioItemsX: TestScenario[]
@Prop changeIndex: number;
@Prop changeIndex: Number;
@State localName: string = 'DaYuBlue'
@Builder IngredientItem( scenarioItem: TestScenario , index: number ) {
@Builder IngredientItem( scenarioItem: TestScenario , index: Number ) {
Stack() {
Flex() {
Flex( { direction : FlexDirection.Column , alignItems : ItemAlign.Start } ) {
@ -72,7 +72,7 @@ export struct ScenarioContentTable {
.backgroundColor( $r( "app.color.white" ) )
}
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
if ( index <= this.changeIndex ) {
this.scenarioItemsX[ index ].result = 'pass';
} else {
@ -95,7 +95,7 @@ export struct ScenarioContentTable {
justifyContent : FlexAlign.SpaceBetween ,
alignItems : ItemAlign.Start
} ) {
ForEach( this.scenarioItems , ( item: TestScenario , index: number ) => {
ForEach( this.scenarioItems , ( item: TestScenario , index: Number ) => {
this.IngredientItem( item , index )
} )
}

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -15,8 +15,8 @@
*/
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import { TestData , TestApi } from '../MainAbility/model/testData'
import ConfigData from '../utils/ConfigData';
import { TestData , TestApi } from '../entryability/model/testData'
import prompt from '@system.prompt';
const TAG = "[stressContentTable]"
@ -32,12 +32,12 @@ export struct GetProfileConnSateDialog {
{ value : 'HANDS_FREE_AUDIO_GATEWAY' },
{ value : 'HID_HOST' }
]
@State currentClick: number = 1;
@State currentClick: Number = 1;
@Link textValue: string
@Link inputValue: string
@Link apiItem: TestApi
@Link currentIndex: number
@Link changeIndex: number
@Link currentIndex: Number
@Link changeIndex: Number
controller: CustomDialogController
cancel: () => void
confirm: ( string ) => void
@ -55,7 +55,7 @@ export struct GetProfileConnSateDialog {
.optionFont( { size : 17 } )
.height( 80 )
.width( ConfigData.WH_90_100 )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
console.log( "Select:" + index )
this.currentClick = index
} )
@ -103,13 +103,13 @@ export struct SetScanModeDialog {
{ value : 'CONNECTABLE_GENERAL_DISCOVERABLE' },
{ value : 'CONNECTABLE_LIMITED_DISCOVERABLE' }
]
@State currentClick: number = 4;
@State currentClick: Number = 4;
@Link textValue: string
@Link inputValue: string
@Link apiItem: TestApi
@Link currentIndex: number
@Link changeIndex: number
@State duration: number = 0
@Link currentIndex: Number
@Link changeIndex: Number
@State duration: Number = 0
controller: CustomDialogController
cancel: () => void
confirm: ( string ) => void
@ -127,7 +127,7 @@ export struct SetScanModeDialog {
.optionFont( { size : 12 } )
.height( 60 )
.width( ConfigData.WH_90_100 )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
console.log( TAG , "Select:" + index )
this.currentClick = index
} )
@ -184,8 +184,8 @@ export struct InputDialog {
@Link textValue: string
@Link inputValue: string
@Link apiItem: TestApi
@Link currentIndex: number
@Link changeIndex: number
@Link currentIndex: Number
@Link changeIndex: Number
controller: CustomDialogController
cancel: () => void
confirm: ( string ) => void
@ -239,9 +239,9 @@ export struct StressContentTable {
private testItem: TestData
@State currentApiItem: TestApi = {}
@State apiItems: TestApi[] = [];
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@State localName: string = 'DaYuBlue1'
@State currentIndex: number = 1
@State currentIndex: Number = 1
@StorageLink( 'pairedMac' ) pairedMac: string = "";
getProfileConnSateDialog: CustomDialogController = new CustomDialogController({
builder : GetProfileConnSateDialog( {
@ -294,7 +294,7 @@ export struct StressContentTable {
console.log( 'input text:' , text )
}
@Builder IngredientItem( apiItem: TestApi , index: number ) {
@Builder IngredientItem( apiItem: TestApi , index: Number ) {
Stack() {
Flex() {
Flex( { alignItems : ItemAlign.Center } ) {
@ -367,7 +367,7 @@ export struct StressContentTable {
} )
}
getCurrentState( index: number ) {
getCurrentState( index: Number ) {
return this.apiItems[ index ].result
}
@ -379,7 +379,7 @@ export struct StressContentTable {
justifyContent : FlexAlign.SpaceBetween ,
alignItems : ItemAlign.Start
} ) {
ForEach( this.apiItems , ( item: TestApi , index: number ) => {
ForEach( this.apiItems , ( item: TestApi , index: Number ) => {
this.IngredientItem( item , index )
} )
}

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestList } from './testList';
/**

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
const TAG = "[subEntryComponent]"
/**

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestGridItem } from './testGridItem'
/**
* TestGrid component page of wifi test
@ -25,7 +25,7 @@ import { TestGridItem } from './testGridItem'
export struct TestGrid {
private testItems: TestData[]
private gridRowTemplate: string = ''
private heightValue: number
private heightValue: Number
aboutToAppear() {
var rows = Math.round( this.testItems.length / 2 );

View File

@ -15,9 +15,9 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import router from '@system.router'
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* Test-GridItem page of wifi test
*/

View File

@ -15,8 +15,8 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import ConfigData from '../Utils/ConfigData';
import { TestData } from '../entryability/model/testData'
import ConfigData from '../utils/ConfigData';
/**
* Test-ImageDisplay page of wifi test
@ -31,9 +31,9 @@ export struct TestImageDisplay {
Flex( { alignItems : ItemAlign.Start } ) {
Stack() {
Image( this.testItem.image )
.height( 80 )
.width( 80 )
.margin( { left : 10 , bottom : 10 } )
.height( 100 )
.width( 100 )
.margin( { left : "20vp" , top : "20vp" } )
}
.width( ConfigData.WH_20_100 )
@ -41,16 +41,16 @@ export struct TestImageDisplay {
Text( this.testItem.name )
.fontSize( 26 )
.fontWeight( 500 )
.margin( { left : 26 , top : 10 } )
.margin( { left : "26vp" , top : "20vp" } )
.width( ConfigData.WH_90_100 )
Text( this.testItem.detail )
.fontSize( 18 )
.fontWeight( 500 )
.margin( { top : 8 } )
.margin( { top : "8vp" } )
.width( ConfigData.WH_80_100 )
}
.width( ConfigData.WH_80_100 )
.padding( { left : 20 } )
.width( ConfigData.WH_70_100 )
.padding( { left : "20vp" , top : "15vp"} )
}
}
.backgroundColor( '#FFedf2f5' )

View File

@ -15,9 +15,9 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import { TestListItem } from './testListItems';
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* Test-List component page of wifi test
*/
@ -37,7 +37,7 @@ export struct TestList {
}
} , item => item.id.toString() )
}
.height( ConfigData.WH_93_100 )
.height( ConfigData.WH_100_100 )
.backgroundColor( $r( "app.color.lead" ) )
}
}

View File

@ -14,8 +14,8 @@
*/
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import { TestData } from '../MainAbility/model/testData'
import ConfigData from '../utils/ConfigData';
import { TestData } from '../entryability/model/testData'
/**
* Test-ListItem component of wifi test

View File

@ -15,13 +15,13 @@
// @ts-nocheck
import { TestData } from '../MainAbility/model/testData'
import { TestData } from '../entryability/model/testData'
import Router from '@system.router';
import screenshot from '@ohos.screenshot'
import image from '@ohos.multimedia.image'
import MediaUtils from '../MainAbility/model/MediaUtils'
import MediaUtils from '../entryability/model/MediaUtils'
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
const TAG = "[titleBar]"
const PAGE_URI_ABOUT_MODE = 'pages/subManualApiTest/subWifiTest/about'
@ -34,14 +34,14 @@ const PAGE_URI_ABOUT_MODE = 'pages/subManualApiTest/subWifiTest/about'
export struct TitleBar {
private testItem: TestData = null
private detail: string
@State colOpacity: number = 1
@State count: number = 0
@State myborderWidth: number = 0
@State myborderRadius: number = 0
@State offsetX: number = 0
@State offsetY: number = 0
@State myscale: number = 1
@State angle: number = 0
@State colOpacity: Number = 1
@State count: Number = 0
@State myborderWidth: Number = 0
@State myborderRadius: Number = 0
@State offsetX: Number = 0
@State offsetY: Number = 0
@State myscale: Number = 1
@State angle: Number = 0
getScreen = ( isFullScreen: boolean ) => {
let screenshotOptions: screenshot.ScreenshotOptions = {
screenRect : { left : 0 , top : 0 , width : 400 , height : 400 } ,

View File

@ -15,7 +15,7 @@
// @ts-nocheck
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* TitleComponent of wifi test

View File

@ -0,0 +1,329 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Browser , LoadingStatus , WebObject } from '../entryability/model/bowser'
import Logger from '../entryability/model/Logger'
import fs from '@ohos.file.fs';
const TAG: string = '[webTitleBar]'
const BUTTON_WIDTH: number = 22
const BUTTON_RADIUS: number = 4
const DOWN_COLOR: string = '#e4e4e4'
const UP_COLOR: string = '#00000000'
const PAD_USER_AGENT: string = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTMl, like Gecko) Chrome/92.0.4515.105 Safari/537.36'
const PHONE_USER_AGENT: string = 'Mozilla/5.0 (Linux; Android 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTMl, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 Mobile Safari/537.36'
@Component
export struct TabletTitle {
@Link browser: Browser;
@State inputValue: string = ''
@State arrayIndex: Number = 0
@State addr: string = 'www.baidu.com'
private navigationButton: Array<{
imageSrc: Resource,
id: Number
}> = [
{
imageSrc : $r( 'app.media.ic_public_back' ) ,
id : 1
},
{
imageSrc : $r( 'app.media.ic_public_advance' ) ,
id : 2
},
{
imageSrc : $r( 'app.media.ic_public_refresh' ) ,
id : 3
},
{
imageSrc : $r( 'app.media.ic_public_home' ) ,
id : 4
},
]
private actionButton: Array<{
imageSrc: Resource,
id: Number
}> = [
{
imageSrc : $r( 'app.media.submit' ) ,
id : 5
},
{
imageSrc : $r( 'app.media.ic_public_add' ) ,
id : 6
},
]
build() {
Row() {
ForEach( this.navigationButton , ( item , index ) => {
Button( { type : ButtonType.Normal } ) {
Image( item.imageSrc )
}
.margin( 8 )
.id( `navigationButton${ index }` )
.width( BUTTON_WIDTH )
.height( BUTTON_WIDTH )
.backgroundColor( this.arrayIndex === item.id ? DOWN_COLOR : UP_COLOR )
.borderRadius( BUTTON_RADIUS )
.flexShrink( 0 )
.onTouch( ( event: TouchEvent ) => {
if ( event.type === TouchType.Down ) {
this.arrayIndex = item.id
}
if ( event.type === TouchType.Up ) {
this.arrayIndex = 0
}
} )
.onClick( ( event: ClickEvent ) => {
switch ( item.id ) {
case 1:
this.browser.Back()
break;
case 2:
this.browser.Forward()
break;
case 3:
this.browser.Refresh()
break;
case 4:
this.browser.webControllerArray[ this.browser.tabArrayIndex ].controller.loadUrl( {
url : $rawfile( 'phone.html' ) // pad.html
} )
break;
}
} )
} , item => item.id )
TextInput( { placeholder : '默认网址:www.baidu.com' , text : this.browser.inputValue } )
.placeholderFont( { size : 18 , weight : "50%" } )
.fontSize( 18 )
.margin( 2 )
.id( 'inputUrl' )
.width( '51%' )
.layoutWeight( 1 )
.onChange( ( value: string ) => {
this.addr = value
AppStorage.setOrCreate( "addr" , this.addr )
} )
.onSubmit( ( enterKey: EnterKeyType ) => {
console.log( TAG , `onSubmit` )
if ( this.addr.length !== 0 ) {
this.browser.webControllerArray[ this.browser.tabArrayIndex ].controller.loadUrl( {
url : `https://${ this.addr }`
} )
this.addr = ''
}
} )
ForEach( this.actionButton , ( item , index ) => {
Button( { type : ButtonType.Normal } ) {
Image( item.imageSrc )
}
.margin( 8 )
.id( `actionButton${ index }` )
.width( BUTTON_WIDTH )
.height( BUTTON_WIDTH )
.backgroundColor( this.arrayIndex === item.id ? DOWN_COLOR : UP_COLOR )
.borderRadius( BUTTON_RADIUS )
.flexShrink( 0 )
.onTouch( ( event: TouchEvent ) => {
if ( event.type === TouchType.Down ) {
this.arrayIndex = item.id
}
if ( event.type === TouchType.Up ) {
this.arrayIndex = 0
}
} )
.onClick( ( event: ClickEvent ) => {
if ( item.id === 5 ) {
this.browser.loadUrl( this.addr )
this.addr = ''
} else if ( item.id === 6 ) {
console.log( TAG , `add tab index = ` + this.arrayIndex )
this.browser.addTab()
}
} )
} , item => item.id )
}
.width( '100%' )
.padding( { right : 5 } )
}
}
@Component
export struct BrowserTabs {
@Link browser: Browser;
@State tabButtonIndex: Number = - 1;
build() {
Flex( { direction : FlexDirection.Row , alignItems : ItemAlign.Start } ) {
ForEach( this.browser.webArray , item => {
Row() {
Row() {
Text( "网页" )
}.width( '100%' ).flexShrink( 1 ).justifyContent( FlexAlign.Center ).height( '100%' )
Button( { type : ButtonType.Normal } ) {
Image( $r( 'app.media.ic_public_cancel_filled' ) ).width( 24 ).height( 24 )
}
.backgroundColor( this.tabButtonIndex == item.key ? DOWN_COLOR : '#00000000' )
.id( 'cancelBtn' )
.margin( { right : 2 } )
.width( 33 )
.height( 33 )
.borderRadius( 5 )
.onTouch( ( event: TouchEvent ) => {
if ( event.type === TouchType.Down ) {
this.tabButtonIndex = item.key
} else if ( event.type == TouchType.Up ) {
this.tabButtonIndex = - 1
}
} )
.onClick( ( event: ClickEvent ) => {
if ( this.browser.webArray.length > 1 ) {
this.browser.deleteTab( item.key )
}
} )
}
.width( 180 )
.height( '100%' )
.backgroundColor( this.browser.tabArrayIndex == item.key ? '#ffffff' : '#ececec' )
.onClick( ( event: ClickEvent ) => {
console.log( TAG , `key= ${ item.key }` )
this.browser.setTabArrayIndex( item.key )
this.browser.tabsController.changeIndex( item.key )
} )
Divider().vertical( true ).color( '#c6c6c6' )
} , item => item.timestamp.toString() )
}.height( 33 ).flexShrink( 0 ).backgroundColor( '#ececec' )
}
}
@Component
export struct WebTab {
@Link browser: Browser;
@Link isPhone: boolean;
@State progressStartTime: number = 0;
@State progressEndTime: number = 0;
@State progressCostTime: number = 0;
@State pageStartTime: number = 0;
@State pageEndTime: number = 0;
@State pageCostTime: number = 0;
@State Time: Number = 11
@State fileData: string = "";
@State onPageBeginNumber: number = 0
@State onPageEndNumber: number = 0
@State onProgressChangeNumber: number = 0
@StorageLink( "openWebNumber" ) openWebNumber: number = 0
@StorageLink( "fsFile" ) file: fs.File = null
isRegistered: boolean = false
testObj = {
test : ( addr ) => {
console.log( TAG , `addr= ${ this.browser.tabArrayIndex }` )
this.browser.webControllerArray[ this.browser.tabArrayIndex ].controller.loadUrl( { url : `https://${ addr }` } )
} ,
searchWord : ( word: string ) => {
console.log( `search word= ${ word }` )
let code = encodeURI( word )
this.browser.webControllerArray[ this.browser.tabArrayIndex ].controller.loadUrl( {
url : `https://www.bing.com/search?q=${ code }`
} )
}
}
build() {
Tabs( { barPosition : BarPosition.Start , controller : this.browser.tabsController } ) {
ForEach( this.browser.webArray , item => {
TabContent() {
Web( {
src : this.isPhone ? $rawfile( 'phone.html' ) : $rawfile( 'pad.html' ) ,
controller : this.browser.webControllerArray[ item.key ] !== undefined ?
this.browser.webControllerArray[ item.key ].controller : undefined
} )
.javaScriptAccess( true )
.fileAccess( true )
.domStorageAccess( true )
.userAgent( this.isPhone ? PHONE_USER_AGENT : PAD_USER_AGENT )
.onPageBegin( ( event ) => {
console.log( TAG , `onPageBegin= ${ JSON.stringify( event ) }` )
this.pageStartTime = new Date().getTime()
console.log( TAG , "onPageBegin,开始加载页面,开始时间:" + this.pageStartTime )
this.browser.loadingStatus = LoadingStatus.LOADING
this.fileData = "第" + ( this.openWebNumber + 1 ) + "次onPageBegin,开始加载页面,开始时间:" + this.pageStartTime + "\n"
fs.writeSync( this.file.fd , this.fileData );
} )
.onPageEnd( ( event ) => {
console.log( TAG , `onPageEnd= ${ JSON.stringify( event ) }` )
this.pageEndTime = new Date().getTime()
console.log( TAG , "onPageEnd,结束加载页面,开始时间:" + this.pageEndTime )
this.pageCostTime = this.pageEndTime - this.pageStartTime
console.log( TAG , "onPageEnd,加载页面耗时:" + this.pageCostTime )
this.fileData = "第" + ( this.openWebNumber + 1 ) + "次onPageEnd,结束加载页面,开始时间:" + this.pageEndTime + "\n"
this.fileData += "第" + ( this.openWebNumber + 1 ) + "次onPageEnd,加载页面耗时:" + this.pageCostTime + "ms" + "\n"
fs.writeSync( this.file.fd , this.fileData );
if ( item.key < this.browser.webControllerArray.length && this.browser.webControllerArray[ item.key ].controller ) {
this.browser.webControllerArray[ item.key ].controller.runJavaScript( { script : 'adapterDevice()' } )
this.browser.loadingStatus = LoadingStatus.END
this.registerFunc( this.browser.webControllerArray[ item.key ] )
if ( event.url.startsWith( 'http' ) ) {
this.browser.inputValue = event.url
} else {
this.browser.inputValue = ''
}
}
} )
.onProgressChange( ( event ) => {
console.log( TAG , `onProgressChange` )
this.browser.progress = event.newProgress
console.log( TAG , `onProgressChange,progress:` + this.browser.progress )
if ( this.browser.progress === 10 ) {
this.progressStartTime = new Date().getTime()
console.log( TAG , "onProgressChange,开始加载页面,开始时间:" + this.progressStartTime )
this.fileData = "第" + ( this.openWebNumber + 1 ) + "次onProgressChange,开始加载页面,开始时间:" + this.progressStartTime + "\n"
fs.writeSync( this.file.fd , this.fileData );
} else if ( this.browser.progress === 100 ) {
this.progressEndTime = new Date().getTime()
this.browser.hideProgress = true
console.log( TAG , "onProgressChange,结束加载页面,开始时间:" + this.progressEndTime )
this.progressCostTime = this.progressEndTime - this.progressStartTime
console.log( TAG , "onProgressChange,加载页面耗时:" + this.progressCostTime )
this.fileData = "第" + ( this.openWebNumber + 1 ) + "次onProgressChange,结束加载页面,开始时间:" + this.progressEndTime + "\n"
this.fileData += "第" + ( this.openWebNumber + 1 ) + "次onProgressChange,加载页面耗时:" + this.progressCostTime + "\n"
fs.writeSync( this.file.fd , this.fileData );
} else {
this.browser.hideProgress = false
}
} )
}
} , item => item.timestamp.toString() )
}
.barHeight( 0 )
.scrollable( false )
}
registerFunc( webObject: WebObject ) {
if ( !webObject.isRegistered ) {
console.log( TAG , `registerFunc` )
webObject.controller.registerJavaScriptProxy( {
object : this.testObj , name : 'etsObj' , methodList : [ 'test', 'searchWord' ]
} )
webObject.isRegistered = true
webObject.controller.refresh()
}
}
}

View File

@ -16,14 +16,14 @@
// @ts-nocheck
const TAG = "[wifiView]"
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
/**
* WifiView Component of wifi test
*/
@Component
export struct WifiView {
@State wifi: any = null
private wifi: any = null
private securityString: Resource = $r( 'app.string.encryption' )
@State isLock: boolean = true

View File

@ -1,70 +0,0 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
import Ability from '@ohos.application.Ability'
import Window from '@ohos.window'
/*
mainAbility of wifi test
*/
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? '');
}
onDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
}
onWindowStageCreate(windowStage: Window.WindowStage) {
// Main window is created, set main page for this ability
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/homePage', (err, data) => {
if (err.code) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR);
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}
onForeground() {
// Ability has brought to foreground
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
}
onBackground() {
// Ability has back to background
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
}
}

View File

@ -0,0 +1,40 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @ts-ignore
import { Context } from '@ohos.abilityAccessCtrl';
// 构造单例对象
export class GlobalThis {
private constructor() {}
private static instance: GlobalThis;
private _uiContexts = new Map<string, Context>();
public static getInstance(): GlobalThis {
if (!GlobalThis.instance) {
GlobalThis.instance = new GlobalThis();
}
return GlobalThis.instance;
}
getContext(key: string): Context | undefined {
return this._uiContexts.get(key);
}
setContext(key: string, value: Context): void {
this._uiContexts.set(key, value);
}
// 其他需要传递的内容依此扩展
}

View File

@ -0,0 +1,65 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import UIAbility from '@ohos.app.ability.UIAbility';
import hilog from '@ohos.hilog';
import window from '@ohos.window';
import { GlobalThis } from "../utils/globalThis"
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
export default class EntryAbility extends UIAbility {
onCreate( want , launchParam ) {
hilog.info( 0x0000 , 'testTag' , '%{public}s' , 'Ability onCreate' );
GlobalThis.getInstance().setContext( 'context' , this.context )
// this.context.request
// abilityAccessCtrl.createAtManager().requestPermissionsFromUser(this.context, [])
}
onDestroy() {
hilog.info( 0x0000 , 'testTag' , '%{public}s' , 'Ability onDestroy' );
}
onWindowStageCreate( windowStage: window.WindowStage ) {
// Main window is created, set main page for this ability
hilog.info( 0x0000 , 'testTag' , '%{public}s' , 'Ability onWindowStageCreate' );
windowStage.loadContent( 'pages/homePage' , ( err , data ) => {
if ( err.code ) {
hilog.error( 0x0000 , 'testTag' , 'Failed to load the content. Cause: %{public}s' , JSON.stringify( err ) ?? '' );
return;
}
hilog.info( 0x0000 , 'testTag' , 'Succeeded in loading the content. Data: %{public}s' , JSON.stringify( data ) ?? '' );
} );
let context = this.context;
let pathDir = context.filesDir;
AppStorage.setOrCreate( "pathDir" , pathDir )
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
hilog.info( 0x0000 , 'testTag' , '%{public}s' , 'Ability onWindowStageDestroy' );
}
onForeground() {
// Ability has brought to foreground
hilog.info( 0x0000 , 'testTag' , '%{public}s' , 'Ability onForeground' );
}
onBackground() {
// Ability has back to background
hilog.info( 0x0000 , 'testTag' , '%{public}s' , 'Ability onBackground' );
}
}

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -56,12 +56,12 @@ export class CommonConstants {
/**
* Toast Duration.
*/
static readonly TOAST_TIME: number = 3000;
static readonly TOAST_TIME: Number = 3000;
/**
* Bottom toast.
*/
static readonly TOAST_MARGIN_BOTTOM: number = 64;
static readonly TOAST_MARGIN_BOTTOM: Number = 64;
/**
* Width of title.
@ -76,7 +76,7 @@ export class CommonConstants {
/**
* Radius of bookInfo area.
*/
static readonly IMAGE_BORDER_RADIUS: number = 12;
static readonly IMAGE_BORDER_RADIUS: Number = 12;
/**
* Margin left of book item.
@ -96,7 +96,7 @@ export class CommonConstants {
/**
* Radius of dialog.
*/
static readonly DIALOG_BORDER_RADIUS: number = 32;
static readonly DIALOG_BORDER_RADIUS: Number = 32;
/**
* Button width of dialog.
@ -121,7 +121,7 @@ export class CommonConstants {
/**
* Horizontal offset of dialog.
*/
static readonly DIALOG_OFFSET_X: number = 0;
static readonly DIALOG_OFFSET_X: Number = 0;
/**
* TextInput offset of dialog.
@ -216,7 +216,7 @@ export class CommonConstants {
/**
* The fraction or number of seconds is less than 10.
*/
static readonly TEN: number = 10;
static readonly TEN: Number = 10;
/**
* One task of data.
@ -231,17 +231,17 @@ export class CommonConstants {
/**
* default click index.
*/
static readonly DEFAULT_CLICK_INDEX: number = -1;
static readonly DEFAULT_CLICK_INDEX: Number = -1;
/**
* default SliderChangeMode.
*/
static readonly DEFAULT_SLIDER_MODE: number = -1;
static readonly DEFAULT_SLIDER_MODE: Number = -1;
/**
* click SliderChangeMode.
*/
static readonly CLICK_SLIDER_MODE: number = 3;
static readonly CLICK_SLIDER_MODE: Number = 3;
/**
* x-axis transition animation.

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -130,7 +130,7 @@ export default struct AddTargetDialog {
.selectedOptionFont( { size : 17 } )
.optionFont( { size : 15 } )
.width( "100%" )
.onSelect( ( index: number ) => {
.onSelect( ( index: Number ) => {
this.wifiCandidateConfig.securityType = index;
} )
}

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -17,10 +17,10 @@ import { CommonConstants } from '../common/constant/CommonConstant';
@Component
export default struct ProgressEditPanel {
@Link sliderMode: number;
@Link sliderMode: Number;
@Prop slidingProgress: number;
onCancel: () => void;
onClickOK: (progress: number) => void;
onClickOK: (progress: Number) => void;
build() {
Column() {

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -23,7 +23,7 @@ export default struct TargetList {
@Consume overAllProgressChanged: boolean;
@State isEditMode: boolean = false;
@State selectArray: Array<boolean> = [];
@State clickIndex: number = CommonConstants.DEFAULT_CLICK_INDEX;
@State clickIndex: Number = CommonConstants.DEFAULT_CLICK_INDEX;
@State selectAll: boolean = false;
@Link targetData: Array<TaskItemBean>;
onAddClick: () => void;

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -25,10 +25,10 @@ export default struct TargetListItem {
@State updateDate: string = '';
@Link selectArr: Array<boolean>;
@Prop isEditMode: boolean;
@Link @Watch('onClickIndexChanged') clickIndex: number;
@Link @Watch('onClickIndexChanged') clickIndex: Number;
@State isExpanded: boolean = false;
@Consume overAllProgressChanged: boolean;
@State sliderMode: number = CommonConstants.DEFAULT_SLIDER_MODE;
@State sliderMode: Number = CommonConstants.DEFAULT_SLIDER_MODE;
private index: number;
aboutToAppear() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -69,7 +69,7 @@ export class DataModel {
/**
* Get the latest progress.
*/
getLatestProgressValue(): number {
getLatestProgressValue(): Number {
if (this.targetData.length === 0) {
return 0;
}

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -21,7 +21,7 @@ import DataModel from '../viewmodel/DataModel';
*
* @param progress progress value saved.
*/
export function changeProgress(progress: number) {
export function changeProgress(progress: Number) {
this.latestProgress = progress;
this.updateDate = getCurrentTime();
let result = DataModel.updateProgress(this.index, this.latestProgress, this.updateDate);

View File

@ -1,10 +1,10 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License,Version 2.0 (the "License");
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,

View File

@ -38,7 +38,7 @@ export default class DateTimeUtil {
* 0
* @param value-
*/
fill(value: number) {
fill(value: Number) {
return (value > 9 ? '' : '0') + value
}
@ -48,7 +48,7 @@ export default class DateTimeUtil {
* @param month
* @param date
*/
concatDate(year: number, month: number, date: number) {
concatDate(year: Number, month: Number, date: Number) {
return `${year}${this.fill(month)}${this.fill(date)}`
}
@ -58,7 +58,7 @@ export default class DateTimeUtil {
* @param minutes
* @param seconds
*/
concatTime(hours: number, minutes: number, seconds: number) {
concatTime(hours: Number, minutes: Number, seconds: Number) {
return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}`
}
}

View File

@ -22,7 +22,7 @@ import hilog from '@ohos.hilog'
*/
class Logger {
private domain: number
private domain: Number
private prefix: string
private format: string = "%{public}s, %{public}s"

View File

@ -0,0 +1,131 @@
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Logger from './Logger'
import prompt from '@ohos.prompt';
export class WebObject {
controller: WebController;
isRegistered: boolean;
constructor(controller: WebController, isRegistered: boolean) {
this.controller = controller
this.isRegistered = isRegistered
}
}
@Observed
class WebKey {
key: number;
timestamp: Number;
constructor(key: number, timestamp: Number) {
this.key = key
this.timestamp = timestamp
}
}
export enum LoadingStatus {
LOADING,
END
}
const TAG: string = '[browser]'
export class Browser {
inputValue: string = ""
tabArrayIndex: number = 0
progress: number = 0
hideProgress: boolean = true
loadingStatus: LoadingStatus = LoadingStatus.END
webArray: Array<WebKey> = [new WebKey(0, new Date().getTime())]
tabsController: TabsController = new TabsController()
webControllerArray: Array<WebObject> = [new WebObject(new WebController(), false)]
deleteTab(index: number) {
console.log(TAG, `delete before tab index= ${index} controller length ${this.webControllerArray.length} tabArrayIndex= ${this.tabArrayIndex}`)
this.webArray.splice(index, 1)
this.webControllerArray.splice(index, 1)
if (this.tabArrayIndex > index || this.tabArrayIndex === this.webArray.length) {
this.tabArrayIndex -= 1
}
for (let i = index;i < this.webArray.length; ++i) {
this.webArray[i].key -= 1
}
for (let i = 0;i < this.webArray.length; ++i) {
console.log(TAG, `key ${this.webArray[i].key}, time=${this.webArray[i].timestamp}`)
}
console.log(`delete after tab index=${index}, controller length=${this.webControllerArray.length}, tabArrayIndex=${this.tabArrayIndex}`)
this.tabsController.changeIndex(this.tabArrayIndex)
}
getWebArray() {
return this.webArray
}
addTab() {
if (this.webArray.length > 10) {
prompt.showToast({
message: '页签数量已满'
})
return;
}
let webController: WebController = new WebController();
let object = new WebObject(webController, false)
this.webControllerArray.push(object)
this.webArray.push(new WebKey(this.webArray.length, new Date().getTime()))
this.tabArrayIndex = this.webArray.length - 1
console.log(TAG, `add tab index= ${this.tabArrayIndex}`)
setTimeout(() => {
this.tabsController.changeIndex(this.tabArrayIndex)
}, 50)
}
setTabArrayIndex(tabArrayIndex: number) {
this.tabArrayIndex = tabArrayIndex
}
getTabArrayIndex() {
return this.tabArrayIndex
}
setInputVal(inputValue: string) {
this.inputValue = inputValue
}
getInputVal() {
return this.inputValue
}
loadUrl(addr: string) {
addr = "https://" + addr;
this.webControllerArray[this.tabArrayIndex].controller.loadUrl({ url: addr })
}
Back() {
if (this.webControllerArray[this.tabArrayIndex].controller.accessBackward()) {
this.webControllerArray[this.tabArrayIndex].controller.backward()
}
}
Forward() {
if (this.webControllerArray[this.tabArrayIndex].controller.accessForward()) {
this.webControllerArray[this.tabArrayIndex].controller.forward()
}
}
Refresh() {
this.webControllerArray[this.tabArrayIndex].controller.refresh()
}
}

View File

@ -18,9 +18,9 @@
import prompt from '@system.prompt';
import Router from '@system.router';
import wifi from '@ohos.wifi';
import ConfigData from "../../Utils/ConfigData"
import LogData from "../../Utils/LogData"
import MessageData from "../../Utils/MessageData"
import ConfigData from "../../utils/ConfigData"
import LogData from "../../utils/LogData"
import MessageData from "../../utils/MessageData"
const TAG = "[hotspotInterface]"
/**
@ -138,7 +138,7 @@ export function testSetHotspotConfig(): string {
ssid = AppStorage.Get( "h_ssid" )
// let securityType=AppStorage.Get("h_securityType")
// let band = AppStorage.Get("h_band")
// preSharedKey = AppStorage.Get("h_preSharedKey")
preSharedKey = AppStorage.Get( "h_preSharedKey" )
// let maxConn = AppStorage.Get("h_maxConn")
// let channel = AppStorage.Get("h_channel")
let hotspotConfigs = {
@ -169,6 +169,8 @@ export function testGetHotspotConfig(): string {
let ret = wifi.getHotspotConfig()
message = "HotspotConfig: " + JSON.stringify( ret )
console.log( TAG , "HotspotConfig is: " + JSON.stringify( ret ) )
let hotspotSsid = ret.ssid
AppStorage.setOrCreate( "hotspotSsid" , hotspotSsid )
let getHotspotConfigMessage = JSON.stringify( ret )
AppStorage.SetOrCreate( "getHotspotConfigMessage" , getHotspotConfigMessage )
prompt.showToast( { message : message } )

View File

@ -19,9 +19,9 @@ import prompt from '@system.prompt';
import Router from '@system.router';
import wifiManager from '@ohos.wifiManager';
import ConfigData from "../../Utils/ConfigData"
import LogData from "../../Utils/LogData"
import MessageData from "../../Utils/MessageData"
import ConfigData from "../../utils/ConfigData"
import LogData from "../../utils/LogData"
import MessageData from "../../utils/MessageData"
const TAG = "[hotspotManagerInterface]"
/**
@ -134,7 +134,7 @@ export function testSetHotspotConfigManager(): string {
ssid = AppStorage.Get( "h_ssid1" )
// let securityType=AppStorage.Get("h_securityType1")
// let band = AppStorage.Get("h_band1")
// let preSharedKey = AppStorage.Get("h_preSharedKey1")
preSharedKey = AppStorage.Get("h_preSharedKey1")
// let maxConn = AppStorage.Get("h_maxConn1")
let config = {
ssid : ssid ,
@ -163,6 +163,8 @@ export function testGetHotspotConfigManager(): string {
let message = "getHotspotConfig test"
let ret = wifiManager.getHotspotConfig()
message = "HotspotConfig is " + JSON.stringify( ret )
let hotspotManagerSsid = ret.ssid
AppStorage.setOrCreate( "hotspotManagerSsid" , hotspotManagerSsid )
console.log( TAG , "HotspotConfig is" + JSON.stringify( ret ) )
let getHotspotConfigManagerMessage = JSON.stringify( ret )
AppStorage.SetOrCreate( "getHotspotConfigManagerMessage" , getHotspotConfigManagerMessage )

View File

@ -18,12 +18,13 @@
import prompt from '@system.prompt';
import Router from '@system.router';
import wifi from '@ohos.wifi';
import ConfigData from "../../Utils/ConfigData"
import LogData from "../../Utils/LogData"
import MessageData from "../../Utils/MessageData"
import ConfigData from "../../utils/ConfigData"
import LogData from "../../utils/LogData"
import MessageData from "../../utils/MessageData"
const PAGE_URI_P2P_FOUND_MODE = 'pages/subManualApiTest/subP2pTest/p2pFound';
const TAG = "[p2pInterface]"
/**
* p2p Test Page Of Wifi test
*/
@ -174,7 +175,7 @@ export function testGetP2pPeerDevicesCallback() {
console.log( TAG , LogData.testGetP2pPeerDevicesCallback_EndLog );
prompt.showToast( { message : message } )
let len = Object.keys( WifiP2pDevice ).length;
for ( let i = 0 ; i < len ; ++i ) {
for ( let i = 0 ; i < len ; ++ i ) {
if ( WifiP2pDevice[ i ].deviceName === "MyTestDevice" ) {
console.log( TAG , "p2p connect to test device: " + WifiP2pDevice[ i ].deviceAddress );
let config = {
@ -342,6 +343,7 @@ export function testSetDeviceName( deviceName: string ): string {
let ret = wifi.setDeviceName( deviceName )
message = "设置:" + ret + ",设备名称为:" + deviceName;
console.log( TAG , "设置:" + ret + ",设备名称为:" + deviceName );
AppStorage.setOrCreate( "p2pDeviceName" , deviceName )
prompt.showToast( { message : message } )
console.log( TAG , LogData.testSetDeviceName_EndLog );
return message
@ -493,10 +495,10 @@ export function testOnP2pDeviceChange(): string {
}
console.log( TAG , "info:" + JSON.stringify( data ) )
message = "deviceName: " + deviceName + "\n" +
"deviceAddress: " + deviceAddress + "\n" +
"primaryDeviceType: " + primaryDeviceType + "\n" +
"deviceStatus: " + p2pDeviceStatusMessage + "\n" +
"groupCapabilitys: " + groupCapabilitys + "\n"
"deviceAddress: " + deviceAddress + "\n" +
"primaryDeviceType: " + primaryDeviceType + "\n" +
"deviceStatus: " + p2pDeviceStatusMessage + "\n" +
"groupCapabilitys: " + groupCapabilitys + "\n"
AppStorage.SetOrCreate( "p2pDeviceMessage" , message )
prompt.showToast( { message : message } )
console.log( TAG , LogData.testOnP2pDeviceChange_EndLog )

View File

@ -18,9 +18,9 @@
import prompt from '@system.prompt';
import Router from '@system.router';
import wifiManager from '@ohos.wifiManager';
import ConfigData from "../../Utils/ConfigData"
import LogData from "../../Utils/LogData"
import MessageData from "../../Utils/MessageData"
import ConfigData from "../../utils/ConfigData"
import LogData from "../../utils/LogData"
import MessageData from "../../utils/MessageData"
const TAG = "[p2pManagerInterface]"
/**
@ -377,6 +377,8 @@ export function testSetP2pDeviceNameManager(): string {
let ret = wifiManager.setP2pDeviceName( devName )
// setP2pDeviceName的返回值为void
// message = "setDeviceName: " + ret
let p2pManagerDeviceName = devName
AppStorage.setOrCreate( "p2pManagerDeviceName" , p2pManagerDeviceName )
message = "setP2pDeviceName 调用成功"
prompt.showToast( { message : message } )
return message
@ -524,10 +526,10 @@ export function testOnP2pDeviceChangeManager(): string {
}
console.log( TAG , "info:" + JSON.stringify( data ) )
message = "deviceName: " + deviceName + "\n" +
"deviceAddress: " + deviceAddress + "\n" +
"primaryDeviceType: " + primaryDeviceType + "\n" +
"deviceStatus: " + p2pDeviceStatusMessage + "\n" +
"groupCapabilitys: " + groupCapabilitys + "\n"
"deviceAddress: " + deviceAddress + "\n" +
"primaryDeviceType: " + primaryDeviceType + "\n" +
"deviceStatus: " + p2pDeviceStatusMessage + "\n" +
"groupCapabilitys: " + groupCapabilitys + "\n"
prompt.showToast( { message : message } )
} )
message = "打开注册WLAN连接状态变化"

View File

@ -1379,6 +1379,41 @@ const TestComposition: any[] = [
'image' : $r( 'app.media.WLAN' ) ,
'category' : Category.API
},
{
'name' : 'WiFiSwitchStabilityTest' ,
'detail' : 'WiFi开关稳定性测试' ,
'url' : 'pages/subStabilityTest/wifiSwitchStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WiFiScanStabilityTest' ,
'detail' : 'WiFi搜索稳定性测试' ,
'url' : 'pages/subStabilityTest/wifiScanStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WiFiConnectStabilityTest' ,
'detail' : 'WiFi连接稳定性测试' ,
'url' : 'pages/subStabilityTest/wifiConnectStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'HotspotStabilityTest' ,
'detail' : '热点稳定性测试' ,
'url' : 'pages/subStabilityTest/hotspotStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WebLatencyTest' ,
'detail' : '网页时延测试' ,
'url' : 'pages/subStabilityTest/webLatencyTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WifiAutoTest' ,
'detail' : 'wifi自动测试' ,
@ -1463,27 +1498,6 @@ const TestComposition: any[] = [
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Scenario
},
{
'name' : 'WiFiSwitchStabilityTest' ,
'detail' : 'WiFi开关稳定性测试' ,
'url' : 'pages/subStabilityTest/wifiSwitchStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WiFiScanStabilityTest' ,
'detail' : 'WiFi搜索稳定性测试' ,
'url' : 'pages/subStabilityTest/wifiScanStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WiFiConnectStabilityTest' ,
'detail' : 'WiFi连接稳定性测试' ,
'url' : 'pages/subStabilityTest/wifiConnectStabilityTest' ,
'image' : $r( 'app.media.ScenarioTest' ) ,
'category' : Category.Stability
},
{
'name' : 'WifiBenchmarkTest' ,
'detail' : 'Wifi性能测试' ,

View File

@ -18,8 +18,8 @@
import prompt from '@system.prompt';
import Router from '@system.router';
import wifi from '@ohos.wifi';
import LogData from "../../Utils/LogData"
import MessageData from "../../Utils/MessageData"
import LogData from "../../utils/LogData"
import MessageData from "../../utils/MessageData"
const TAG = "[wifiInterface]";
/**

View File

@ -18,8 +18,8 @@
import prompt from '@system.prompt';
import Router from '@system.router';
import wifiManager from '@ohos.wifiManager';
import LogDataManager from "../../Utils/LogDataManager"
import MessageDataManager from "../../Utils/MessageDataManager"
import LogDataManager from "../../utils/LogDataManager"
import MessageDataManager from "../../utils/MessageDataManager"
const TAG = "[wifiManagerInterface]";
/**
@ -278,7 +278,7 @@ export function testRemoveCandidateConfigManagerPromise() {
if ( !wifiManagerEnable ) {
message = ( MessageDataManager.testIsInactive );
} else {
let networkId: number = AppStorage.Get( "w_networkIdM" )
let networkId: Number = AppStorage.Get( "w_networkIdM" )
wifiManager.removeCandidateConfig( networkId ).then( result => {
// @returns Returns {@code true} if the Candidate hotspot configuration is removed, returns {@code false} otherwise.
console.log( TAG , LogDataManager.testRemoveCandidateConfigPromiseManager_successfulLog )
@ -307,7 +307,7 @@ export function testRemoveCandidateConfigManagerCallback() {
if ( !wifiManagerEnable ) {
message = ( MessageDataManager.testIsInactive );
} else {
let networkId: number = AppStorage.Get( "w_networkIdM" )
let networkId: Number = AppStorage.Get( "w_networkIdM" )
wifiManager.removeCandidateConfig( networkId , ( err , result ) => {
// @returns Returns {@code true} if the Candidate hotspot configuration is removed, returns {@code false} otherwise.
if ( err ) {
@ -378,7 +378,7 @@ export function testConnectToNetworkManager() {
try {
let message = ( MessageDataManager.testConnectToNetwork )
console.log( TAG , LogDataManager.testConnectToNetworkManager_StartLog )
let networkId: number = AppStorage.Get( "w_networkIdM" )
let networkId: Number = AppStorage.Get( "w_networkIdM" )
if ( !wifiManagerEnable ) {
message = ( MessageDataManager.testIsInactive );
} else {
@ -455,8 +455,8 @@ export function testGetSignalLevelManager() {
if ( !wifiManagerEnable ) {
message = ( MessageDataManager.testIsInactive )
} else {
let rssi: number = AppStorage.Get( "w_rssi1" )
let band: number = AppStorage.Get( "w_band1" )
let rssi: Number = AppStorage.Get( "w_rssi1" )
let band: Number = AppStorage.Get( "w_band1" )
let number = wifiManager.getSignalLevel( rssi , band )
message = "getSignalLevel is: " + number
console.log( TAG , "getSignalLevel is: " + number )

View File

@ -15,8 +15,8 @@
// @ts-nocheck
import { Category , TestData } from '../MainAbility/model/testData'
import { initTestData } from '../MainAbility/model/testDataModels'
import { Category , TestData } from '../entryability/model/testData'
import { initTestData } from '../entryability/model/testDataModels'
import { MainPageTitle } from '../Component/mainPageTitle';
import { ManualApiTest } from '../Component/manualApiTestComponent';
import { ManualSceneTest } from '../Component/manualSceneTest';
@ -25,7 +25,7 @@ import { AppTest } from '../Component/appTest';
import { StabilityTest } from "../Component/stabilityTest"
import { BenchmarkTest } from '../Component/benchmarkTest';
import { StressTest } from "../Component/stressTest"
import ConfigData from '../Utils/ConfigData';
import ConfigData from '../utils/ConfigData';
const TAG = '[homePage]'
@ -42,11 +42,15 @@ struct TestCategory {
Tabs() {
TabContent() {
AppTest( { testItems : this.testItems.filter( item => ( item.category === Category.App ) ) } )
}.tabBar( $r( "app.string.App" ) ).margin( { top : $r( "app.float.distance_20" ) } )
}.tabBar( $r( "app.string.App" ) ).margin( { top : $r( "app.float.distance_5" ) } )
TabContent() {
ManualApiTest( { testItems : this.testItems.filter( item => ( item.category === Category.API ) ) } )
}.tabBar( $r( "app.string.api" ) ).margin( { top : $r( "app.float.distance_20" ) } )
}.tabBar( $r( "app.string.api" ) ).margin( { top : $r( "app.float.distance_5" ) } )
TabContent() {
StabilityTest( { testItems : this.testItems.filter( item => ( item.category === Category.Stability ) ) } )
}.tabBar( $r( "app.string.stability" ) ).margin( { top : $r( "app.float.distance_5" ) } )
TabContent() {
AutoTest( { testItems : this.testItems.filter( item => ( item.category === Category.AutoTest ) ) } )
@ -56,10 +60,6 @@ struct TestCategory {
ManualSceneTest( { testItems : this.testItems.filter( item => ( item.category === Category.Scenario ) ) } )
}.tabBar( $r( "app.string.scenario" ) ).margin( { top : $r( "app.float.distance_5" ) } )
TabContent() {
StabilityTest( { testItems : this.testItems.filter( item => ( item.category === Category.Stability ) ) } )
}.tabBar( $r( "app.string.stability" ) ).margin( { top : $r( "app.float.distance_5" ) } )
TabContent() {
BenchmarkTest( { testItems : this.testItems.filter( item => ( item.category === Category.BenchMark ) ) } )
}.tabBar( $r( "app.string.benchmark" ) ).margin( { top : $r( "app.float.distance_5" ) } )

View File

@ -18,12 +18,12 @@
import featureAbility from '@ohos.ability.featureAbility'
import wifi from '@ohos.wifi'
import { AvailableP2p } from '../../Component/availableP2p'
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import router from '@system.router';
import { P2pTitleBar } from '../../Component/p2pTitleBar'
import { PageTitle } from '../../Component/pageTitle'
import { TestImageDisplay } from '../../Component/testImageDisplay'
import { P2pModel } from '../../MainAbility/model/p2pModel'
import { P2pModel } from '../../entryability/model/p2pModel'
const TAG = '[p2pScan]'
const PERMISSION_P2P_NAME: string = 'ohos.permission.LOCATION'
@ -36,7 +36,7 @@ struct P2pFound {
private p2pModel: P2pModel = new P2pModel()
private testItem: TestData = router.getParams().testId;
// private testItem: string = "p2p扫描"
@State p2pLinkedInfo: any = {
private p2pLinkedInfo: any = {
deviceName : "" ,
deviceAddress : "" ,
groupOwnerAddr : "" ,

View File

@ -18,20 +18,22 @@
import wifi from '@ohos.wifi'
import { TitleBar } from '../../Component/titleBar'
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { WifiModel } from '../../MainAbility/model/wifiModel'
import ConfigData from '../../Utils/ConfigData';
import { TestData } from '../../entryability/model/testData'
import { WifiModel } from '../../entryability/model/wifiModel'
import ConfigData from '../../utils/ConfigData';
import wifiManager from '@ohos.wifiManager'
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { PageTitle } from '../../Component/pageTitle';
import TargetInformation from '../../MainAbility/candidateWifiModel/view/TargetInformation';
import TargetList from '../../MainAbility/candidateWifiModel/view/TargetList';
import { CommonConstants } from '../../MainAbility/candidateWifiModel/common/constant/CommonConstant';
import DataModel from '../../MainAbility/candidateWifiModel/viewmodel/DataModel';
import AddTargetDialog from '../../MainAbility/candidateWifiModel/view/AddTargetDialog';
import { saveTask } from '../../MainAbility/candidateWifiModel/viewmodel/MainPageModel';
import getCurrentTime from '../../MainAbility/candidateWifiModel/common/utils/DateUtil';
import TargetInformation from '../../entryability/candidateWifiModel/view/TargetInformation';
import TargetList from '../../entryability/candidateWifiModel/view/TargetList';
import { CommonConstants } from '../../entryability/candidateWifiModel/common/constant/CommonConstant';
import DataModel from '../../entryability/candidateWifiModel/viewmodel/DataModel';
import AddTargetDialog from '../../entryability/candidateWifiModel/view/AddTargetDialog';
import { saveTask } from '../../entryability/candidateWifiModel/viewmodel/MainPageModel';
import getCurrentTime from '../../entryability/candidateWifiModel/common/utils/DateUtil';
import TargetListItem from '../../entryability/candidateWifiModel/view/TargetListItem';
import TargetInformation from '../../entryability/candidateWifiModel/view/TargetInformation';
const TAG = '[wifiCandidate]'
@ -44,8 +46,8 @@ struct WifiCandidate {
@State targetData: Array<TaskItemBean> = DataModel.getData();
private wifiModel: WifiModel = new WifiModel()
private testItem: TestData = router.getParams().testId;
@State totalTasksNumber: number = 0;
@State completedTasksNumber: number = 0;
@State totalTasksNumber: Number = 0;
@State completedTasksNumber: Number = 0;
@State latestUpdateDate: string = CommonConstants.DEFAULT_PROGRESS_VALUE;
@Provide @Watch('onProgressChanged') overAllProgressChanged: boolean = false;
dialogController: CustomDialogController = new CustomDialogController({

View File

@ -18,7 +18,7 @@
import wifi from '@ohos.wifi'
import { AvailableWifi } from '../../Component/availableWifi'
import { TitleBar } from '../../Component/titleBar'
import { WifiModel } from '../../MainAbility/model/wifiModel'
import { WifiModel } from '../../entryability/model/wifiModel'
const TAG = '[wifiScan]'
@ -30,7 +30,7 @@ const TAG = '[wifiScan]'
struct WifiScan {
private wifiModel: WifiModel = new WifiModel()
private testItem: string = "Wlan扫描"
@State linkedInfo: any = {
private linkedInfo: any = {
ssid : "" ,
bssid : "" ,
networkId : 0 ,

View File

@ -15,14 +15,14 @@
// @ts-nocheck
import ConfigData from '../../Utils/ConfigData';
import ConfigData from '../../utils/ConfigData';
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import { PageTitle } from '../../Component/pageTitle';
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { HotspotAutoTestCase , initHotspotAutoData } from '../../MainAbility/model/autoTestDataModels'
import { HotspotAutoTestCase , initHotspotAutoData } from '../../entryability/model/autoTestDataModels'
import { AutoContentTable } from '../../Component/autoContentTable'
import * as hotspotInterface from '../../MainAbility/model/hotspotInterface'
import * as hotspotInterface from '../../entryability/model/hotspotInterface'
import prompt from '@system.prompt';
import emitter from '@ohos.events.emitter'
@ -36,15 +36,15 @@ struct HotspotAutoTest {
// @State textMessage: string = 'null';
// @State testState: boolean = false;
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// @State autoTextMessage: string ="None";
@StorageLink( "hotspotAutoTestMessage" ) hotspotAutoTestMessage: string = ""
@State h_ssid: string = "testApp1";
@State h_securityType: number = 3;
@State h_band: number = 2;
@State h_securityType: Number = 3;
@State h_band: Number = 2;
@State h_preSharedKey: string = "12345678";
@State h_maxConn: number = 3 ;
@State h_channel: number = 36 ;
@State h_maxConn: Number = 3 ;
@State h_channel: Number = 36 ;
aboutToAppear() {
AppStorage.SetOrCreate( "h_ssid" , this.h_ssid )

View File

@ -15,14 +15,14 @@
// @ts-nocheck
import ConfigData from '../../Utils/ConfigData';
import ConfigData from '../../utils/ConfigData';
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import { PageTitle } from '../../Component/pageTitle';
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { HotspotManagerAutoTestCase , initHotspotManagerAutoData } from '../../MainAbility/model/autoTestDataModels'
import { HotspotManagerAutoTestCase , initHotspotManagerAutoData } from '../../entryability/model/autoTestDataModels'
import { AutoContentTable } from '../../Component/autoContentTable'
import * as hotspotManagerInterface from '../../MainAbility/model/hotspotManagerInterface'
import * as hotspotManagerInterface from '../../entryability/model/hotspotManagerInterface'
import prompt from '@system.prompt';
import emitter from '@ohos.events.emitter'
@ -36,15 +36,15 @@ struct HotspotManagerAutoTest {
// @State textMessage: string = 'null';
// @State testState: boolean = false;
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// @State autoTextMessage: string ="None";
@StorageLink( "hotspotManagerAutoTestMessage" ) hotspotManagerAutoTestMessage: string = ""
@State h_ssid1: string = "testApp1";
@State h_securityType1: number = 3;
@State h_band1: number = 2;
@State h_securityType1: Number = 3;
@State h_band1: Number = 2;
@State h_preSharedKey1: string = "12345678";
@State h_maxConn1: number = 3 ;
@State h_channel1: number = 36 ;
@State h_maxConn1: Number = 3 ;
@State h_channel1: Number = 36 ;
aboutToAppear() {
AppStorage.SetOrCreate( "h_ssid1" , this.h_ssid1 )

View File

@ -15,14 +15,14 @@
// @ts-nocheck
import ConfigData from '../../Utils/ConfigData';
import ConfigData from '../../utils/ConfigData';
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import { PageTitle } from '../../Component/pageTitle';
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { P2pAutoTestCase , initP2pAutoData } from '../../MainAbility/model/autoTestDataModels'
import { P2pAutoTestCase , initP2pAutoData } from '../../entryability/model/autoTestDataModels'
import { AutoContentTable } from '../../Component/autoContentTable'
import * as p2pInterface from '../../MainAbility/model/p2pInterface'
import * as p2pInterface from '../../entryability/model/p2pInterface'
import prompt from '@system.prompt';
import emitter from '@ohos.events.emitter'
@ -37,14 +37,14 @@ struct P2pAutoTest {
// @State textMessage: string = 'null';
// @State testState: boolean = false;
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// @State autoTextMessage: string ="None";
@StorageLink( "p2pAutoTestMessage" ) p2pAutoTestMessage: string = ""
@State deviceAddress: string = '6c:96:d7:3d:87:6f';
@State netId: number = - 2 ;
@State netId: Number = - 2 ;
@State passphrase: string = "12345678" ;
@State groupName: string = "testGroup"
@State goBand: number = 0 ;
@State goBand: Number = 0 ;
@State deviceName: string = "MyTestDevice"
aboutToAppear() {

View File

@ -14,15 +14,15 @@
*/
// @ts-nocheck
import ConfigData from '../../Utils/ConfigData';
import ConfigData from '../../utils/ConfigData';
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import { PageTitle } from '../../Component/pageTitle';
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { P2pManagerAutoTestCase , initP2pManagerAutoData } from '../../MainAbility/model/autoTestDataModels'
import { P2pManagerAutoTestCase , initP2pManagerAutoData } from '../../entryability/model/autoTestDataModels'
import { AutoContentTable } from '../../Component/autoContentTable'
import * as P2pManagerInterface from '../../MainAbility/model/p2pManagerInterface'
import * as P2pManagerInterface from '../../entryability/model/p2pManagerInterface'
import prompt from '@system.prompt';
import emitter from '@ohos.events.emitter'
@ -37,14 +37,14 @@ struct P2pManagerAutoTest {
// @State textMessage: string = 'null';
// @State testState: boolean = false;
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// @State autoTextMessage: string ="None";
@StorageLink( "p2pManagerAutoTestMessage" ) p2pManagerAutoTestMessage: string = ""
@State deviceAddressManager: string = '6c:96:d7:3d:87:6f';
@State netIdManager: number = - 2 ;
@State netIdManager: Number = - 2 ;
@State passphraseManager: string = "12345678" ;
@State groupNameManager: string = "testGroup"
@State goBandManager: number = 0 ;
@State goBandManager: Number = 0 ;
@State devNameManager: string = "MyTestDevice"
aboutToAppear() {

View File

@ -15,15 +15,15 @@
// @ts-nocheck
import ConfigData from '../../Utils/ConfigData';
import ConfigData from '../../utils/ConfigData';
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import { PageTitle } from '../../Component/pageTitle';
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { WifiAutoTestCase , initWifiAutoData } from '../../MainAbility/model/autoTestDataModels'
import { WifiAutoTestCase , initWifiAutoData } from '../../entryability/model/autoTestDataModels'
import { AutoContentTable } from '../../Component/autoContentTable'
import * as wifiInterface from '../../MainAbility/model/wifiInterface'
import * as wifiInterface from '../../entryability/model/wifiInterface'
import prompt from '@system.prompt';
import emitter from '@ohos.events.emitter'
@ -38,26 +38,26 @@ struct WifiAutoTest {
// @State textMessage: string = 'null';
// @State testState: boolean = false;
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// @State autoTextMessage: string ="None";
@StorageLink( "wifiAutoTestMessage" ) wifiAutoTestMessage: string = ""
@State w_ssid: string = "TP-LINK_6365";
@State w_bssid: string = "6C:B1:58:75:63:65";
@State w_preSharedKey: string = "12345678";
@State w_isHiddenSsid: boolean = false;
@State w_securityType: number = 3
@State w_creatorUid: number = 1;
@State w_disableReason: number = 0;
@State w_netId: number = 100 ;
@State w_randomMacType: number = 0 ;
@State w_securityType: Number = 3
@State w_creatorUid: Number = 1;
@State w_disableReason: Number = 0;
@State w_netId: Number = 100 ;
@State w_randomMacType: Number = 0 ;
@State w_randomMacAddr: string = "08:fb:ea:1b:38:aa"
@State w_ipType: number = 1 ;
@State w_staticIp_ipAddress: number = 3232235880 ;
@State w_staticIp_gateway: number = 3232235777 ;
@State w_staticIp_dnsServers: number = 3716386629 ;
@State w_ipType: Number = 1 ;
@State w_staticIp_ipAddress: Number = 3232235880 ;
@State w_staticIp_gateway: Number = 3232235777 ;
@State w_staticIp_dnsServers: Number = 3716386629 ;
@State w_staticIp_domains: Array<string> = [ "0", "1", "2" ] ;
@State w_networkId: number = 0 ; // id,netId,networkId是一个值嘛
@State w_featureId: number = 1 ;
@State w_networkId: Number = 0 ; // id,netId,networkId是一个值嘛
@State w_featureId: Number = 1 ;
aboutToAppear() {
AppStorage.SetOrCreate( 'w_ssid' , this.w_ssid );

View File

@ -14,14 +14,14 @@
*/
// @ts-nocheck
import ConfigData from '../../Utils/ConfigData';
import ConfigData from '../../utils/ConfigData';
import router from '@system.router';
import { TestData } from '../../MainAbility/model/testData'
import { TestData } from '../../entryability/model/testData'
import { PageTitle } from '../../Component/pageTitle';
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { WifiManagerAutoTestCase , initWifiManagerAutoData } from '../../MainAbility/model/autoTestDataModels'
import { WifiManagerAutoTestCase , initWifiManagerAutoData } from '../../entryability/model/autoTestDataModels'
import { AutoContentTable } from '../../Component/autoContentTable'
import * as WifiManagerInterface from '../../MainAbility/model/wifiManagerInterface'
import * as WifiManagerInterface from '../../entryability/model/wifiManagerInterface'
import prompt from '@system.prompt';
import emitter from '@ohos.events.emitter'
@ -35,26 +35,26 @@ struct WifiManagerAutoTest {
// @State textMessage: string = 'null';
// @State testState: boolean = false;
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
// @State autoTextMessage: string ="None";
@StorageLink( "wifiManagerAutoTestMessage" ) wifiManagerAutoTestMessage: string = ""
@State w_ssid1: string = "TP-LINK_6365";
@State w_bssid1: string = "6C:B1:58:75:63:65";
@State w_preSharedKey1: string = "12345678";
@State w_isHiddenSsid1: boolean = false;
@State w_securityType1: number = 3;
@State w_creatorUid1: number = 1;
@State w_disableReason1: number = 0;
@State w_netId1: number = 0 ;
@State w_randomMacType1: number = 0 ;
@State w_securityType1: Number = 3;
@State w_creatorUid1: Number = 1;
@State w_disableReason1: Number = 0;
@State w_netId1: Number = 0 ;
@State w_randomMacType1: Number = 0 ;
@State w_randomMacAddr1: string = "08:fb:ea:1b:38:aa"
@State w_ipType1: number = 1 ;
@State w_staticIp_ipAddress1: number = 3232235880 ;
@State w_staticIp_gateway1: number = 3232235777 ;
@State w_staticIp_dnsServers1: number = 3716386629 ;
@State w_ipType1: Number = 1 ;
@State w_staticIp_ipAddress1: Number = 3232235880 ;
@State w_staticIp_gateway1: Number = 3232235777 ;
@State w_staticIp_dnsServers1: Number = 3716386629 ;
@State w_staticIp_domains1: Array<string> = [ "0", "1", "2" ] ;
@State w_networkIdM: number = 0 ;
@State w_featureIdM: number = 1 ;
@State w_networkIdM: Number = 0 ;
@State w_featureIdM: Number = 1 ;
aboutToAppear() {
AppStorage.SetOrCreate( 'w_ssid1' , this.w_ssid1 );

View File

@ -19,13 +19,13 @@ import prompt from '@ohos.prompt';
import router from '@system.router'
import { PageTitle } from '../../Component/pageTitle'
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { TestData } from '../../MainAbility/model/testData'
import { initHotspotBenchmarkData } from '../../MainAbility/model/benchmarkTestDataModels'
import * as HotspotInterface from '../../MainAbility/model/hotspotInterface'
import { HotspotBenchmarkTestCase } from '../../MainAbility/model/benchmarkTestDataModels'
import ConfigData from "../../Utils/ConfigData"
import { TestData } from '../../entryability/model/testData'
import { initHotspotBenchmarkData } from '../../entryability/model/benchmarkTestDataModels'
import * as HotspotInterface from '../../entryability/model/hotspotInterface'
import { HotspotBenchmarkTestCase } from '../../entryability/model/benchmarkTestDataModels'
import ConfigData from "../../utils/ConfigData"
import wifi from '@ohos.wifi';
import { resolveIP } from '../../Utils/Util'
import { resolveIP } from '../../utils/Util'
import socket from '@ohos.net.socket';
import http from '@ohos.net.http'
@ -59,7 +59,7 @@ struct HotspotBenchmarkTest {
@State showList: boolean = false;
@State message: string = 'hotspotBenchmarkTest';
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@StorageLink( "hotspotBenchmarkTestMessage" ) hotspotBenchmarkTestMessage: string = ""
// @State login_feng: boolean = false
// @State login_wen: boolean = false
@ -72,18 +72,18 @@ struct HotspotBenchmarkTest {
// @State warnText: string = ''
// @State roomNumber: string = ''
// @State receiveMsg: string = '待接收数据'
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []
@StorageLink( 'hotspotBenchmarkTime' ) hotspotBenchmarkTime: number = 0;
@StorageLink( 'hotspotBenchmarkTime' ) hotspotBenchmarkTime: Number = 0;
@State h_ssid: string = "testApp1";
@State h_securityType: number = 3;
@State h_band: number = 2;
@State h_securityType: Number = 3;
@State h_band: Number = 2;
@State h_preSharedKey: string = "12345678";
@State h_maxConn: number = 3 ;
@State h_channel: number = 36 ;
@State h_maxConn: Number = 3 ;
@State h_channel: Number = 36 ;
aboutToAppear() {
AppStorage.SetOrCreate( "h_ssid" , this.h_ssid )
@ -362,8 +362,8 @@ struct socketTest {
@Component
struct upDownLoad {
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []

View File

@ -19,14 +19,14 @@ import prompt from '@ohos.prompt';
import router from '@system.router'
import { PageTitle } from '../../Component/pageTitle'
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { TestData } from '../../MainAbility/model/testData'
import { initHotspotManagerBenchmarkData } from '../../MainAbility/model/benchmarkTestDataModels'
import * as HotspotManagerInterface from '../../MainAbility/model/hotspotManagerInterface'
import { HotspotManagerBenchmarkTestCase } from '../../MainAbility/model/benchmarkTestDataModels'
import ConfigData from "../../Utils/ConfigData"
import { TestData } from '../../entryability/model/testData'
import { initHotspotManagerBenchmarkData } from '../../entryability/model/benchmarkTestDataModels'
import * as HotspotManagerInterface from '../../entryability/model/hotspotManagerInterface'
import { HotspotManagerBenchmarkTestCase } from '../../entryability/model/benchmarkTestDataModels'
import ConfigData from "../../utils/ConfigData"
import wifi from '@ohos.wifi';
import wifiManager from '@ohos.wifiManager';
import { resolveIP } from '../../Utils/Util'
import { resolveIP } from '../../utils/Util'
import socket from '@ohos.net.socket';
import http from '@ohos.net.http'
@ -62,7 +62,7 @@ struct HotspotManagerBenchmarkTest {
@State showList: boolean = false;
@State message: string = 'hotspotManagerBenchmarkTest';
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@StorageLink( "hotspotManagerBenchmarkTestMessage" ) hotspotManagerBenchmarkTestMessage: string = ""
// @State login_feng: boolean = false
// @State login_wen: boolean = false
@ -75,18 +75,18 @@ struct HotspotManagerBenchmarkTest {
// @State warnText: string = ''
// @State roomNumber: string = ''
// @State receiveMsg: string = '待接收数据'
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []
@StorageLink( 'hotspotManagerBenchmarkTime' ) hotspotManagerBenchmarkTime: number = 0;
@StorageLink( 'hotspotManagerBenchmarkTime' ) hotspotManagerBenchmarkTime: Number = 0;
@State h_ssid1: string = "testApp1";
@State h_securityType1: number = 3;
@State h_band1: number = 2;
@State h_securityType1: Number = 3;
@State h_band1: Number = 2;
@State h_preSharedKey1: string = "12345678";
@State h_maxConn1: number = 3 ;
@State h_channel1: number = 36 ;
@State h_maxConn1: Number = 3 ;
@State h_channel1: Number = 36 ;
aboutToAppear() {
AppStorage.SetOrCreate( "h_ssid1" , this.h_ssid1 )
@ -366,8 +366,8 @@ struct socketTest {
@Component
struct upDownLoad {
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []

View File

@ -19,13 +19,13 @@ import prompt from '@ohos.prompt';
import router from '@system.router'
import { PageTitle } from '../../Component/pageTitle'
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { TestData } from '../../MainAbility/model/testData'
import { initP2pBenchmarkData } from '../../MainAbility/model/benchmarkTestDataModels'
import * as P2pInterface from '../../MainAbility/model/p2pInterface'
import { P2pBenchmarkTestCase } from '../../MainAbility/model/benchmarkTestDataModels'
import ConfigData from "../../Utils/ConfigData"
import { TestData } from '../../entryability/model/testData'
import { initP2pBenchmarkData } from '../../entryability/model/benchmarkTestDataModels'
import * as P2pInterface from '../../entryability/model/p2pInterface'
import { P2pBenchmarkTestCase } from '../../entryability/model/benchmarkTestDataModels'
import ConfigData from "../../utils/ConfigData"
import wifi from '@ohos.wifi';
import { resolveIP } from '../../Utils/Util'
import { resolveIP } from '../../utils/Util'
import socket from '@ohos.net.socket';
import http from '@ohos.net.http'
@ -59,7 +59,7 @@ struct P2PBenchmarkTest {
@State showList: boolean = false;
@State message: string = 'P2PBenchmarkTest';
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@StorageLink( "p2pBenchmarkTestMessage" ) p2pBenchmarkTestMessage: string = ""
// @State login_feng: boolean = false
// @State login_wen: boolean = false
@ -72,17 +72,17 @@ struct P2PBenchmarkTest {
// @State warnText: string = ''
// @State roomNumber: string = ''
// @State receiveMsg: string = '待接收数据'
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []
@StorageLink( 'p2pBenchmarkTime' ) p2pBenchmarkTime: number = 0;
@StorageLink( 'p2pBenchmarkTime' ) p2pBenchmarkTime: Number = 0;
@State deviceAddress: string = '6c:96:d7:3d:87:6f';
@State netId: number = - 2 ;
@State netId: Number = - 2 ;
@State passphrase: string = "12345678" ;
@State groupName: string = "testGroup"
@State goBand: number = 0 ;
@State goBand: Number = 0 ;
@State deviceName: string = "MyTestDevice"
aboutToAppear() {
@ -345,8 +345,8 @@ struct socketTest {
@Component
struct upDownLoad {
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []

View File

@ -19,14 +19,14 @@ import prompt from '@ohos.prompt';
import router from '@system.router'
import { PageTitle } from '../../Component/pageTitle'
import { TestImageDisplay } from '../../Component/testImageDisplay';
import { TestData } from '../../MainAbility/model/testData'
import { initP2pManagerBenchmarkData } from '../../MainAbility/model/benchmarkTestDataModels'
import * as WifiInterface from '../../MainAbility/model/wifiInterface'
import { P2pManagerBenchmarkTestCase } from '../../MainAbility/model/benchmarkTestDataModels'
import ConfigData from "../../Utils/ConfigData"
import { TestData } from '../../entryability/model/testData'
import { initP2pManagerBenchmarkData } from '../../entryability/model/benchmarkTestDataModels'
import * as WifiInterface from '../../entryability/model/wifiInterface'
import { P2pManagerBenchmarkTestCase } from '../../entryability/model/benchmarkTestDataModels'
import ConfigData from "../../utils/ConfigData"
import wifi from '@ohos.wifi';
import wifiManager from '@ohos.wifiManager';
import { resolveIP } from '../../Utils/Util'
import { resolveIP } from '../../utils/Util'
import socket from '@ohos.net.socket';
import http from '@ohos.net.http'
@ -62,7 +62,7 @@ struct P2PManagerBenchmarkTest {
@State showList: boolean = false;
@State message: string = 'P2pManagerBenchmarkTest';
private testItem: TestData = router.getParams().testId;
@State changeIndex: number = - 1
@State changeIndex: Number = - 1
@StorageLink( "p2pManagerBenchmarkTestMessage" ) p2pManagerBenchmarkTestMessage: string = ""
// @State login_feng: boolean = false
// @State login_wen: boolean = false
@ -75,17 +75,17 @@ struct P2PManagerBenchmarkTest {
// @State warnText: string = ''
// @State roomNumber: string = ''
// @State receiveMsg: string = '待接收数据'
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []
@StorageLink( 'p2pManagerBenchmarkTime' ) p2pManagerBenchmarkTime: number = 0;
@StorageLink( 'p2pManagerBenchmarkTime' ) p2pManagerBenchmarkTime: Number = 0;
@State deviceAddressManager: string = '6c:96:d7:3d:87:6f';
@State netIdManager: number = - 2 ;
@State netIdManager: Number = - 2 ;
@State passphraseManager: string = "12345678" ;
@State groupNameManager: string = "testGroup"
@State goBandManager: number = 0 ;
@State goBandManager: Number = 0 ;
@State devNameManager: string = "MyTestDevice"
aboutToAppear() {
@ -367,8 +367,8 @@ struct socketTest {
@Component
struct upDownLoad {
@State receivedSize: number = 0
@State totalSize: number = 0
@State receivedSize: Number = 0
@State totalSize: Number = 0
@State message: string = ''
@State files: Array<string> = []
@State uploads: Array<string> = []

Some files were not shown because too many files have changed in this diff Show More