Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4789f29a
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4789f29a
编写于
10月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6024 无障碍功能测试errorCode处理
Merge pull request !6024 from Mupceet/release_1022_xts_master
上级
985060db
c5eb63ce
变更
22
展开全部
隐藏空白更改
内联
并排
Showing
22 changed file
with
2105 addition
and
27 deletion
+2105
-27
barrierfree/accessibletest/BUILD.gn
barrierfree/accessibletest/BUILD.gn
+1
-0
barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/CaptionConfiguration.test.ets
...est/entry/src/main/ets/test/CaptionConfiguration.test.ets
+0
-27
barrierfree/accessibletest/actsgesturesimulationtest/AppScope/app.json
...ccessibletest/actsgesturesimulationtest/AppScope/app.json
+19
-0
barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/element/string.json
...imulationtest/AppScope/resources/base/element/string.json
+8
-0
barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/media/app_icon.png
...simulationtest/AppScope/resources/base/media/app_icon.png
+0
-0
barrierfree/accessibletest/actsgesturesimulationtest/BUILD.gn
...ierfree/accessibletest/actsgesturesimulationtest/BUILD.gn
+43
-0
barrierfree/accessibletest/actsgesturesimulationtest/Test.json
...erfree/accessibletest/actsgesturesimulationtest/Test.json
+29
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/Application/AbilityStage.ts
...lationtest/entry/src/main/ets/Application/AbilityStage.ts
+24
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/MainAbility.ts
...ulationtest/entry/src/main/ets/MainAbility/MainAbility.ts
+59
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/pages/index.ets
...lationtest/entry/src/main/ets/MainAbility/pages/index.ets
+235
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts
...entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts
+581
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/TestAbility.ts
...ulationtest/entry/src/main/ets/TestAbility/TestAbility.ts
+59
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/pages/index.ets
...lationtest/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/Ability.test.ets
...resimulationtest/entry/src/main/ets/test/Ability.test.ets
+797
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/List.test.ets
...sturesimulationtest/entry/src/main/ets/test/List.test.ets
+19
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/module.json
...test/actsgesturesimulationtest/entry/src/main/module.json
+68
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/element/string.json
...iontest/entry/src/main/resources/base/element/string.json
+24
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/media/icon.png
...mulationtest/entry/src/main/resources/base/media/icon.png
+0
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/accessibility_config.json
...src/main/resources/base/profile/accessibility_config.json
+8
-0
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+5
-0
barrierfree/accessibletest/actsgesturesimulationtest/signature/openharmony_sx.p7b
...st/actsgesturesimulationtest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
barrierfree/accessibletest/BUILD.gn
浏览文件 @
4789f29a
...
@@ -19,6 +19,7 @@ group("actsaccessibletest") {
...
@@ -19,6 +19,7 @@ group("actsaccessibletest") {
deps = [
deps = [
"actsabilitylisttest:ActsAbilityListTest",
"actsabilitylisttest:ActsAbilityListTest",
"actscaptionconfigurationtest:ActsCaptionConfigurationTest",
"actscaptionconfigurationtest:ActsCaptionConfigurationTest",
"actsgesturesimulationtest:ActsGestureSimulationTest",
"sceneProject/accessibilityAudibleAbility:accessibilityAudibleAbility",
"sceneProject/accessibilityAudibleAbility:accessibilityAudibleAbility",
"sceneProject/accessibilityGenericAbility:accessibilityGenericAbility",
"sceneProject/accessibilityGenericAbility:accessibilityGenericAbility",
"sceneProject/accessibilityHapticAbility:accessibilityHapticAbility",
"sceneProject/accessibilityHapticAbility:accessibilityHapticAbility",
...
...
barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/CaptionConfiguration.test.ets
浏览文件 @
4789f29a
...
@@ -389,33 +389,6 @@ export default function CaptionConfigurationTest() {
...
@@ -389,33 +389,6 @@ export default function CaptionConfigurationTest() {
}, 8000);
}, 8000);
});
});
/**
* @tc.number: CaptionConfiguration_0120
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/
it('CaptionConfiguration_0120', 1, async function (done) {
const caseName = "CaptionConfiguration_0120";
const logF = LOG + caseName;
registerOn = false;
setTimeout(() => {
CaptionConfigurationOn(caseName, undefined);
}, 1000);
setTimeout(() => {
excuteCase(caseName);
}, 2000);
setTimeout(() => {
var isSucceedTarget: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') != -1) {
isSucceedTarget = true;
}
expect(isSucceedTarget).assertEqual(true);
expect(registerOn).assertEqual(false);
console.info(logF + ' isSucceed : ' + (isSucceedTarget));
done();
}, 8000);
});
/**
/**
* @tc.number: CaptionConfiguration_0130
* @tc.number: CaptionConfiguration_0130
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
...
...
barrierfree/accessibletest/actsgesturesimulationtest/AppScope/app.json
0 → 100644
浏览文件 @
4789f29a
{
"app"
:
{
"bundleName"
:
"com.example.gesturesimulationtest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
4789f29a
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"GestureSimulationTest"
}
]
}
barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
4789f29a
6.6 KB
barrierfree/accessibletest/actsgesturesimulationtest/BUILD.gn
0 → 100644
浏览文件 @
4789f29a
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsGestureSimulationTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":accessible_js_assets",
":accessible_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsGestureSimulationTest"
subsystem_name = "barrierfree"
part_name = "accessibility"
}
ohos_app_scope("accessible_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("accessible_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("accessible_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":accessible_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
barrierfree/accessibletest/actsgesturesimulationtest/Test.json
0 → 100644
浏览文件 @
4789f29a
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"400000"
,
"bundle-name"
:
"com.example.gesturesimulationtest"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsGestureSimulationTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"param set persist.ace.testmode.enabled 1"
],
"teardown-command"
:[
"bm uninstall -n com.example.gesturesimulationtest"
]
}
]
}
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
info
(
"
[GestureSimulationTest] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
globalThis
.
stageContext
=
this
.
context
}
}
\ No newline at end of file
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/pages/index.ets
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import prompt from '@system.prompt'
import commonEvent from '@ohos.commonEvent'
const LOG_PREFIX = '[CQH-GESTURE-TARGET-1]'
const EVENT_NAME_BACK = 'on_target_change_extra'
const CommonEventSubscribeInfo = {
events: ['on_assist_change']
}
@Entry
@Component
struct Index {
@State message: string = 'GestureSimulationTest'
private caseCode: string = ''
private scroller: Scroller = new Scroller()
private context2D: CanvasRenderingContext2D = new CanvasRenderingContext2D()
private swiperController: SwiperController = new SwiperController()
private arr: string[] = ["列表文本1", "列表文本2", "列表文本3", "列表文本4", "列表文本5", "列表文本6", "列表文本7",
"列表文本8", "列表文本9", "列表文本10", "列表文本11", "列表文本12", "列表文本13", "列表文本14", "列表文本15", "列表文本16",
"列表文本17", "列表文本18", "列表文本19", "列表文本20", "列表文本21", "列表文本22", "列表文本23", "列表文本24", "列表文本25",
"列表文本26", "列表文本27", "列表文本28", "列表文本29", "列表文本30"]
private Number: String[] = ['1', '2', '3']
private minNum: number = 0
private maxNum: number = 0
private addNum: number = 0
private notEnd: boolean = true
@State paintSize: number= 5
@State paintColor: Color = Color.Orange
@State pathInfoArray: PathInfo[]= new Array()
private subScriber = undefined
aboutToAppear() {
console.info('TargetApp aboutToAppear')
this.createSubscriber()
}
aboutToDisappear() {
console.info('TargetApp aboutToDisappear')
commonEvent.unsubscribe(this.subScriber)
this.subScriber = undefined
}
@Builder
Canvas() {
ForEach(this.pathInfoArray, (pathInfo) => OnePath({ pathInfo: pathInfo }))
Stack()
.width('100%')
.height('100%')
.onTouch((event: TouchEvent) => {
let x = vp2px(event.touches[0].x)
let y = vp2px(event.touches[0].y)
switch (event.type) {
case TouchType.Down:
this.pathInfoArray.push(new PathInfo(`M${x} ${y}`, this.paintSize, this.paintColor))
break
case TouchType.Move:
this.pathInfoArray[this.pathInfoArray.length-1].commands += `L${x} ${y}`
break
case TouchType.Up:
this.publishEvent()
setTimeout(()=>{
this.pathInfoArray.length = 0
}, 1500)
break
}
})
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) {
Stack({ alignContent: Alignment.TopEnd }) {
this.Canvas()
Row() {
Button('clear').onClick(() => this.pathInfoArray.length = 0)
}.margin(5)
}.height(545).width('100%')
Button('Test1', {stateEffect: true})
.fontSize(20)
.fontWeight(FontWeight.Bold)
.margin({ top: 10 })
.width('60%')
.height(40)
.gesture(LongPressGesture({ repeat: false })
.onActionEnd(() => {
prompt.showToast({ message: '长点击结束' })
this.publishEvent()
})
)
.onClick((e) => {
let position = 'screenX:' + vp2px(e.screenX) + ' screenY:' + vp2px(e.screenY) + ' x:' + vp2px(e.x) + ' y:' + vp2px(e.y)
console.info(LOG_PREFIX + ' button position : ' + position)
prompt.showToast({ message: position })
this.publishEvent()
})
//滑动
List({ initialIndex: 12, scroller: this.scroller }) {
ForEach(this.arr, (item) => {
ListItem() {
Text(item)
.width('100%')
.height(25)
.fontSize(16)
.textAlign(TextAlign.Center)
.borderRadius(10)
.backgroundColor(0xF9CF93)
.onClick((e) => {
let position = 'screenX:' + vp2px(e.screenX) + ' screenY:' + vp2px(e.screenY) + ' x:' + vp2px(e.x) + ' y:' + vp2px(e.y)
console.info(LOG_PREFIX + ' list1 position : ' + position)
})
}.editable(true)
}, item => item)
}
.listDirection(Axis.Vertical)
.divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 })
.edgeEffect(EdgeEffect.None)
.chainAnimation(false)
.scrollBar(BarState.On)
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
this.getMaxMinNum(scrollOffset)
if (this.notEnd && scrollState == ScrollState.Idle) {
if (this.minNum < 0 && this.maxNum == 0) {
prompt.showToast({ message: '向(上)前滑动' })
this.publishEvent()
} else if (this.minNum == 0 && this.maxNum > 0) {
prompt.showToast({ message: '向(下)后滑动' })
this.publishEvent()
}
this.resetNum()
}
})
.editMode(false)
.margin({ top: 10 })
.height(140)
Text(this.message).fontSize(20).fontWeight(FontWeight.Bold).height(20)
}.height('100%').width('100%')
}
getMaxMinNum(scrollOffset: number){
this.addNum += scrollOffset
this.minNum = Math.min(this.addNum, this.minNum)
this.maxNum = Math.max(this.addNum, this.maxNum)
}
resetNum(){
this.addNum = 0
this.minNum = 0
this.maxNum = 0
}
publishEvent() {
let commonEventPublishData = {
data: this.caseCode, parameters: { res: true }
}
console.info(LOG_PREFIX + 'publishEvent data : ' + JSON.stringify(commonEventPublishData))
try {
commonEvent.publish(EVENT_NAME_BACK, commonEventPublishData, (err, data) => {
if (err && err.code != 0) {
console.info(LOG_PREFIX + 'failed to publish because ' + JSON.stringify(err))
return
}
console.info(LOG_PREFIX + 'success data : ' + JSON.stringify(data))
})
} catch (e) {
console.info(LOG_PREFIX + '[publishEvent] error' + e.message)
}
}
createSubscriber(){
commonEvent.createSubscriber(CommonEventSubscribeInfo).then((subscriber) => {
this.subScriber = subscriber
commonEvent.subscribe(subscriber, (error, commonEventData) => {
if (error.code != 0) {
console.info(LOG_PREFIX + 'subscribe failed. Cause:' + JSON.stringify(error))
return
}
console.info(LOG_PREFIX + 'subscribeTest callback : ' + JSON.stringify(commonEventData))
this.caseCode = commonEventData.data
if(commonEventData.data === 'GestureSimulation_0090'){
this.notEnd = false
}
})
}).catch((error) => {
console.info(LOG_PREFIX + 'createSubscriber failed. Cause: ' + JSON.stringify(error))
return
})
}
}
@Component
struct OnePath {
@ObjectLink pathInfo: PathInfo
build() {
Path()
.width('100%')
.height('100%')
.fillOpacity(0)
.commands(this.pathInfo.commands)
.strokeWidth(this.pathInfo.width)
.stroke(this.pathInfo.color)
}
}
@Observed
class PathInfo {
commands: string
width: number
color: Color
constructor(commands: string, width: number, color: Color) {
this.commands = commands
this.width = width
this.color = color
}
}
\ No newline at end of file
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts
0 → 100644
浏览文件 @
4789f29a
此差异已折叠。
点击以展开。
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.application.Ability
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.gesturesimulationtest.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/Ability.test.ets
0 → 100644
浏览文件 @
4789f29a
此差异已折叠。
点击以展开。
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
4789f29a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/module.json
0 → 100644
浏览文件 @
4789f29a
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:entry_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"abilities"
:
[
{
"name"
:
"com.example.gesturesimulationtest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:MainAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"srcEntrance"
:
"./ets/ServiceExtAbility/ServiceExtAbility.ts"
,
"name"
:
"ServiceExtAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_serviceability"
,
"type"
:
"accessibility"
,
"visible"
:
true
,
"metadata"
:
[
{
"name"
:
"ohos.accessibleability"
,
"resource"
:
"$profile:accessibility_config"
}
],
"permissions"
:
[
"ohos.permission.GET_BUNDLE_INFO"
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.SYSTEM_FLOAT_WINDOW"
,
"reason"
:
"need use ohos.permission.SYSTEM_FLOAT_WINDOW"
},
{
"name"
:
"ohos.permission.CAPTURE_SCREEN"
,
"reason"
:
"need use ohos.permission.SYSTEM_FLOAT_WINDOW"
},
{
"name"
:
"ohos.permission.WRITE_ACCESSIBILITY_CONFIG"
,
"reason"
:
"need use ohos.permission.WRITE_ACCESSIBILITY_CONFIG"
}
]
}
}
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
4789f29a
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"GestureSimulationTest entry"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"GestureSimulationTest MainAbility"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"GestureSimulationTest"
},
{
"name"
:
"description_serviceability"
,
"value"
:
"Gesture后台服务"
},
{
"name"
:
"form_description"
,
"value"
:
"Gesture辅助应用"
}
]
}
\ No newline at end of file
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
4789f29a
6.6 KB
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/accessibility_config.json
0 → 100644
浏览文件 @
4789f29a
{
"accessibilityCapabilities"
:
[
"retrieve"
,
"gesture"
],
"accessibilityCapabilityRationale"
:
"a11y_rationale"
,
"settingsAbility"
:
"com.example.myapplication.accessibilitySetting"
}
\ No newline at end of file
barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
4789f29a
{
"src"
:
[
"MainAbility/pages/index"
]
}
\ No newline at end of file
barrierfree/accessibletest/actsgesturesimulationtest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
4789f29a
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录